From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: chasel.chiu@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Mon, 02 Sep 2019 07:16:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 07:16:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,459,1559545200"; d="scan'208";a="187011412" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by orsmga006.jf.intel.com with ESMTP; 02 Sep 2019 07:16:18 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by KMSMSX154.gar.corp.intel.com ([169.254.12.93]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 22:16:17 +0800 From: "Chiu, Chasel" To: "Sinha, Ankit" , "devel@edk2.groups.io" CC: "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-platforms] [PATCH v2 1/1] MinPlatformPkg/Acpi: MADT NMI default flag set to Edge-Triggered Thread-Topic: [edk2-platforms] [PATCH v2 1/1] MinPlatformPkg/Acpi: MADT NMI default flag set to Edge-Triggered Thread-Index: AQHVX4I4WlUpi1BhhU+nEKIfYT9PEKcYcuZw Date: Mon, 2 Sep 2019 14:16:17 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC5047E7E2@PGSMSX111.gar.corp.intel.com> References: <20190830222808.20308-1-ankit.sinha@intel.com> In-Reply-To: <20190830222808.20308-1-ankit.sinha@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzhkZTE4OGUtZTI5NS00N2Q5LTk3Y2UtMGJhOGEwNGU0YzBkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaEdDTkNpSzBLNnVnN3Rab3BrU1BxanhIUFh3clJKa1NqTFIydG9iQ24wVnFSN2xxbHRjOFhkM09jckt6eU1XUSJ9 x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: Sinha, Ankit > Sent: Saturday, August 31, 2019 6:28 AM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [edk2-platforms] [PATCH v2 1/1] MinPlatformPkg/Acpi: MADT NMI > default flag set to Edge-Triggered >=20 > 1. Default APIC NMI structure in MADT changed to expose > Level-Triggered interrupts. > 2. x2APIC NMI structure won't be exposed to OS if x2APIC is not enabled. >=20 > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao >=20 > Signed-off-by: Ankit Sinha > --- > Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 54 > ++++++++++---------- > 1 file changed, 28 insertions(+), 26 deletions(-) >=20 > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > index 5eb727929bfb..1b251ca2962d 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > @@ -1,7 +1,7 @@ > /** @file > ACPI Platform Driver >=20 > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -1049,7 +1049,7 @@ InstallMadtFromScratch ( > LocalApciNmiStruct.Type =3D EFI_ACPI_4_0_LOCAL_APIC_NMI; > LocalApciNmiStruct.Length =3D sizeof > (EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE); > LocalApciNmiStruct.AcpiProcessorId =3D 0xFF; // Applies to all > processors > - LocalApciNmiStruct.Flags =3D 0x000D; // Flags - > Level-tiggered, Active High > + LocalApciNmiStruct.Flags =3D 0x0005; // Flags - > Edge-tiggered, Active High > LocalApciNmiStruct.LocalApicLint =3D 0x1; >=20 > ASSERT (MadtStructsIndex < MaxMadtStructCount); @@ -1066,24 > +1066,26 @@ InstallMadtFromScratch ( > // > // Build Local x2APIC NMI Structure > // > - LocalX2ApicNmiStruct.Type =3D EFI_ACPI_4_0_LOCAL_X2APIC_NMI; > - LocalX2ApicNmiStruct.Length =3D sizeof > (EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE); > - LocalX2ApicNmiStruct.Flags =3D 0x000D; // Flags - > Level-tiggered, Active High > - LocalX2ApicNmiStruct.AcpiProcessorUid =3D 0xFFFFFFFF; // Applies to a= ll > processors > - LocalX2ApicNmiStruct.LocalX2ApicLint =3D 0x01; > - LocalX2ApicNmiStruct.Reserved[0] =3D 0x00; > - LocalX2ApicNmiStruct.Reserved[1] =3D 0x00; > - LocalX2ApicNmiStruct.Reserved[2] =3D 0x00; > + if (mX2ApicEnabled) { > + LocalX2ApicNmiStruct.Type =3D EFI_ACPI_4_0_LOCAL_X2APIC_NMI; > + LocalX2ApicNmiStruct.Length =3D sizeof > (EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE); > + LocalX2ApicNmiStruct.Flags =3D 0x000D; // Flags - > Level-tiggered, Active High > + LocalX2ApicNmiStruct.AcpiProcessorUid =3D 0xFFFFFFFF; // Applies to > all processors > + LocalX2ApicNmiStruct.LocalX2ApicLint =3D 0x01; > + LocalX2ApicNmiStruct.Reserved[0] =3D 0x00; > + LocalX2ApicNmiStruct.Reserved[1] =3D 0x00; > + LocalX2ApicNmiStruct.Reserved[2] =3D 0x00; >=20 > - ASSERT (MadtStructsIndex < MaxMadtStructCount); > - Status =3D CopyStructure ( > - &MadtTableHeader.Header, > - (STRUCTURE_HEADER *) &LocalX2ApicNmiStruct, > - &MadtStructs[MadtStructsIndex++] > - ); > - if (EFI_ERROR (Status)) { > - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (x2APIC NMI) failed: %r\n", > Status)); > - goto Done; > + ASSERT (MadtStructsIndex < MaxMadtStructCount); > + Status =3D CopyStructure ( > + &MadtTableHeader.Header, > + (STRUCTURE_HEADER *) &LocalX2ApicNmiStruct, > + &MadtStructs[MadtStructsIndex++] > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (x2APIC NMI) failed: > %r\n", Status)); > + goto Done; > + } > } >=20 > // > @@ -1167,7 +1169,7 @@ InstallMcfgFromScratch ( > // > // Set MCFG table "Length" field based on the number of PCIe segments > enumerated so far > // > - McfgTable->Header.Length =3D (UINT32)(sizeof > (EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEA > DER) + > + McfgTable->Header.Length =3D (UINT32)(sizeof > + > (EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEA > DER) + > sizeof > (EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_A > DDRESS_ALLOCATION_STRUCTURE) * SegmentCount); >=20 > Segment =3D (VOID *)(McfgTable + 1); > @@ -1329,11 +1331,11 @@ PlatformUpdateTables ( > HpetCapabilities.Uint64 =3D HpetCapabilitiesData; > HpetCapabilitiesData =3D MmioRead32 (HpetBaseAddress + > HPET_GENERAL_CAPABILITIES_ID_OFFSET + 4); > HpetCapabilities.Uint64 |=3D LShiftU64 (HpetCapabilitiesData, 32); > - HpetBlockId.Bits.Revision =3D HpetCapabilities.Bits.Revision; > - HpetBlockId.Bits.NumberOfTimers =3D > HpetCapabilities.Bits.NumberOfTimers; > - HpetBlockId.Bits.CounterSize =3D HpetCapabilities.Bits.CounterSiz= e; > - HpetBlockId.Bits.Reserved =3D 0; > - HpetBlockId.Bits.LegacyRoute =3D HpetCapabilities.Bits.LegacyRout= e; > + HpetBlockId.Bits.Revision =3D HpetCapabilities.Bits.Revision; > + HpetBlockId.Bits.NumberOfTimers =3D > HpetCapabilities.Bits.NumberOfTimers; > + HpetBlockId.Bits.CounterSize =3D HpetCapabilities.Bits.CounterSiz= e; > + HpetBlockId.Bits.Reserved =3D 0; > + HpetBlockId.Bits.LegacyRoute =3D HpetCapabilities.Bits.LegacyRout= e; > HpetBlockId.Bits.VendorId =3D HpetCapabilities.Bits.VendorId; > HpetTable->EventTimerBlockId =3D HpetBlockId.Uint32; > HpetTable->MainCounterMinimumClockTickInPeriodicMode =3D > (UINT16)HpetCapabilities.Bits.CounterClockPeriod; > @@ -1459,7 +1461,7 @@ UpdateLocalTable ( >=20 > for (Index =3D 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); > Index++) { > CurrentTable =3D mLocalTable[Index]; > - > + > PlatformUpdateTables (CurrentTable, &Version); >=20 > TableHandle =3D 0; > -- > 2.16.2.windows.1