From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.49732.1680251116987237319 for ; Fri, 31 Mar 2023 01:25:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GeUeqv7n; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680251116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mipIuNoxbs+58lo0REMTYAYOx0EtdcCz5bGjOZMl78E=; b=GeUeqv7nn6ooyaHGwvbf6OiThUGg7+DxudswMTC+GHY6OhFUtOjqbdw7nWxGfDASetXfWo YR4jom0inWfqyKhdrZqd7UImCB4YBl+fXYuRkZENSVnKMS5d4APzHzBTF7QmceeWof75bM rSqLNe5NTqXSFE1odZK4RRCTMPZx3EA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-1Xre8xdiOEa3BjkF62_Ysg-1; Fri, 31 Mar 2023 04:25:12 -0400 X-MC-Unique: 1Xre8xdiOEa3BjkF62_Ysg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CECDC381459B; Fri, 31 Mar 2023 08:25:11 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DA3A492B00; Fri, 31 Mar 2023 08:25:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C6A1C18000A3; Fri, 31 Mar 2023 10:25:09 +0200 (CEST) Date: Fri, 31 Mar 2023 10:25:09 +0200 From: "Gerd Hoffmann" To: joeyli Cc: Min Xu , devel@edk2.groups.io, Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Michael Roth Subject: Re: [PATCH V1 1/1] OvmfPkg/PlatformPei: Skip PlatformInitEmuVariableNvStore in SEV guest Message-ID: References: <20230329052310.27-1-min.m.xu@intel.com> <4tmi32c3kevecoc3y7mb6jlv7d7ygmctt6bgwflvjybqwphjqk@gnnertcj5kz2> <20230331075956.GJ8569@linux-l9pv.suse> MIME-Version: 1.0 In-Reply-To: <20230331075956.GJ8569@linux-l9pv.suse> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 31, 2023 at 03:59:56PM +0800, joeyli wrote: > Hi Gerd, > > On Thu, Mar 30, 2023 at 09:50:53AM +0200, Gerd Hoffmann wrote: > > On Wed, Mar 29, 2023 at 01:23:10PM +0800, Min Xu wrote: > > > From: Min M Xu > > > > > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4379 > > > > > > PlatformInitEmuVariableNvStore is called to initialize the > > > EmuVariableNvStore with the content pointed by > > > PcdOvmfFlashNvStorageVariableBase. This is because when OVMF is launched > > > with -bios parameter, UEFI variables will be partially emulated, and > > > non-volatile variables may lose their contents after a reboot. This makes > > > the secure boot feature not working. > > > > > > But in SEV guest, this design doesn't work. Because at this point the > > > variable store mapping is still private/encrypted, OVMF will see > > > ciphertext. So we skip the call of PlatformInitEmuVariableNvStore in > > > SEV guest. > > > > I'd suggest to simply build without -D SECURE_BOOT_ENABLE instead. > > Without initializing the emu var store you will not get a functional > > secure boot setup anyway. > > In our case, we already shipped ovmf with -D SECURE_BOOT_ENABLE in a couple > of versions. Removing it will causes problem in VM live migration. Hmm? qemu live-migrates the rom image too. Only after poweroff and reboot the guest will see an updated firmware image. > I will prefer Min M's solution, until SEV experts found better > solution. I'd prefer to not poke holes into secure boot. Re-Initializing the emu var store from rom on each reset is also needed for security reasons in case the efi variable store is not in smm-protected flash memory. take care, Gerd