public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Vasant Karasulli <vkarasulli@suse.de>
To: Sean Christopherson <seanjc@google.com>
Cc: vsntk18@gmail.com, kvm@vger.kernel.org, pbonzini@redhat.com,
	jroedel@suse.de, papaluri@amd.com, andrew.jones@linux.dev,
	Varad Gautam <varad.gautam@suse.com>
Subject: Re: [kvm-unit-tests PATCH v7 08/11] x86: AMD SEV-ES: Handle CPUID #VC
Date: Thu, 6 Jun 2024 20:59:48 +0200	[thread overview]
Message-ID: <ZmIHJHHeN5CCIizZ@vasant-suse> (raw)
In-Reply-To: <ZmCNT4vkG9_SGY0S@google.com>

On Mi 05-06-24 09:07:43, Sean Christopherson wrote:
> On Fri, Apr 19, 2024, vsntk18@gmail.com wrote:
> > +static inline void sev_es_wr_ghcb_msr(u64 val)
> > +{
> > +	wrmsr(MSR_AMD64_SEV_ES_GHCB, val);
> > +}
> > +
> > +static inline u64 sev_es_rd_ghcb_msr(void)
> > +{
> > +	return rdmsr(MSR_AMD64_SEV_ES_GHCB);
> > +}
>
> These are silly, they just add a layer of obfuscation.  It's just as easy to do:
>
> 	wrmsr(MSR_AMD64_SEV_ES_GHCB, __pa(ghcb));
>
> > +
> > +
>
> Extra newline.
>

Ok, I will address these two things in the next version.

> > +static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
> > +					  struct es_em_ctxt *ctxt,
> > +					  u64 exit_code, u64 exit_info_1,
> > +					  u64 exit_info_2)
> > +{
> > +	enum es_result ret;
> > +
> > +	/* Fill in protocol and format specifiers */
> > +	ghcb->version = GHCB_VERSION;
> > +	ghcb->ghcb_usage       = GHCB_DEFAULT_USAGE;
> > +
> > +	ghcb_set_sw_exit_code(ghcb, exit_code);
> > +	ghcb_set_sw_exit_info_1(ghcb, exit_info_1);
> > +	ghcb_set_sw_exit_info_2(ghcb, exit_info_2);
> > +
> > +	sev_es_wr_ghcb_msr(__pa(ghcb));

--
Vasant Karasulli
Kernel generalist
www.suse.com<http://www.suse.com>
[https://www.suse.com/assets/img/social-platforms-suse-logo.png]<http://www.suse.com/>
SUSE - Open Source Solutions for Enterprise Servers & Cloud<http://www.suse.com/>
Modernize your infrastructure with SUSE Linux Enterprise servers, cloud technology for IaaS, and SUSE's software-defined storage.
www.suse.com


  reply	other threads:[~2024-06-06 18:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 16:16 [kvm-unit-tests PATCH v7 00/11] Add #VC exception handling for AMD SEV-ES vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 01/11] x86: AMD SEV-ES: Setup #VC exception handler " vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 02/11] x86: Move svm.h to lib/x86/ vsntk18
2024-06-05 16:05   ` Sean Christopherson
2024-06-06 18:57     ` Vasant Karasulli
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 03/11] lib: Define unlikely()/likely() macros in compiler.h vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 04/11] lib: x86: Import insn decoder from Linux vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 05/11] x86: AMD SEV-ES: Pull related GHCB definitions and helpers " vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 06/11] x86: AMD SEV-ES: Prepare for #VC processing vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 07/11] lib/x86: Move xsave helpers to lib/ vsntk18
2024-06-05 16:04   ` Sean Christopherson
2024-06-06 18:58     ` Vasant Karasulli
2024-06-06 23:49       ` Sean Christopherson
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 08/11] x86: AMD SEV-ES: Handle CPUID #VC vsntk18
2024-06-05 16:07   ` Sean Christopherson
2024-06-06 18:59     ` Vasant Karasulli [this message]
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 09/11] x86: AMD SEV-ES: Handle MSR #VC vsntk18
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 10/11] x86: AMD SEV-ES: Handle IOIO #VC vsntk18
2024-06-05 16:08   ` Sean Christopherson
2024-06-06 19:01     ` Vasant Karasulli
2024-04-19 16:16 ` [kvm-unit-tests PATCH v7 11/11] x86: AMD SEV-ES: Handle string IO for " vsntk18

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=ZmIHJHHeN5CCIizZ@vasant-suse \
    --to=vkarasulli@suse.de \
    --cc=andrew.jones@linux.dev \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=papaluri@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=varad.gautam@suse.com \
    --cc=vsntk18@gmail.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