All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Venu Busireddy <venu.busireddy@oracle.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Connor Kuehl <ckuehl@redhat.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Jiri Slaby <jslaby@suse.cz>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH v6 3/6] sev/i386: Allow AP booting under SEV-ES
Date: Mon, 1 Feb 2021 12:48:28 -0600	[thread overview]
Message-ID: <08a46e00-940c-eec3-bc7e-a5d21d8f0609@amd.com> (raw)
In-Reply-To: <20210129174416.GC231819@dt>

On 1/29/21 11:44 AM, Venu Busireddy wrote:
> On 2021-01-26 11:36:46 -0600, Tom Lendacky wrote:
>> From: Tom Lendacky <thomas.lendacky@amd.com>
>>
>> When SEV-ES is enabled, it is not possible modify the guests register
>> state after it has been initially created, encrypted and measured.
>>
>> Normally, an INIT-SIPI-SIPI request is used to boot the AP. However, the
>> hypervisor cannot emulate this because it cannot update the AP register
>> state. For the very first boot by an AP, the reset vector CS segment
>> value and the EIP value must be programmed before the register has been
>> encrypted and measured. Search the guest firmware for the guest for a
>> specific GUID that tells Qemu the value of the reset vector to use.
>>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> Cc: Richard Henderson <richard.henderson@linaro.org>
>> Cc: Eduardo Habkost <ehabkost@redhat.com>
>> Cc: Marcelo Tosatti <mtosatti@redhat.com>
>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>> ---
...
>> +
>> +    /*
>> +     * SEV info block not found in the Firmware GUID Table (or there isn't
>> +     * a Firmware GUID Table), fall back to the original implementation.
>> +     */
>> +    data = flash_ptr + flash_size - 0x20;
> 
> Even if the SEV_INFO_BLOCK_GUID is always located at 32 bytes from the end
> of the flash, isn't it better to define a constant with a value of 0x20?

A follow-on patch that updates both this and the table parser code from 
James would probably be best.

Thanks,
Tom

> 
>> +

WARNING: multiple messages have this Message-ID (diff)
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Venu Busireddy <venu.busireddy@oracle.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Connor Kuehl <ckuehl@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Jiri Slaby <jslaby@suse.cz>, Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v6 3/6] sev/i386: Allow AP booting under SEV-ES
Date: Mon, 1 Feb 2021 12:48:28 -0600	[thread overview]
Message-ID: <08a46e00-940c-eec3-bc7e-a5d21d8f0609@amd.com> (raw)
In-Reply-To: <20210129174416.GC231819@dt>

On 1/29/21 11:44 AM, Venu Busireddy wrote:
> On 2021-01-26 11:36:46 -0600, Tom Lendacky wrote:
>> From: Tom Lendacky <thomas.lendacky@amd.com>
>>
>> When SEV-ES is enabled, it is not possible modify the guests register
>> state after it has been initially created, encrypted and measured.
>>
>> Normally, an INIT-SIPI-SIPI request is used to boot the AP. However, the
>> hypervisor cannot emulate this because it cannot update the AP register
>> state. For the very first boot by an AP, the reset vector CS segment
>> value and the EIP value must be programmed before the register has been
>> encrypted and measured. Search the guest firmware for the guest for a
>> specific GUID that tells Qemu the value of the reset vector to use.
>>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> Cc: Richard Henderson <richard.henderson@linaro.org>
>> Cc: Eduardo Habkost <ehabkost@redhat.com>
>> Cc: Marcelo Tosatti <mtosatti@redhat.com>
>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>> ---
...
>> +
>> +    /*
>> +     * SEV info block not found in the Firmware GUID Table (or there isn't
>> +     * a Firmware GUID Table), fall back to the original implementation.
>> +     */
>> +    data = flash_ptr + flash_size - 0x20;
> 
> Even if the SEV_INFO_BLOCK_GUID is always located at 32 bytes from the end
> of the flash, isn't it better to define a constant with a value of 0x20?

A follow-on patch that updates both this and the table parser code from 
James would probably be best.

Thanks,
Tom

> 
>> +


  reply	other threads:[~2021-02-01 18:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 17:36 [PATCH v6 0/6] Qemu SEV-ES guest support Tom Lendacky
2021-01-26 17:36 ` Tom Lendacky
2021-01-26 17:36 ` [PATCH v6 1/6] sev/i386: Add initial support for SEV-ES Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:39   ` Venu Busireddy
2021-01-29 17:39     ` Venu Busireddy
2021-01-26 17:36 ` [PATCH v6 2/6] sev/i386: Require in-kernel irqchip support for SEV-ES guests Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:41   ` Venu Busireddy
2021-01-29 17:41     ` Venu Busireddy
2021-01-26 17:36 ` [PATCH v6 3/6] sev/i386: Allow AP booting under SEV-ES Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:44   ` Venu Busireddy
2021-01-29 17:44     ` Venu Busireddy
2021-02-01 18:48     ` Tom Lendacky [this message]
2021-02-01 18:48       ` Tom Lendacky
2021-01-26 17:36 ` [PATCH v6 4/6] sev/i386: Don't allow a system reset under an SEV-ES guest Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:44   ` Venu Busireddy
2021-01-29 17:44     ` Venu Busireddy
2021-01-26 17:36 ` [PATCH v6 5/6] kvm/i386: Use a per-VM check for SMM capability Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:46   ` Venu Busireddy
2021-01-29 17:46     ` Venu Busireddy
2021-01-26 17:36 ` [PATCH v6 6/6] sev/i386: Enable an SEV-ES guest based on SEV policy Tom Lendacky
2021-01-26 17:36   ` Tom Lendacky
2021-01-29 17:46   ` Venu Busireddy
2021-01-29 17:46     ` Venu Busireddy
2021-02-05 10:59 ` [PATCH v6 0/6] Qemu SEV-ES guest support Paolo Bonzini
2021-02-05 10:59   ` Paolo Bonzini
2021-02-08 15:48   ` Tom Lendacky
2021-02-08 15:48     ` Tom Lendacky
2021-02-08 16:31     ` Paolo Bonzini
2021-02-08 16:31       ` Paolo Bonzini
2021-02-08 17:35       ` Tom Lendacky
2021-02-08 17:35         ` Tom Lendacky

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=08a46e00-940c-eec3-bc7e-a5d21d8f0609@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=brijesh.singh@amd.com \
    --cc=ckuehl@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jslaby@suse.cz \
    --cc=kvm@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    --cc=seanjc@google.com \
    --cc=venu.busireddy@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.