Issues in fadt check item?

Dong, Eric eric.dong at intel.com
Wed Dec 7 12:51:59 UTC 2016


Hi,

When I use fwts to check uefi bios code, it reports some issues related to fadt check item. After check the uefi code and acpi spec, I didn't find error for uefi code. So I download fwts code (fwts_16.11.00) and i think some bugs in the fadt check item.
One issue like below:
static void acpi_table_check_fadt_pm2_cnt_blk(fwts_framework *fw)
{
                if (fadt->pm2_cnt_blk == 0 && fadt->header.length < 208) {
                                fwts_skipped(fw, "FADT PM2_CNT_BLK not being used.");
                                return;
                }

                if (fadt->pm2_cnt_blk == 0 && fadt->x_pm2_cnt_blk.address == 0) {
                                fwts_skipped(fw, "FADT PM2_CNT_BLK not being used.");
                                return;
                }

                if ((fadt->pm2_cnt_blk != 0 && fadt->x_pm2_cnt_blk.address == 0) ||
                    (fadt->pm2_cnt_blk == 0 && fadt->x_pm2_cnt_blk.address != 0))
                                fwts_passed(fw,
                                                    "FADT only one of the 32-bit or 64-bit "
                                                    "PM2_CNT_BLK fields is being used.");
                else
                                fwts_failed(fw, LOG_LEVEL_MEDIUM,
                                                    "FADTPm2CntBlkOnlyOneField",
                                                    "FADT PM2_CNT_BLK field has both the 32-bit "
                                                    "and the 64-bit field set.");
                {
                if ((uint64_t)fadt->pm2_cnt_blk == fadt->x_pm2_cnt_blk.address) {
                                fwts_passed(fw,
                                                    "FADT 32- and 64-bit PM2_CNT_BLK fields are "
                                                    "at least equal.");
                                fwts_advice(fw,
                                                    "Both FADT 32- and 64-bit PM2_CNT_BLK "
                                                    "fields are being used, but only one should be "
                                                    "non-zero.  However, they are at least equal so "
                                                    "the kernel will at least have a usable value.");
                } else {
                                fwts_failed(fw, LOG_LEVEL_MEDIUM,
                                                    "FADTPm2CntBlkNotSet",
                                                    "FADT PM2_CNT_BLK is a required field and must "
                                                    "have either a 32-bit or 64-bit address set.");
                                fwts_advice(fw,
                                                    "Both FADT 32- and 64-bit PM2_CNT_BLK "
                                                    "fields are being used, but only one should be "
                                                    "non-zero.  Since the fields value are not equal "
                                                    "the kernel cannot unambiguously determine which "
                                                    "value is the correct one.");
                }
}
}

I think the fix is: remove the red mark code and add green mark code. what do you think?

Thanks,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20161207/f987e0f6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fwts
Type: application/octet-stream
Size: 163957 bytes
Desc: fwts
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20161207/f987e0f6/attachment-0001.obj>


More information about the fwts-devel mailing list