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 01BAB82164 for ; Tue, 21 Feb 2017 04:15:35 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 5910C81255; Tue, 21 Feb 2017 12:15:36 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCFYik013501; Tue, 21 Feb 2017 07:15:35 -0500 To: Jordan Justen References: <20170216204137.30221-1-lersek@redhat.com> <20170216204137.30221-6-lersek@redhat.com> <148736674932.16600.18157429547029640715@jljusten-ivb> <183f0597-4a1f-c5aa-a687-a728415582e7@redhat.com> <82a88081-165f-bf58-c77e-942600e932d1@redhat.com> <148763623564.6357.18067670639959862482@jljusten-ivb> Cc: edk2-devel-01 From: Laszlo Ersek Message-ID: <845ba750-1342-043a-6564-9171091b8132@redhat.com> Date: Tue, 21 Feb 2017 13:15:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <148763623564.6357.18067670639959862482@jljusten-ivb> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Feb 2017 12:15:36 +0000 (UTC) Subject: Re: [PATCH 5/5] OvmfPkg/AcpiPlatformDxe: replay QEMU_LOADER_WRITE_POINTER commands at S3 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: Tue, 21 Feb 2017 12:15:36 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 02/21/17 01:17, Jordan Justen wrote: > On 2017-02-17 14:48:52, Laszlo Ersek wrote: >> On 02/17/17 23:41, Laszlo Ersek wrote: >> >> [snip] >> >>> I briefly considered a QemuFwCfgLib API that lets the caller inquire >>> about DMA enablement, but it just doesn't feel right, and (considering >>> the above) it's not even useful. Later I would like to abstract away >>> this S3 boot script munging, from both this driver and SmmControl2Dxe, >>> but the interface is a hard nut: >>> >>> - SEC lib instance (exists only for x86): must return EFI_UNSUPPORTED >>> - PEI/DXE instance (exists only for x86): must be split into >>> - PEI only: returns EFI_UNSUPPORTED >>> - DXE only: >>> - returns EFI_UNSUPPORTED if S3 is disabled >>> - works if the protocol is available >>> - what does it do if the protocol is not available *yet*? >>> - can't use a DEPEX (whole client module won't load with S3 >>> disabled!) >>> - register protocol notify in constructor? then what? >>> - collect operations and write them to boot script at EndOfDxe? >>> - that always turns out to be a bad idea, due to unspecified >>> callback invocation order >> >> One thing I can imagine here is: simply push the dependency handling to >> the client module. If the protocol is not found, just return >> EFI_NOT_STARTED, and let the client module deal with that. The client >> can set its own DEPEX, or register a protocol notify as necessary. So I >> guess this could be solved after all, hopefully. > > Yeah, I figured the S3 depex is the tricky part. Also, adding an S3 > specific interface doesn't fit well in QemuFwCfgLib, which I think > should focus on just the raw fw-cfg interface. Based on that, I'm not > particularly enthused about QemuFwCfgS3Enabled. > > Maybe we could add a new S3+fw-cfg library interface? Maybe > QemuS3FwCfgLib? I'm not sure it makes sense, or solves all the > requirements anyhow... I think it would make sense, yes; I actually thought of that too, but didn't dare suggest it, remembering how opposed you had been to a separate IoFifoLib recently :) > > ...so, let's figure that out later. :) I filed for this. > > Reviewed-by: Jordan Justen Series committed in range 85520606ad45..df73df138d9d. I plan to post an "easy" followup series, but that won't change functionality, and there's no similar time pressure for it. Thank you very much for the prompt review! Laszlo > >>> - DXE only instance (exists for arm/aarch64 only): very different from >>> the x86 impl already (uses chunked MMIO at the bottom, not REP IO), >>> so unification with the above is hard >>> >>> While writing this patch, I was racking my brain for hours about this. I >>> think I must have restarted this patch three or four times just because >>> of that. >>> >>> Ultimately, it's the second driver where we use a meaningful boot script >>> fragment, and usually the third occurrence of a pattern is where the >>> generics start to emerge, and (hopefully) become a candidate for >>> factoring out. I dislike the repetitive and hard-to-read nature of the >>> opcode additions (hence the profuse comments above), but from the two >>> instances we can look at (SmmControl2Dxe and this patch), I couldn't >>> really abstract away a natural interface. >>> >>> I think it is a relatively big task anyway, deserving its own BZ (not to >>> be confused with the also separate BZ that I proposed for residual / >>> cleanup patches on top of this series, should you recommend such.) If >>> you felt inclined to research / prototype that, that would be huge... >>> >>> Thanks! >>> Laszlo >>> >>>> >>>> -Jordan >> >>