qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dov Murik <dovmurik@linux.ibm.com>
To: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Tom Lendacky" <thomas.lendacky@amd.com>,
	"Ashish Kalra" <ashish.kalra@amd.com>,
	"Brijesh Singh" <brijesh.singh@amd.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"James Bottomley" <jejb@linux.ibm.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Dov Murik" <dovmurik@linux.ibm.com>,
	"Tobin Feldman-Fitzthum" <tobin@linux.ibm.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch
Date: Sun, 14 Nov 2021 20:02:18 +0200	[thread overview]
Message-ID: <ea55111b-85d9-c05a-7808-fcdcbe1e8bcc@linux.ibm.com> (raw)
In-Reply-To: <20211111100048.3299424-1-dovmurik@linux.ibm.com>

Paolo,

Can you please add this series (already reviewed) to the fixes in 6.2?

Thanks,
-Dov


On 11/11/2021 12:00, Dov Murik wrote:
> Tom Lendacky and Brijesh Singh reported two issues with launching SEV
> guests with the -kernel QEMU option when an old [1] or wrongly configured [2]
> OVMF images are used.
> 
> To fix these issues, these series "hides" the whole kernel hashes
> additions behind a kernel-hashes=on option (with default value of
> "off").  This allows existing scenarios to work without change, and
> explicitly forces kernel hashes additions for guests that require that.
> 
> Patch 1 introduces a new boolean option "kernel-hashes" on the sev-guest
> object, and patch 2 causes QEMU to add kernel hashes only if its
> explicitly set to "on".  This will mitigate both experienced issues
> because the default of the new setting is off, and therefore is backward
> compatible with older OVMF images (which don't have a designated hashes
> table area) or with guests that don't wish to measure the kernel/initrd.
> 
> Patch 3 fixes the wording on the error message displayed when no hashes
> table is found in the guest firmware.
> 
> Patch 4 detects incorrect address and length of the guest firmware
> hashes table area and fails the boot.
> 
> Patch 5 is a refactoring of parts of the same function
> sev_add_kernel_loader_hashes() to calculate all padding sizes at
> compile-time.  Patch 6 also changes the same function and replaces the
> call to qemu_map_ram_ptr() with address_space_map() to allow for error
> detection.  Patches 5-6 are not required to fix the issues above, but
> are suggested as an improvement (no functional change intended).
> 
> To enable addition of kernel/initrd/cmdline hashes into the SEV guest at
> launch time, specify:
> 
>     qemu-system-x86_64 ... -object sev-guest,...,kernel-hashes=on
> 
> 
> [1] https://lore.kernel.org/qemu-devel/3b9d10d9-5d9c-da52-f18c-cd93c1931706@amd.com/
> [2] https://lore.kernel.org/qemu-devel/001dd81a-282d-c307-a657-e228480d4af3@amd.com/
> 
> 
> Changes in v3:
>  - Patch 1/6: Add "(since 6.2)" in the documentation of the
>    kernel-hashes option (thanks Markus)
>  - Patch 3/6: Change error string use "kernel" instead of "-kernel"
>    (thanks Daniel)
> 
> v2: https://lore.kernel.org/qemu-devel/20211108134840.2757206-1-dovmurik@linux.ibm.com/
> Changes in v2:
>  - Instead of trying to figure out whether to add hashes or not,
>    explicity declare an option (kernel-hashes=on) for that.  When that
>    option is turned on, fail if the hashes cannot be added.
>  - Rephrase error message when no hashes table GUID is found.
>  - Replace qemu_map_ram_ptr with address_space_map
> 
> v1: https://lore.kernel.org/qemu-devel/20211101102136.1706421-1-dovmurik@linux.ibm.com/
> 
> 
> Dov Murik (6):
>   qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option
>   target/i386/sev: Add kernel hashes only if sev-guest.kernel-hashes=on
>   target/i386/sev: Rephrase error message when no hashes table in guest
>     firmware
>   target/i386/sev: Fail when invalid hashes table area detected
>   target/i386/sev: Perform padding calculations at compile-time
>   target/i386/sev: Replace qemu_map_ram_ptr with address_space_map
> 
>  qapi/qom.json     |  7 ++++-
>  target/i386/sev.c | 77 +++++++++++++++++++++++++++++++++++++++--------
>  qemu-options.hx   |  6 +++-
>  3 files changed, 75 insertions(+), 15 deletions(-)
> 
> 
> base-commit: af531756d25541a1b3b3d9a14e72e7fedd941a2e
> 


  parent reply	other threads:[~2021-11-14 18:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 10:00 [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch Dov Murik
2021-11-11 10:00 ` [PATCH v3 1/6] qapi/qom, target/i386: sev-guest: Introduce kernel-hashes=on|off option Dov Murik
2021-11-11 10:00 ` [PATCH v3 2/6] target/i386/sev: Add kernel hashes only if sev-guest.kernel-hashes=on Dov Murik
2021-11-11 10:00 ` [PATCH v3 3/6] target/i386/sev: Rephrase error message when no hashes table in guest firmware Dov Murik
2021-11-11 10:20   ` Daniel P. Berrangé
2021-11-11 10:00 ` [PATCH v3 4/6] target/i386/sev: Fail when invalid hashes table area detected Dov Murik
2021-11-11 10:00 ` [PATCH v3 5/6] target/i386/sev: Perform padding calculations at compile-time Dov Murik
2021-11-11 10:00 ` [PATCH v3 6/6] target/i386/sev: Replace qemu_map_ram_ptr with address_space_map Dov Murik
2021-11-14 18:02 ` Dov Murik [this message]
2021-11-18 12:21   ` [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch Dov Murik
2021-11-18 13:02     ` Daniel P. Berrangé
2021-11-18 13:11       ` Dov Murik
2021-11-18 13:40       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea55111b-85d9-c05a-7808-fcdcbe1e8bcc@linux.ibm.com \
    --to=dovmurik@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=ashish.kalra@amd.com \
    --cc=berrange@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jejb@linux.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thomas.lendacky@amd.com \
    --cc=tobin@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).