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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRdJQQ7_j6RcHwjJ@google.com>
Date: Fri, 14 Nov 2025 07:22:41 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Michael Kelley <mhklinux@...look.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Vitaly Kuznetsov <vkuznets@...hat.com>, 
	"K. Y. Srinivasan" <kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, 
	Dexuan Cui <decui@...rosoft.com>, Nuno Das Neves <nunodasneves@...ux.microsoft.com>, 
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>, 
	"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Jim Mattson <jmattson@...gle.com>, 
	Yosry Ahmed <yosry.ahmed@...ux.dev>
Subject: Re: [PATCH 7/9] KVM: SVM: Treat exit_code as an unsigned 64-bit value
 through all of KVM

On Fri, Nov 14, 2025, Michael Kelley wrote:
> From: Sean Christopherson <seanjc@...gle.com> Sent: Thursday, November 13, 2025 2:56 PM
> > 
> 
> Adding Microsoft's Nuno Das Neves to the "To:" line since he
> originated the work to keep the Linux headers such as hvgdk.h in
> sync with the Windows counterparts from which they originate.

...

> >  /* Exit code reserved for hypervisor/software use */
> > -#define SVM_EXIT_SW				0xf0000000
> > +#define SVM_EXIT_SW				0xf0000000ull
> > 
> > -#define SVM_EXIT_ERR           -1
> > +#define SVM_EXIT_ERR           -1ull
> > 
> 
> [snip]
> 
> > diff --git a/include/hyperv/hvgdk.h b/include/hyperv/hvgdk.h
> > index dd6d4939ea29..56b695873a72 100644
> > --- a/include/hyperv/hvgdk.h
> > +++ b/include/hyperv/hvgdk.h
> > @@ -281,7 +281,7 @@ struct hv_vmcb_enlightenments {
> >  #define HV_VMCB_NESTED_ENLIGHTENMENTS		31
> > 
> >  /* Synthetic VM-Exit */
> > -#define HV_SVM_EXITCODE_ENL			0xf0000000
> > +#define HV_SVM_EXITCODE_ENL			0xf0000000u
> 
> Is there a reason for making this Hyper-V code just "u", while
> making the SVM_VMGEXIT_* values "ull"? I don't think
> "u" vs. "ull" shouldn't make any difference when assigning to a
> u64, but the inconsistency piqued my interest ....

I hedged and went for a more "minimal" change because it isn't KVM code, and at
the time because I thought the value isn't defined by the APM.  Though looking
again at the APM, it does reserve that value for software

  F000_000h    Unused    Reserved for Host.

and I can't find anything in the TLFS.  Ah, my PDF copy is just stale, it's indeed
defined as a synthetic exit.

  https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/nested-virtualization#synthetic-vm-exit

Anyways, I'm in favor of making HV_SVM_EXITCODE_ENL an ull, though part of me
wonders if we should do:

  #define HV_SVM_EXITCODE_ENL	SVM_EXIT_SW

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ