lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZskMeWQfjQ00BTVm@liuwe-devbox-debian-v2>
Date: Fri, 23 Aug 2024 22:26:01 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>, linux-hyperv@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86/hyperv: use helpers to read control registers in
 hv_snp_boot_ap()

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@...gle.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@...gle.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
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ