From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6C5A881E33 for ; Thu, 17 Nov 2016 17:58:42 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 17 Nov 2016 17:58:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,655,1473145200"; d="scan'208";a="32749910" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 17 Nov 2016 17:58:47 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 17 Nov 2016 17:58:47 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 17 Nov 2016 17:58:46 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.142]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.96]) with mapi id 14.03.0248.002; Fri, 18 Nov 2016 09:58:45 +0800 From: "Ni, Ruiyu" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] PcAtChipsetPkg/PcRtc: Handle NULL table entry in RSDT/XSDT Thread-Index: AQHSPje6TIDJOE0wTk61IDl2kExP16DZS1yggAM0MYCAAYHToA== Date: Fri, 18 Nov 2016 01:58:44 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E7FC70@SHSMSX104.ccr.corp.intel.com> References: <20161114052622.166556-1-ruiyu.ni@intel.com> <734D49CCEBEEF84792F5B80ED585239D58E77C35@SHSMSX104.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB048310395B6F01@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB048310395B6F01@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWU1ZmUzMTctYjQ4NC00YjJlLTk4OTEtMzlmNGNjZDkxM2U2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InBNOFR3d2RJXC9KTDJUXC9wVlYrK3hrQVU0UWpJd1ZvQTByZzY5YWtxWEkzOD0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] PcAtChipsetPkg/PcRtc: Handle NULL table entry in RSDT/XSDT X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 01:58:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Regards, Ray >-----Original Message----- >From: Zeng, Star >Sent: Thursday, November 17, 2016 6:55 PM >To: Ni, Ruiyu ; edk2-devel@lists.01.org >Cc: sean.brogan@microsoft.com; Zeng, Star >Subject: RE: [edk2] [PATCH] PcAtChipsetPkg/PcRtc: Handle NULL table entry = in RSDT/XSDT > >Hi Ray, > >Add two minor comments inline. > >Thanks, >Star >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >> Ruiyu Ni >> Sent: Monday, November 14, 2016 1:26 PM >> To: edk2-devel@lists.01.org >> Subject: [edk2] [PATCH] PcAtChipsetPkg/PcRtc: Handle NULL table entry >> in RSDT/XSDT >> >> The ACPI code may reserve the first entry for a certain table (might >> be FACS) to help with OS compatible issues. > >FACS is in FADT according to ACPI spec. > do you suggest to use FADT in commit message? >> We need to skip the NULL table entry in RSDT/XSDT. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ruiyu Ni >> Cc: Sean Brogan >> --- >> PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c >> b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c >> index 2bb41e7..35e34b7 100644 >> --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c >> +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c >> @@ -1230,6 +1230,11 @@ ScanTableInSDT ( >> // >> Table =3D 0; > >How about to remove this superfluous line " Table =3D 0;"? > // // Find FADT in RSDT // if (Fadt =3D=3D NULL && Rsdp->RsdtAddress !=3D 0) { Fadt =3D ScanTableInSDT ( (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, sizeof (UINT32) ); } when above code runs in 64bit env, CopyMem only fills the 4-byte in Table l= eaving hi-4-byte un-initialized. so we need to set Table to 0 to fill hi-4-byte. >> CopyMem (&Table, (VOID *) (EntryBase + Index * TablePointerSize), >> TablePointerSize); >> + >> + if (Table =3D=3D NULL) { >> + continue; >> + } >> >> + >> if (Table->Signature =3D=3D Signature) { >> return Table; >> } >> -- >> 2.9.0.windows.1 >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel