[RFC PATCH v3 3/4] i386/sev: Reorder struct declarations

2023-03-02 Thread Dov Murik
Move the declaration of PaddedSevHashTable before SevSnpGuest so we can add a new such field to the latter. No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 56 +++ 1 file changed, 28 insertions(+), 28 deletions

[RFC PATCH v3 0/4] i386/sev: Support measured direct kernel boot on SNP

2023-03-02 Thread Dov Murik
Cc: Eric Blake Cc: Markus Armbruster Cc: Marcelo Tosatti Cc: Gerd Hoffmann Cc: James Bottomley Cc: Tom Lendacky Cc: Michael Roth Cc: Ashish Kalra Cc: Mario Smarduch Cc: Tobin Feldman-Fitzthum Dov Murik (4): qapi, i386: Move kernel-hashes to SevCommonProperties i386/sev: Extract

[RFC PATCH v3 4/4] i386/sev: Allow measured direct kernel boot on SNP

2023-03-02 Thread Dov Murik
for SEV launch secrets which are not usable anyway on SNP. If the user disabled kernel hashes, QEMU pre-validates the kernel hashes page as a zero page. Signed-off-by: Dov Murik --- include/hw/i386/pc.h | 2 ++ target/i386/sev.c| 40 2 files changed

[RFC PATCH v3 2/4] i386/sev: Extract build_kernel_loader_hashes

2023-03-02 Thread Dov Murik
Extract the building of the kernel hashes table out from sev_add_kernel_loader_hashes() to allow building it in other memory areas (for SNP support). No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 110 ++ 1 file

[RFC PATCH v3 1/4] qapi, i386: Move kernel-hashes to SevCommonProperties

2023-03-02 Thread Dov Murik
In order to enable kernel-hashes for SNP, pull it from SevGuestProperties to its parent SevCommonProperties so it will be available for both SEV and SNP. Signed-off-by: Dov Murik --- qapi/qom.json | 12 ++-- target/i386/sev.c | 44 ++-- 2

Re: [RFC PATCH v2 1/2] qapi, i386: Move kernel-hashes to SevCommonProperties

2023-02-16 Thread Dov Murik
Hello Markus, On 16/02/2023 11:24, Markus Armbruster wrote: > Dov Murik writes: > >> In order to enable kernel-hashes for SNP, pull it from >> SevGuestProperties to its parent SevCommonProperties so >> it will be available for both SEV and SNP. > > Missing &

Re: [RFC PATCH v2 0/2] i386/sev: Support measured direct kernel boot on SNP

2023-02-16 Thread Dov Murik
On 16/02/2023 10:49, Dov Murik wrote: > This RFC patch series is based on AMD's RFC upmv10-snpv3 tree [1]. > Note that in order to test this you must use '-machine pc-q35-7.1' to circumvent the SETUP_RNG_SEED bug [1] that interferes with the measured kernel. [1] https://lore.kernel.or

[RFC PATCH v2 1/2] qapi, i386: Move kernel-hashes to SevCommonProperties

2023-02-16 Thread Dov Murik
In order to enable kernel-hashes for SNP, pull it from SevGuestProperties to its parent SevCommonProperties so it will be available for both SEV and SNP. --- qapi/qom.json | 12 ++-- target/i386/sev.c | 44 ++-- 2 files changed, 24

[RFC PATCH v2 2/2] i386/sev: Allow measured direct kernel boot on SNP

2023-02-16 Thread Dov Murik
disabled kernel hashes, QEMU pre-validates the page as a zero page. Signed-off-by: Dov Murik --- target/i386/sev.c | 51 +-- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 6b8e85888f

[RFC PATCH v2 0/2] i386/sev: Support measured direct kernel boot on SNP

2023-02-16 Thread Dov Murik
Smarduch Cc: Tobin Feldman-Fitzthum Dov Murik (2): qapi, i386: Move kernel-hashes to SevCommonProperties i386/sev: Allow measured direct kernel boot on SNP qapi/qom.json | 12 +++--- target/i386/sev.c | 95 +-- 2 files changed, 65 insertions(+), 42

Re: [PATCH RFC 0/7] revert RNG seed mess

2023-02-08 Thread Dov Murik
On 09/02/2023 8:03, Dov Murik wrote: > Hi Michael, > > On 08/02/2023 23:12, Michael S. Tsirkin wrote: >> All attempts to fix up passing RNG seed via setup_data entry failed. >> Let's just rip out all of it. We'll start over. >> >> >> Warning: all I

Re: [PATCH RFC 0/7] revert RNG seed mess

2023-02-08 Thread Dov Murik
files changed, 49 insertions(+), 161 deletions(-) > I tested this series with SEV measured boot using AmdSev OVMF. The boot succeeds, and the hashes computed for kernel/initrd/cmdline are identical to the ones computed by qemu 7.1.0, which are the hashes that the guest owner would expect. As for non-EFI (non-SEV) guests, I did a very simple test of starting a non-EFI guest and it looks OK, but more testing is needed. So: Tested-by: Dov Murik Thank you! -Dov

Re: [PATCH] x86: temporarily remove all attempts to provide setup_data

2023-02-08 Thread Dov Murik
while leaving intact the infrastructure we'll need in the future to try > again. > > Cc: Michael S. Tsirkin > Cc: Dov Murik > Cc: Tom Lendacky > Cc: Gerd Hoffmann > Cc: Daniel P. Berrangé > Cc: Paolo Bonzini > Cc: Richard Henderson > Cc: H. Peter Anvin > Cc

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
On 08/02/2023 17:49, Dov Murik wrote: > But I now think there's another bug with the current patches: > > > /* >* Add the NUL terminator, some padding for the microvm cmdline fiddling >* hack, and then align to 16 bytes as a paranoia measure >*/ >

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
On 08/02/2023 17:26, Tom Lendacky wrote: > On 2/7/23 17:24, Jason A. Donenfeld wrote: >> Hi Tom, >> >> On Tue, Feb 7, 2023 at 8:21 PM Tom Lendacky >> wrote: >>> >>> On 2/7/23 15:45, Michael S. Tsirkin wrote: >>>> On Tue, Feb 07, 2023 a

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
On 08/02/2023 1:21, Tom Lendacky wrote: > On 2/7/23 15:45, Michael S. Tsirkin wrote: >> On Tue, Feb 07, 2023 at 08:41:16AM +0000, Dov Murik wrote: >>> Recent feature to supply RNG seed to the guest kernel modifies the >>> kernel command-line by adding extra d

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
On 08/02/2023 1:24, Jason A. Donenfeld wrote: > Hi Tom, > > On Tue, Feb 7, 2023 at 8:21 PM Tom Lendacky wrote: >> >> On 2/7/23 15:45, Michael S. Tsirkin wrote: >>> On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: >>>> Recent feature to su

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
Hi Daniel, On 08/02/2023 11:30, Daniel P. Berrangé wrote: > On Tue, Feb 07, 2023 at 08:41:16AM +0000, Dov Murik wrote: >> Recent feature to supply RNG seed to the guest kernel modifies the >> kernel command-line by adding extra data at its end; this breaks >> measured b

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Dov Murik
>>> On Tue, Feb 07, 2023 at 04:45:19PM -0500, Michael S. Tsirkin wrote: >>>>> On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: >>>>>> Recent feature to supply RNG seed to the guest kernel modifies the >>>>>> kernel comman

[PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Dov Murik
Signed-off-by: Dov Murik --- There might be a need for a wider change to the ways setup_data entries are handled in x86_load_linux(); here I just try to restore the situation for SEV guests prior to the addition of the SETUP_RNG_SEED entry. Recent discussions on other (safer?) ways to pass this setup_

Re: [PATCH] x86: fix q35 kernel measurements broken due to rng seeding

2023-02-01 Thread Dov Murik
Hi Jason, James, On 01/02/2023 17:24, James Bottomley wrote: > On Wed, 2023-02-01 at 10:10 -0500, Jason A. Donenfeld wrote: >> This is already fixed via the patch that MST just sent in his pull. >> So wait a few days for that to be merged and it'll be all set. >> >> No need for this patch here.

Re: [PULL 01/53] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-04-20 Thread Dov Murik
On 19/04/2022 10:16, Dov Murik wrote: > Thanks Paolo. > > On 19/04/2022 8:50, Paolo Bonzini wrote: >> From: Dov Murik >> >> Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP >> command. The value of the field is the base64-encoded uniqu

[PATCH] qapi: Fix version of cpu0-id field

2022-04-20 Thread Dov Murik
Commit 811b4ec7f8eb ("qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities") wrongly stated that the new field is available since version 7.0. Fix the QAPI documentation to state that the cpu0-id field is included since 7.1. Signed-off-by: Dov Murik --- qapi/misc-target.json

Re: [PULL 01/53] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-04-19 Thread Dov Murik
Thanks Paolo. On 19/04/2022 8:50, Paolo Bonzini wrote: > From: Dov Murik > > Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP > command. The value of the field is the base64-encoded unique ID of CPU0 > (socket 0), which can be used to retrieve the signed

Re: adding 'official' way to dump SEV VMSA

2022-04-14 Thread Dov Murik
Hi Cole, On 13/04/2022 16:36, Cole Robinson wrote: > Hi all, > > SEV-ES and SEV-SNP attestation require a copy of the initial VMSA to > validate the launch measurement. For developers dipping their toe into > SEV-* work, the easiest way to get sample VMSA data for their machine is > to grab it

Re: [PATCH v3] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-04-10 Thread Dov Murik
On 07/04/2022 8:55, Markus Armbruster wrote: > Cole Robinson writes: > >> On 2/28/22 4:39 AM, Dov Murik wrote: >>> >>> >>> On 28/02/2022 11:31, Daniel P. Berrangé wrote: >>>> On Mon, Feb 28, 2022 at 09:30:14AM +, Dov Murik wrote: >&

[RFC PATCH] i386/sev: Support measured direct -kernel boot on SNP

2022-03-29 Thread Dov Murik
/devel/message/88137 Signed-off-by: Dov Murik --- target/i386/sev.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 3c296a59ae..dbc9d570a9 100644 --- a/target/i386/sev.c +++ b/target/i386

Re: [PATCH v3] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-28 Thread Dov Murik
On 28/02/2022 11:31, Daniel P. Berrangé wrote: > On Mon, Feb 28, 2022 at 09:30:14AM +0000, Dov Murik wrote: >> Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP >> command. The value of the field is the base64-encoded unique ID of CPU0 >> (socket

[PATCH v3] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-28 Thread Dov Murik
Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP command. The value of the field is the base64-encoded unique ID of CPU0 (socket 0), which can be used to retrieve the signed CEK of the CPU from AMD's Key Distribution Service (KDS). Signed-off-by: Dov Murik --- v3

Re: [PATCH v2] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-24 Thread Dov Murik
On 24/02/2022 10:59, Daniel P. Berrangé wrote: > On Thu, Feb 24, 2022 at 06:14:05AM +0000, Dov Murik wrote: >> Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP >> command. The value of the field is the base64-encoded 64-byte unique ID >> of the CPU0

[PATCH v2] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-23 Thread Dov Murik
Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP command. The value of the field is the base64-encoded 64-byte unique ID of the CPU0 (socket 0), which can be used to retrieve the signed CEK of the CPU from AMD's Key Distribution Service (KDS). Signed-off-by: Dov Murik

[PATCH v3 0/2] hw/i386: OVMF table parsing fixes

2022-02-21 Thread Dov Murik
: - simplify bounds check and remove max_tot_len (thanks Dave) - split one patch to two v2: - add error message example to commit description - replace magic numbers 48 and 50 with size calculations (thanks Phil MD) Dov Murik (2): hw/i386: Improve bounds checking in OVMF table parsing hw/i386: Replace

[PATCH v3 1/2] hw/i386: Improve bounds checking in OVMF table parsing

2022-02-21 Thread Dov Murik
table, and add an error report in case the size is invalid. In such a case, an error like this will be displayed during launch: qemu-system-x86_64: OVMF table has invalid size 4047 and the table parsing is skipped. Signed-off-by: Dov Murik --- hw/i386/pc_sysfw_ovmf.c | 9 - 1 file

[PATCH v3 2/2] hw/i386: Replace magic number with field length calculation

2022-02-21 Thread Dov Murik
Replce the literal magic number 48 with length calculation (32 bytes at the end of the firmware after the table footer + 16 bytes of the OVMF table footer GUID). No functional change intended. Signed-off-by: Dov Murik --- hw/i386/pc_sysfw_ovmf.c | 9 ++--- 1 file changed, 6 insertions

Re: [PATCH v2] hw/i386: Improve bounds checking in OVMF table parsing

2022-02-21 Thread Dov Murik
Thanks Dave for reviewing. On 21/02/2022 21:44, Dr. David Alan Gilbert wrote: > * Dov Murik (dovmu...@linux.ibm.com) wrote: >> When pc_system_parse_ovmf_flash() parses the optional GUIDed table in >> the end of the OVMF flash memory area, the table length field is check

Re: [PATCH] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-21 Thread Dov Murik
Thanks Daniel for reviewing. On 21/02/2022 18:24, Daniel P. Berrangé wrote: > On Mon, Feb 21, 2022 at 04:08:50PM +0000, Dov Murik wrote: >> Add a new field 'cpu0-id' to the response of query-sev-capabilities >> QMP command. The value of the field is the hex-encoded 64-by

[PATCH] qapi, target/i386/sev: Add cpu0-id to query-sev-capabilities

2022-02-21 Thread Dov Murik
Add a new field 'cpu0-id' to the response of query-sev-capabilities QMP command. The value of the field is the hex-encoded 64-byte unique ID of the CPU0 (socket 0), which can be used to retrieve the signed CEK of the CPU from AMD's Key Distribution Service (KDS). Signed-off-by: Dov Murik

[PATCH v3] docs/system/i386: Add measurement calculation details to amd-memory-encryption

2022-02-17 Thread Dov Murik
Add a section explaining how the Guest Owner should calculate the expected guest launch measurement for SEV and SEV-ES. Also update the name and links to the SEV API Spec document. Signed-off-by: Dov Murik Suggested-by: Daniel P. Berrangé --- v2: - Explain that firmware must be built without

[PATCH v2] hw/i386: Improve bounds checking in OVMF table parsing

2022-02-15 Thread Dov Murik
table, and add an error report in case the size is invalid. In such a case, an error like this will be displayed during launch: qemu-system-x86_64: OVMF table has invalid size 4047 and the table parsing is skipped. Signed-off-by: Dov Murik --- v2: - add error message example to commit

Re: [PATCH v2] docs: Add measurement calculation details to amd-memory-encryption.txt

2022-02-14 Thread Dov Murik
On 04/01/2022 20:00, Daniel P. Berrangé wrote: > On Mon, Dec 20, 2021 at 10:42:24AM +0000, Dov Murik wrote: >> Add a section explaining how the Guest Owner should calculate the >> expected guest launch measurement for SEV and SEV-ES. >> >> Also update the name a

Re: [PATCH] [RESEND] docs: Add spec of OVMF GUIDed table for SEV guests

2022-02-14 Thread Dov Murik
On 04/01/2022 20:07, Daniel P. Berrangé wrote: > On Mon, Jan 03, 2022 at 11:14:13AM +0200, Dov Murik wrote: >> Add docs/specs/sev-guest-firmware.rst which describes the GUIDed table >> in the end of OVMF's image which is parsed by QEMU, and currently used >> to describ

[PATCH] hw/i386: Improve bounds checking in OVMF table parsing

2022-02-14 Thread Dov Murik
table, and add an error report in case the size is invalid. Signed-off-by: Dov Murik --- hw/i386/pc_sysfw_ovmf.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_sysfw_ovmf.c b/hw/i386/pc_sysfw_ovmf.c index f4dd92c588..0663f3f54a 100644 --- a/hw/i386

Re: [PATCH] qapi, i386/sev: Add debug-launch-digest to launch-measure response

2022-02-14 Thread Dov Murik
On 31/01/2022 16:26, Daniel P. Berrangé wrote: [...] > > IOW, I think there's only two scenarios that make sense > > 1. The combined launch digest over firmware, kernel hashes >and VMSA state. > > 2. Individual hashes for each of firmware, kernel hashes table and >VMSA state >

Re: [PATCH] qapi, i386/sev: Add debug-launch-digest to launch-measure response

2022-01-31 Thread Dov Murik
On 31/01/2022 13:44, Daniel P. Berrangé wrote: > On Mon, Jan 31, 2022 at 11:15:39AM +0000, Dov Murik wrote: >> Currently the responses of QMP commands query-sev-launch-measure and >> query-sev-attestation-report return just the signed measurement. In >> order to validat

[PATCH] qapi, i386/sev: Add debug-launch-digest to launch-measure response

2022-01-31 Thread Dov Murik
that the value of debug-launch-digest should not be used for verifying the measurement, because it is not signed. Hence the choice of the 'debug-' prefix for the field's name. Suggested-by: Tobin Feldman-Fitzthum Signed-off-by: Dov Murik --- Implementation note: I keep a buffer (sev->launch_mem

Re: [PATCH 0/2] Improved support for AMD SEV firmware loading

2022-01-16 Thread Dov Murik
[+cc Tom, Brijesh, Ashish - see SEV-related changes in this series] On 13/01/2022 18:55, Daniel P. Berrangé wrote: > The AMD SEV build of EDK2 only emits a single file, intended to be > > mapped readonly. There is explicitly no separate writable VARS > > store for persisting non-volatile

Re: [PATCH] docs: Add measurement calculation details to amd-memory-encryption.txt

2022-01-10 Thread Dov Murik
On 07/01/2022 22:18, Daniel P. Berrangé wrote: > On Thu, Dec 16, 2021 at 11:41:27PM +0200, Dov Murik wrote: >> >> >> On 16/12/2021 18:09, Daniel P. Berrangé wrote: >>> On Thu, Dec 16, 2021 at 12:38:34PM +0200, Dov Murik wrote: >>>> >>>&

[PATCH] [RESEND] docs: Add spec of OVMF GUIDed table for SEV guests

2022-01-03 Thread Dov Murik
Add docs/specs/sev-guest-firmware.rst which describes the GUIDed table in the end of OVMF's image which is parsed by QEMU, and currently used to describe some values for SEV and SEV-ES guests. Signed-off-by: Dov Murik --- docs/specs/index.rst | 1 + docs/specs/sev-guest

[PATCH v2] docs: Add measurement calculation details to amd-memory-encryption.txt

2021-12-20 Thread Dov Murik
Add a section explaining how the Guest Owner should calculate the expected guest launch measurement for SEV and SEV-ES. Also update the name and link to the SEV API Spec document. Signed-off-by: Dov Murik Suggested-by: Daniel P. Berrangé --- v2: - Explain that firmware must be built without

[PATCH] [RESEND] docs: Add spec of OVMF GUIDed table for SEV guests

2021-12-20 Thread Dov Murik
Add docs/specs/sev-guest-firmware.rst which describes the GUIDed table in the end of OVMF's image which is parsed by QEMU, and currently used to describe some values for SEV and SEV-ES guests. Signed-off-by: Dov Murik --- docs/specs/index.rst | 1 + docs/specs/sev-guest

Re: [PATCH] docs: Add measurement calculation details to amd-memory-encryption.txt

2021-12-16 Thread Dov Murik
On 16/12/2021 18:09, Daniel P. Berrangé wrote: > On Thu, Dec 16, 2021 at 12:38:34PM +0200, Dov Murik wrote: >> >> >> On 14/12/2021 20:39, Daniel P. Berrangé wrote: >>> On Tue, Dec 14, 2021 at 01:59:10PM +, Dov Murik wrote: >>>> Add a section expla

Re: [PATCH] docs: Add measurement calculation details to amd-memory-encryption.txt

2021-12-16 Thread Dov Murik
On 14/12/2021 20:39, Daniel P. Berrangé wrote: > On Tue, Dec 14, 2021 at 01:59:10PM +0000, Dov Murik wrote: >> Add a section explaining how the Guest Owner should calculate the >> expected guest launch measurement for SEV and SEV-ES. >> >> Also update the name a

[PATCH] docs: Add measurement calculation details to amd-memory-encryption.txt

2021-12-14 Thread Dov Murik
Add a section explaining how the Guest Owner should calculate the expected guest launch measurement for SEV and SEV-ES. Also update the name and link to the SEV API Spec document. Signed-off-by: Dov Murik Suggested-by: Daniel P. Berrangé --- docs/amd-memory-encryption.txt | 50

Re: SEV guest attestation

2021-11-29 Thread Dov Murik
On 25/11/2021 18:08, Dr. David Alan Gilbert wrote: > * Daniel P. Berrangé (berra...@redhat.com) wrote: >> On Thu, Nov 25, 2021 at 03:40:36PM +, Dr. David Alan Gilbert wrote: >>> * Sergio Lopez (s...@redhat.com) wrote: >>>> On Thu, Nov 25, 2021 at 02:

Re: SEV guest attestation

2021-11-25 Thread Dov Murik
[+cc Tom, Brijesh] On 25/11/2021 15:42, Daniel P. Berrangé wrote: > On Thu, Nov 25, 2021 at 02:44:51PM +0200, Dov Murik wrote: >> [+cc jejb, tobin, jim, hubertus] >> >> >> On 25/11/2021 9:14, Sergio Lopez wrote: >>> On Wed, Nov 24, 2021 at 06:29:07PM

Re: SEV guest attestation

2021-11-25 Thread Dov Murik
On 25/11/2021 15:52, Daniel P. Berrangé wrote: > On Thu, Nov 25, 2021 at 08:14:28AM +0100, Sergio Lopez wrote: >> For SEV-SNP, this is pretty much the end of the story, because the >> attestation exchange is driven by an agent inside the guest. Well, >> there's also the need to have in the VM a

Re: SEV guest attestation

2021-11-25 Thread Dov Murik
On 25/11/2021 15:27, Daniel P. Berrangé wrote: > On Wed, Nov 24, 2021 at 06:29:07PM +, Dr. David Alan Gilbert wrote: >> * Daniel P. Berrangé (berra...@redhat.com) wrote: >>> On Wed, Nov 24, 2021 at 11:34:16AM -0500, Tyler Fanelli wrote: Hi, We recently discussed a way for

Re: SEV guest attestation

2021-11-25 Thread Dov Murik
[+cc jejb, tobin, jim, hubertus] On 25/11/2021 9:14, Sergio Lopez wrote: > On Wed, Nov 24, 2021 at 06:29:07PM +, Dr. David Alan Gilbert wrote: >> * Daniel P. Berrangé (berra...@redhat.com) wrote: >>> On Wed, Nov 24, 2021 at 11:34:16AM -0500, Tyler Fanelli wrote: Hi, We

Re: [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-18 Thread Dov Murik
On 18/11/2021 15:02, Daniel P. Berrangé wrote: > On Thu, Nov 18, 2021 at 02:21:09PM +0200, Dov Murik wrote: >> Pinging again -- Daniel said this should be added to 6.2. >> >> Is there anything I should do? > > I'm going to take care of sending a PULL to relieve Pao

Re: [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-18 Thread Dov Murik
Pinging again -- Daniel said this should be added to 6.2. Is there anything I should do? Thanks, -Dov On 14/11/2021 20:02, Dov Murik wrote: > Paolo, > > Can you please add this series (already reviewed) to the fixes in 6.2? > > Thanks, > -Dov > > > On 11/11/

Re: [PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-14 Thread Dov Murik
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] > OV

Re: [PATCH v2 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-11 Thread Dov Murik
On 11/11/2021 11:39, Daniel P. Berrangé wrote: > On Mon, Nov 08, 2021 at 01:48:34PM +0000, 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] >>

[PATCH v3 1/6] qapi/qom, target/i386: sev-guest: Introduce kernel-hashes=on|off option

2021-11-11 Thread Dov Murik
Introduce new boolean 'kernel-hashes' option on the sev-guest object. It will be used to to decide whether to add the hashes of kernel/initrd/cmdline to SEV guest memory when booting with -kernel. The default value is 'off'. Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrangé Acked

[PATCH v3 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-11 Thread Dov Murik
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-dovmu...@linux.ibm.com/ Dov Murik (6): qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option target/i

[PATCH v3 6/6] target/i386/sev: Replace qemu_map_ram_ptr with address_space_map

2021-11-11 Thread Dov Murik
Use address_space_map/unmap and check for errors. Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrangé Acked-by: Brijesh Singh --- target/i386/sev.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 4fd258a570

[PATCH v3 4/6] target/i386/sev: Fail when invalid hashes table area detected

2021-11-11 Thread Dov Murik
ro, or its size is too small to fit the aligned hashes table, display an error and stop the guest launch. In such case, the following error will be displayed: qemu-system-x86_64: SEV: guest firmware hashes table area is invalid (base=0x0 size=0x0) Signed-off-by: Dov Murik Reported-by: Bri

[PATCH v3 2/6] target/i386/sev: Add kernel hashes only if sev-guest.kernel-hashes=on

2021-11-11 Thread Dov Murik
won't fill that area. To enable addition of kernel hashes, launch the guest with: -object sev-guest,...,kernel-hashes=on Signed-off-by: Dov Murik Reported-by: Tom Lendacky Reviewed-by: Daniel P. Berrangé Acked-by: Brijesh Singh --- target/i386/sev.c | 8 1 file changed, 8 insertion

[PATCH v3 3/6] target/i386/sev: Rephrase error message when no hashes table in guest firmware

2021-11-11 Thread Dov Murik
Signed-off-by: Dov Murik Acked-by: Brijesh Singh --- target/i386/sev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index e3abbeef68..6ff196f7ad 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1232,7 +1232,8 @@ bool

[PATCH v3 5/6] target/i386/sev: Perform padding calculations at compile-time

2021-11-11 Thread Dov Murik
In sev_add_kernel_loader_hashes, the sizes of structs are known at compile-time, so calculate needed padding at compile-time. No functional change intended. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Acked

Re: [PATCH v2 1/6] qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option

2021-11-11 Thread Dov Murik
On 11/11/2021 11:26, Daniel P. Berrangé wrote: > On Mon, Nov 08, 2021 at 08:20:48PM +0200, Dov Murik wrote: >> >> >> On 08/11/2021 17:51, Markus Armbruster wrote: >>> Dov Murik writes: >>> >>>> Introduce new boolean 'kernel-hashes' o

Re: [PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-08 Thread Dov Murik
On 08/11/2021 23:22, Brijesh Singh wrote: > > > On 11/5/21 1:32 PM, Dov Murik wrote: >> >> >> On 02/11/2021 16:48, Brijesh Singh wrote: >>> >>> >>> On 11/2/21 8:22 AM, Dov Murik wrote: >>>> >>>> >>>> O

Re: [PATCH v2 1/6] qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option

2021-11-08 Thread Dov Murik
On 08/11/2021 17:51, Markus Armbruster wrote: > Dov Murik writes: > >> Introduce new boolean 'kernel-hashes' option on the sev-guest object. >> It will be used to to decide whether to add the hashes of >> kernel/initrd/cmdline to SEV guest memory when booting with

Re: [PATCH v2 3/6] target/i386/sev: Rephrase error message when no hashes table in guest firmware

2021-11-08 Thread Dov Murik
On 08/11/2021 15:53, Daniel P. Berrangé wrote: > On Mon, Nov 08, 2021 at 01:48:37PM +0000, Dov Murik wrote: >> Signed-off-by: Dov Murik >> --- >> target/i386/sev.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/target/

[PATCH v2 0/6] SEV: add kernel-hashes=on for measured -kernel launch

2021-11-08 Thread Dov Murik
ssage 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-dovmu...@linux.ibm.com/ Dov Murik (6): qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option target/i386/sev: Add kerne

[PATCH v2 2/6] target/i386/sev: Add kernel hashes only if sev-guest.kernel-hashes=on

2021-11-08 Thread Dov Murik
won't fill that area. To enable addition of kernel hashes, launch the guest with: -object sev-guest,...,kernel-hashes=on Signed-off-by: Dov Murik Reported-by: Tom Lendacky --- target/i386/sev.c | 8 1 file changed, 8 insertions(+) diff --git a/target/i386/sev.c b/target/i386/s

[PATCH v2 6/6] target/i386/sev: Replace qemu_map_ram_ptr with address_space_map

2021-11-08 Thread Dov Murik
Use address_space_map/unmap and check for errors. Signed-off-by: Dov Murik --- target/i386/sev.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 2e3a6e8ff8..12f28e878c 100644 --- a/target/i386/sev.c +++ b/target

[PATCH v2 3/6] target/i386/sev: Rephrase error message when no hashes table in guest firmware

2021-11-08 Thread Dov Murik
Signed-off-by: Dov Murik --- target/i386/sev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index e3abbeef68..c71d23654f 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1232,7 +1232,8 @@ bool sev_add_kernel_loader_hashes

[PATCH v2 1/6] qapi/qom, target/i386: sev-guest: Introduce kernel-hashes=on|off option

2021-11-08 Thread Dov Murik
Introduce new boolean 'kernel-hashes' option on the sev-guest object. It will be used to to decide whether to add the hashes of kernel/initrd/cmdline to SEV guest memory when booting with -kernel. The default value is 'off'. Signed-off-by: Dov Murik --- qapi/qom.json | 7 ++- target

[PATCH v2 4/6] target/i386/sev: Fail when invalid hashes table area detected

2021-11-08 Thread Dov Murik
ro, or its size is too small to fit the aligned hashes table, display an error and stop the guest launch. In such case, the following error will be displayed: qemu-system-x86_64: SEV: guest firmware hashes table area is invalid (base=0x0 size=0x0) Signed-off-by: Dov Murik Reported-by: Bri

[PATCH v2 5/6] target/i386/sev: Perform padding calculations at compile-time

2021-11-08 Thread Dov Murik
In sev_add_kernel_loader_hashes, the sizes of structs are known at compile-time, so calculate needed padding at compile-time. No functional change intended. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 28

Re: [PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-05 Thread Dov Murik
On 02/11/2021 16:48, Brijesh Singh wrote: > > > On 11/2/21 8:22 AM, Dov Murik wrote: >> >> >> On 02/11/2021 12:52, Brijesh Singh wrote: >>> Hi Dov, >>> >>> Overall the patch looks good, only question I have is that now we are &

Re: [PATCH 2/3] sev/i386: Warn if using -kernel with invalid OVMF hashes table area

2021-11-05 Thread Dov Murik
On 03/11/2021 18:07, Daniel P. Berrangé wrote: > On Mon, Nov 01, 2021 at 10:21:35AM +0000, Dov Murik wrote: >> Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes >> for measured linux boot", 2021-09-30) introduced measured direct boot >&

Re: [PATCH 1/3] sev/i386: Allow launching with -kernel if no OVMF hashes table found

2021-11-05 Thread Dov Murik
On 04/11/2021 20:22, Daniel P. Berrangé wrote: > On Thu, Nov 04, 2021 at 06:18:10PM +, Dr. David Alan Gilbert wrote: >> * Daniel P. Berrangé (berra...@redhat.com) wrote: >>> On Mon, Nov 01, 2021 at 10:21:34AM +, Dov Murik wrote: >>>> Commit cff0

Re: [PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-05 Thread Dov Murik
On 03/11/2021 17:44, Brijesh Singh wrote: > > > On 11/3/21 9:08 AM, Dr. David Alan Gilbert wrote: >> * Brijesh Singh (brijesh.si...@amd.com) wrote: >>> >>> >>> On 11/2/21 8:22 AM, Dov Murik wrote: >>>> >>>> >>>&g

Re: [PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-02 Thread Dov Murik
and how can OVMF tell. How about: QEMU always prevalidates this page (either fills it with zeros or with the hashes table), and the BIOS always excludes it? -Dov > > Thoughts ? > > thanks > > On 11/1/21 5:21 AM, Dov Murik wrote: >> Tom Lendacky and Brijesh Singh reported tw

Re: [PATCH 2/3] sev/i386: Warn if using -kernel with invalid OVMF hashes table area

2021-11-02 Thread Dov Murik
On 02/11/2021 14:36, Dr. David Alan Gilbert wrote: > * Dov Murik (dovmu...@linux.ibm.com) wrote: >> Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes >> for measured linux boot", 2021-09-30) introduced measured direct boot >> with -kernel,

Re: [PATCH 3/3] sev/i386: Perform padding calculations at compile-time

2021-11-02 Thread Dov Murik
On 02/11/2021 13:36, Dr. David Alan Gilbert wrote: > * Dov Murik (dovmu...@linux.ibm.com) wrote: >> In sev_add_kernel_loader_hashes, the sizes of structs are known at >> compile-time, so calculate needed padding at compile-time. >> >> No functional change intende

Re: [PATCH 1/3] sev/i386: Allow launching with -kernel if no OVMF hashes table found

2021-11-01 Thread Dov Murik
On 01/11/2021 16:25, Tom Lendacky wrote: > On 11/1/21 5:21 AM, Dov Murik wrote: >> Commit cff03145ed3c ("sev/i386: Introduce sev_add_kernel_loader_hashes >> for measured linux boot", 2021-09-30) introduced measured direct boot >> with -kernel, using an OVMF-des

[PATCH 2/3] sev/i386: Warn if using -kernel with invalid OVMF hashes table area

2021-11-01 Thread Dov Murik
ro, or its size is too small to fit the aligned hashes table, warn and skip the hashes entries addition. In such case, the following warning will be displayed: qemu-system-x86_64: warning: SEV: OVMF's hashes table area is invalid (base=0x0 size=0x0) Signed-off-by: Dov Murik Reported-by: Bri

Re: [PATCH v4 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-11-01 Thread Dov Murik
On 28/10/2021 11:41, Dov Murik wrote: > > > On 27/10/2021 22:43, Brijesh Singh wrote: >> Hi Dov, >> >> Sorry for coming a bit late on it but I am seeing another issue with >> this patch. The hash build logic looks for a SEV_HASH_TABLE_RV_GUID in >> th

[PATCH 1/3] sev/i386: Allow launching with -kernel if no OVMF hashes table found

2021-11-01 Thread Dov Murik
emu-system-x86_64: warning: SEV: kernel specified but OVMF has no hash table guid Signed-off-by: Dov Murik Reported-by: Tom Lendacky --- target/i386/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index eede07f11d..682b8cc

[PATCH 0/3] SEV: fixes for -kernel launch with incompatible OVMF

2021-11-01 Thread Dov Murik
-devel/001dd81a-282d-c307-a657-e228480d4...@amd.com/ Dov Murik (3): sev/i386: Allow launching with -kernel if no OVMF hashes table found sev/i386: Warn if using -kernel with invalid OVMF hashes table area sev/i386: Perform padding calculations at compile-time target/i386/sev.c | 34

[PATCH 3/3] sev/i386: Perform padding calculations at compile-time

2021-11-01 Thread Dov Murik
In sev_add_kernel_loader_hashes, the sizes of structs are known at compile-time, so calculate needed padding at compile-time. No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff

Re: [PATCH v4 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-10-28 Thread Dov Murik
boot. Separately I'll try to solve the issue in the other OVMF *.fdf's. Thanks for reporting this. -Dov > > Thanks > Brijesh > > On 10/20/21 10:26 AM, Tom Lendacky wrote: >> On 10/19/21 1:18 AM, Dov Murik wrote: >>> On 18/10/2021 21

Re: [PATCH v4 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-10-19 Thread Dov Murik
On 18/10/2021 21:02, Tom Lendacky wrote: > On 9/30/21 12:49 AM, Dov Murik wrote: > > ... > >> +/* >> + * Add the hashes of the linux kernel/initrd/cmdline to an encrypted >> guest page >> + * which is included in SEV's initial memory measurement. >>

Re: [PATCH v4 12/23] target/i386/sev: Use g_autofree in sev_launch_get_measure()

2021-10-12 Thread Dov Murik
On 07/10/2021 19:28, Dov Murik wrote: > > > On 07/10/2021 19:17, Philippe Mathieu-Daudé wrote: >> Use g_autofree to remove a pair of g_free/goto. >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> target/i386/sev.c | 13 - >>

[PATCH 1/2] target/i386/sev: Use local variable for kvm_sev_launch_start

2021-10-11 Thread Dov Murik
The struct kvm_sev_launch_start has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik --- target/i386/sev.c | 23 ++- 1 file changed, 10 insertions(+), 13

[PATCH 0/2] target/i386/sev: Replace malloc with local variables

2021-10-11 Thread Dov Murik
-phi...@redhat.com/ Dov Murik (2): target/i386/sev: Use local variable for kvm_sev_launch_start target/i386/sev: Use local variable for kvm_sev_launch_measure target/i386/sev.c | 39 +-- 1 file changed, 17 insertions(+), 22 deletions(-) -- 2.25.1

[PATCH 2/2] target/i386/sev: Use local variable for kvm_sev_launch_measure

2021-10-11 Thread Dov Murik
The struct kvm_sev_launch_measure has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik --- target/i386/sev.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions

Re: [PATCH v4 12/23] target/i386/sev: Use g_autofree in sev_launch_get_measure()

2021-10-07 Thread Dov Murik
On 07/10/2021 19:17, Philippe Mathieu-Daudé wrote: > Use g_autofree to remove a pair of g_free/goto. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/i386/sev.c | 13 - > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/target/i386/sev.c

  1   2   3   >