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 8D251821FE for ; Mon, 20 Feb 2017 16:17:16 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 20 Feb 2017 16:17:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,187,1484035200"; d="scan'208";a="67578203" Received: from ahirst-mobl.amr.corp.intel.com (HELO localhost) ([10.252.140.121]) by fmsmga005.fm.intel.com with ESMTP; 20 Feb 2017 16:17:15 -0800 MIME-Version: 1.0 To: Laszlo Ersek Message-ID: <148763623564.6357.18067670639959862482@jljusten-ivb> From: Jordan Justen In-Reply-To: <82a88081-165f-bf58-c77e-942600e932d1@redhat.com> Cc: edk2-devel-01 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> User-Agent: alot/0.5.1 Date: Mon, 20 Feb 2017 16:17:15 -0800 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 00:17:16 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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... ...so, let's figure that out later. :) Reviewed-by: Jordan Justen > > - 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 > = >=20