ACK: [PATCH 2/3] dmi: dmicheck: add 64-bit integer to dmi_reserved_bits_check

ivanhu ivan.hu at canonical.com
Tue May 23 08:05:41 UTC 2017



On 05/13/2017 07:34 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
>   src/dmi/dmicheck/dmicheck.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index e7b0ffb..85b49d5 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -801,8 +801,8 @@ static void dmi_reserved_bits_check(fwts_framework *fw,
>   	uint8_t min,
>   	uint8_t max)
>   {
> -	uint32_t mask = 0;
> -	uint32_t val;
> +	uint64_t mask = 0;
> +	uint64_t val;
>   	uint8_t i;
>   
>   	for (i = min; i <= max; i++) {
> @@ -837,6 +837,16 @@ static void dmi_reserved_bits_check(fwts_framework *fw,
>   				"Value 0x%8.8" PRIx32 " was used but bits %" PRIu8
>   				"..%" PRIu8 " should be reserved while accessing entry "
>   				"'%s' @ 0x%8.8" PRIx32 ", field '%s', offset 0x%2.2x",
> +				(uint32_t)val, min, max, table, addr, field, offset);
> +		}
> +		break;
> +	case sizeof(uint64_t):
> +		val = GET_UINT64((hdr->data) + offset);
> +		if (val & mask) {
> +			fwts_failed(fw, LOG_LEVEL_MEDIUM, DMI_RESERVED_BIT_USED,
> +				"Value 0x%16.16" PRIx64 " was used but bits %" PRIu8
> +				"..%" PRIu8 " should be reserved while accessing entry "
> +				"'%s' @ 0x%8.8" PRIx32 ", field '%s', offset 0x%2.2x",
>   				val, min, max, table, addr, field, offset);
>   		}
>   		break;
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20170523/77a217e9/attachment-0001.html>


More information about the fwts-devel mailing list