From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"Cédric Le Goater" <clg@kaod.org>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"David Hildenbrand" <david@redhat.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Thomas Huth" <thuth@redhat.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
qemu-s390x@nongnu.org
Subject: Re: [PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init()
Date: Tue, 19 Mar 2024 10:12:26 +0800 [thread overview]
Message-ID: <99697bba-e1a7-4091-9065-65f4726f2f13@intel.com> (raw)
In-Reply-To: <CABgObfbJn01k0WM0o6MfuvQctm0U2uX-D4DQKzStj4N9KwLZTw@mail.gmail.com>
On 3/19/2024 5:51 AM, Paolo Bonzini wrote:
> On Thu, Feb 29, 2024 at 7:01 AM Xiaoyao Li <xiaoyao.li@intel.com> wrote:
>>
>> Use confidential_guest_kvm_init() instead of calling SEV specific
>> sev_kvm_init(). As a bouns, it fits to future TDX when TDX implements
>> its own confidential_guest_support and .kvm_init().
>>
>> Move the "TypeInfo sev_guest_info" definition and related functions to
>> the end of the file, to avoid declaring the sev_kvm_init() ahead.
>>
>> Delete the sve-stub.c since it's not needed anymore.
>>
>> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
>> ---
>> Changes from rfc v1:
>> - check ms->cgs not NULL before calling confidential_guest_kvm_init();
>> - delete the sev-stub.c;
>
> Queued, with just one small simplification that can be done on top:
thank you, Paolo!
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index e89d64fa52..b8f79d34d1 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -851,18 +851,13 @@ sev_vm_state_change(void *opaque, bool running,
> RunState state)
>
> static int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
> {
> - SevGuestState *sev
> - = (SevGuestState *)object_dynamic_cast(OBJECT(cgs), TYPE_SEV_GUEST);
> + SevGuestState *sev = SEV_GUEST(cgs);
> char *devname;
> int ret, fw_error, cmd;
> uint32_t ebx;
> uint32_t host_cbitpos;
> struct sev_user_data_status status = {};
>
> - if (!sev) {
> - return 0;
> - }
> -
> ret = ram_block_discard_disable(true);
> if (ret) {
> error_report("%s: cannot disable RAM discard", __func__);
It looks good.
> Thanks!
>
> Paolo
next prev parent reply other threads:[~2024-03-19 2:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 6:00 [PATCH 0/4] Confidential Guest Support: Introduce kvm_init() and kvm_reset() virtual functions Xiaoyao Li
2024-02-29 6:00 ` [PATCH 1/4] confidential guest support: Add kvm_init() and kvm_reset() in class Xiaoyao Li
2024-02-29 6:00 ` [PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init() Xiaoyao Li
2024-03-18 21:51 ` Paolo Bonzini
2024-03-19 2:12 ` Xiaoyao Li [this message]
2024-02-29 6:00 ` [PATCH 3/4] ppc/pef: switch to use confidential_guest_kvm_init/reset() Xiaoyao Li
2024-02-29 6:00 ` [PATCH 4/4] s390: Switch to use confidential_guest_kvm_init() Xiaoyao Li
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=99697bba-e1a7-4091-9065-65f4726f2f13@intel.com \
--to=xiaoyao.li@intel.com \
--cc=berrange@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=mtosatti@redhat.com \
--cc=npiggin@gmail.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.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.