From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 AAF748199E for ; Thu, 5 Jan 2017 05:15:17 -0800 (PST) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3ED1761BAF; Thu, 5 Jan 2017 13:15:18 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-100.phx2.redhat.com [10.3.116.100]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v05DFGZQ021943; Thu, 5 Jan 2017 08:15:17 -0500 To: "Yao, Jiewen" , "Justen, Jordan L" , edk2-devel-01 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> <74D8A39837DF1E4DA445A8C0B3885C503A8DBC96@shsmsx102.ccr.corp.intel.com> From: Laszlo Ersek Message-ID: Date: Thu, 5 Jan 2017 14:15:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503A8DBC96@shsmsx102.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 05 Jan 2017 13:15:18 +0000 (UTC) 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:15:17 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 01/05/17 14:09, Yao, Jiewen wrote: > 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, > > #defineEFI_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_ADDRESS_POWER_MGMT_REGISTER_Q35 ? POWER_MGMT_REGISTER_Q35_EFI_PCI_ADDRESS() looks fine to me, if Jordan agrees. Thanks! Laszlo > > > > 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 Jordan Justen >> Sent: Thursday, January 5, 2017 6:02 AM >> To: Laszlo Ersek > >; edk2-devel-01 > > >> Subject: Re: [edk2] [PATCH] OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_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_OPCODE, >>> >> 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 >> >