diff mbox series

[08/10] dmicheck: update tests in type 17

Message ID 20200521023802.1553594-8-alex.hung@canonical.com
State Accepted
Headers show
Series [01/10] dmicheck: test feature flags in type 2 | expand

Commit Message

Alex Hung May 21, 2020, 2:38 a.m. UTC
1. update form factor - die
2. add firmware version string check
3. add reserved bits for extended speed and extended configured memory
speed

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/dmi/dmicheck/dmicheck.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Colin Ian King May 26, 2020, 4:35 p.m. UTC | #1
On 21/05/2020 03:38, Alex Hung wrote:
> 1. update form factor - die
> 2. add firmware version string check
> 3. add reserved bits for extended speed and extended configured memory
> speed
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/dmi/dmicheck/dmicheck.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index f23c353b..f24290f1 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1606,7 +1606,7 @@ static void dmicheck_entry(fwts_framework *fw,
>  				break;
>  			if (hdr->length < 0x15)
>  				break;
> -			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0xf);
> +			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0x10);
>  			dmi_str_check(fw, table, addr, "Locator", hdr, 0x10);
>  			dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11);
>  			dmi_min_max_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, 0x1, 0x21);
> @@ -1622,10 +1622,15 @@ static void dmicheck_entry(fwts_framework *fw,
>  			if (hdr->length < 0x20)
>  				break;
>  			dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31);
> -			if (hdr->length < 0x3c)
> +			if (hdr->length < 0x4c)
>  				break;
>  			dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7);
>  			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15);
> +			dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
> +			if (hdr->length < 0x54)
> +				break;
> +			dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31);
> +			dmi_reserved_bits_check(fw, table, addr, "Extended Configured Memory Speed", hdr, sizeof(uint32_t), 0x58, 31, 31);
>  
>  			break;
>  
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu May 28, 2020, 6:31 a.m. UTC | #2
On 5/21/20 10:38 AM, Alex Hung wrote:
> 1. update form factor - die
> 2. add firmware version string check
> 3. add reserved bits for extended speed and extended configured memory
> speed
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/dmi/dmicheck/dmicheck.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index f23c353b..f24290f1 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1606,7 +1606,7 @@ static void dmicheck_entry(fwts_framework *fw,
>  				break;
>  			if (hdr->length < 0x15)
>  				break;
> -			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0xf);
> +			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0x10);
>  			dmi_str_check(fw, table, addr, "Locator", hdr, 0x10);
>  			dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11);
>  			dmi_min_max_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, 0x1, 0x21);
> @@ -1622,10 +1622,15 @@ static void dmicheck_entry(fwts_framework *fw,
>  			if (hdr->length < 0x20)
>  				break;
>  			dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31);
> -			if (hdr->length < 0x3c)
> +			if (hdr->length < 0x4c)
>  				break;
>  			dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7);
>  			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15);
> +			dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
> +			if (hdr->length < 0x54)
> +				break;
> +			dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31);
> +			dmi_reserved_bits_check(fw, table, addr, "Extended Configured Memory Speed", hdr, sizeof(uint32_t), 0x58, 31, 31);
>  
>  			break;
>  
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index f23c353b..f24290f1 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -1606,7 +1606,7 @@  static void dmicheck_entry(fwts_framework *fw,
 				break;
 			if (hdr->length < 0x15)
 				break;
-			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0xf);
+			dmi_min_max_uint8_check(fw, table, addr, "Form Factor", hdr, 0xe, 0x1, 0x10);
 			dmi_str_check(fw, table, addr, "Locator", hdr, 0x10);
 			dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11);
 			dmi_min_max_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, 0x1, 0x21);
@@ -1622,10 +1622,15 @@  static void dmicheck_entry(fwts_framework *fw,
 			if (hdr->length < 0x20)
 				break;
 			dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31);
-			if (hdr->length < 0x3c)
+			if (hdr->length < 0x4c)
 				break;
 			dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7);
 			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15);
+			dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
+			if (hdr->length < 0x54)
+				break;
+			dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31);
+			dmi_reserved_bits_check(fw, table, addr, "Extended Configured Memory Speed", hdr, sizeof(uint32_t), 0x58, 31, 31);
 
 			break;