From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 667B78199E for ; Thu, 5 Jan 2017 05:09:51 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 05 Jan 2017 05:09:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,321,1477983600"; d="scan'208,217";a="49828400" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 05 Jan 2017 05:09:50 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 05:09:50 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 05:09:49 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Thu, 5 Jan 2017 21:09:46 +0800 From: "Yao, Jiewen" To: Laszlo Ersek , "Justen, Jordan L" , edk2-devel-01 Thread-Topic: [edk2] [PATCH] OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_WRITE in S3 boot script Thread-Index: AQHSZioVqFHUxmJepEqLnhObd/ZqR6EnplkAgACzhoCAALgKkIAADDyQgAAicQCAAJum8A== Date: Thu, 5 Jan 2017 13:09:45 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8DBC96@shsmsx102.ccr.corp.intel.com> References: <20161202104844.6093-1-lersek@redhat.com> <148349340944.16413.4237312013765520247@jljusten-ivb> <401681ee-93af-e490-88aa-28291bf41c1a@redhat.com> <148356731339.32514.12895184140738530358@jljusten-ivb> <74D8A39837DF1E4DA445A8C0B3885C503A8DB4FE@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C503A8DB60E@shsmsx102.ccr.corp.intel.com> <1c0ef86a-67c2-8d6f-0949-9df64f67ed7e@redhat.com> In-Reply-To: <1c0ef86a-67c2-8d6f-0949-9df64f67ed7e@redhat.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [PATCH] OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_WRITE in S3 boot script 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: Thu, 05 Jan 2017 13:09:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes, I also agree to add a new MACRO. My only concern is the name - POWER_MGMT_REGISTER_Q35_EFI is too weird. I have no idea on the meaning to use _EFI as suffix. Since we already defined below in PciRootBridgeIo.h, #define EFI_PCI_ADDRESS(bus, dev, func, reg) \ (UINT64) ( \ (((UINTN) bus) << 24) | \ (((UINTN) dev) << 16) | \ (((UINTN) func) << 8) | \ (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) = (reg), 32)))) How about we use POWER_MGMT_REGISTER_Q35_EFI_PCI_ADDRESS, or EFI_PCI_ADDRES= S_POWER_MGMT_REGISTER_Q35 ? Thank you Yao Jiewen From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Thursday, January 5, 2017 7:48 PM To: Yao, Jiewen ; Justen, Jordan L ; edk2-devel-01 Subject: Re: [edk2] [PATCH] OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ= _WRITE in S3 boot script On 01/05/17 02:45, Yao, Jiewen wrote: > Sorry, fix typo: I agree we do **not** use EFI_ prefix here. > > But using _EFI as suffix is also odd. :) > > Do we have better name? > > Such as POWER_MGMT_REGISTER_Q35_ADDRESS ? POWER_MGMT_REGISTER_Q35() already returns a flat address, just in PciLib encoding. So an _ADDRESS suffix for the variant with the UEFI spec encoding is not particularly telling. The new macro name should reflect the PciLib encoding <-> UEFI spec encoding difference. Thanks! Laszlo > > > > Thank you > > Yao Jiewen > > > > *From:*edk2-devel [mailto:edk2-devel-bounces@lists.01.org] *On Behalf Of > *Yao, Jiewen > *Sent:* Thursday, January 5, 2017 9:03 AM > *To:* Justen, Jordan L >; Laszlo Ersek > >; edk2-devel-01 > > *Subject:* Re: [edk2] [PATCH] OvmfPkg/SmmControl2Dxe: correct > PCI_CONFIG_READ_WRITE in S3 boot script > > > > Hi > I agree we do use EFI_ prefix here. > > But using _EFI as suffix is also odd. :) > > Do we have better name? > > Thank you > Yao Jiewen > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jo= rdan Justen > Sent: Thursday, January 5, 2017 6:02 AM > To: Laszlo Ersek > >; edk2-devel-01 <= edk2-devel@lists.01.org > > > Subject: Re: [edk2] [PATCH] OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_RE= AD_WRITE in S3 boot script > > On 2017-01-04 03:19:20, Laszlo Ersek wrote: >> On 01/04/17 02:30, Jordan Justen wrote: >> > On 2016-12-02 02:48:44, Laszlo Ersek wrote: >> >> @@ -362,7 +390,9 @@ OnS3SaveStateInstalled ( >> >> S3SaveState, >> >> EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCO= DE, >> >> EfiBootScriptWidthUint16, >> >> - (UINT64)POWER_MGMT_REGISTER_Q35 (ICH9_GEN_= PMCON_1), >> >> + ConvertPciLibToEfiPciAddress ( >> >> + POWER_MGMT_REGISTER_Q35 (ICH9_GEN_PMCON_= 1) >> > >> > I think we should just add a EFI_POWER_MGMT_REGISTER_Q35 macro. >> >> I thought of that, but I didn't want to use the EFI_ prefix for a macro >> that has nothing to do with the UEFI / PI specs. Can you suggest an >> alternative name? Perhaps POWER_MGMT_REGISTER_Q35_EFI? > > Good point. Yeah, that name seems fine to me. > > -Jordan > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >