Linux-HyperV List
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/hyperv: use helpers to read control registers in hv_snp_boot_ap()
Date: Fri, 23 Aug 2024 22:26:01 +0000	[thread overview]
Message-ID: <ZskMeWQfjQ00BTVm@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <CAJD7tkZTFNm3k3OM9G1qtd8-FyjKDvj5C-CPKvuS3AipKb7x8Q@mail.gmail.com>

On Wed, Aug 14, 2024 at 04:54:32PM -0700, Yosry Ahmed wrote:
> On Mon, Aug 5, 2024 at 1:12 PM Yosry Ahmed <yosryahmed@google.com> wrote:
> >
> > Use native_read_cr*() helpers to read control registers into vmsa->cr*
> > instead of open-coded assembly.
> >
> > No functional change intended, unless there was a purpose to specifying
> > rax.
> >
> > Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
> > ---
> >
> > v1 -> v2:
> > - Fixed a silly bug that overwrote vmsa->cr3 instead of reading
> >   vmsa->cr0.
> >
> > ---
> 
> Friendly ping on this, any thoughts?

Applied to hyperv-next. Thanks.

> 
> >  arch/x86/hyperv/ivm.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c
> > index b4a851d27c7cb..60fc3ed728304 100644
> > --- a/arch/x86/hyperv/ivm.c
> > +++ b/arch/x86/hyperv/ivm.c
> > @@ -321,9 +321,9 @@ int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
> >
> >         vmsa->efer = native_read_msr(MSR_EFER);
> >
> > -       asm volatile("movq %%cr4, %%rax;" : "=a" (vmsa->cr4));
> > -       asm volatile("movq %%cr3, %%rax;" : "=a" (vmsa->cr3));
> > -       asm volatile("movq %%cr0, %%rax;" : "=a" (vmsa->cr0));
> > +       vmsa->cr4 = native_read_cr4();
> > +       vmsa->cr3 = __native_read_cr3();
> > +       vmsa->cr0 = native_read_cr0();
> >
> >         vmsa->xcr0 = 1;
> >         vmsa->g_pat = HV_AP_INIT_GPAT_DEFAULT;
> > --
> > 2.46.0.rc2.264.g509ed76dc8-goog
> >

      reply	other threads:[~2024-08-23 22:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 20:12 [PATCH v2] x86/hyperv: use helpers to read control registers in hv_snp_boot_ap() Yosry Ahmed
2024-08-14 23:54 ` Yosry Ahmed
2024-08-23 22:26   ` Wei Liu [this message]

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=ZskMeWQfjQ00BTVm@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yosryahmed@google.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