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: <e0fd378de64f44fd8becfe67b02cb635@intel.com>
Date:   Tue, 21 Dec 2021 02:45:45 +0000
From:   "Wang, Wei W" <wei.w.wang@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        "Liu, Jing2" <jing2.liu@...el.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC:     "seanjc@...gle.com" <seanjc@...gle.com>,
        "Nakajima, Jun" <jun.nakajima@...el.com>,
        "Tian, Kevin" <kevin.tian@...el.com>,
        "jing2.liu@...ux.intel.com" <jing2.liu@...ux.intel.com>,
        "Zeng, Guang" <guang.zeng@...el.com>,
        "Zhong, Yang" <yang.zhong@...el.com>
Subject: RE: [PATCH v2 18/23] kvm: x86: Get/set expanded xstate buffer

On Monday, December 20, 2021 5:04 PM, Paolo Bonzini wrote:
> On 12/17/21 16:29, Jing Liu wrote:
> > +/* for KVM_CAP_XSAVE and KVM_CAP_XSAVE2 */
> >   struct kvm_xsave {
> > +	/*
> > +	 * KVM_GET_XSAVE only uses the first 4096 bytes.
> > +	 *
> > +	 * KVM_GET_XSAVE2 must have the size match what is returned by
> > +	 * KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2).
> > +	 *
> > +	 * KVM_SET_XSAVE uses the extra field if guest_fpu::fpstate::size
> > +	 * exceeds 4096 bytes.
> 
> KVM_GET_XSAVE2 and KVM_SET_XSAVE respectively write and read as many
> bytes as are returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2), when
> invoked on the vm file descriptor.  Currently,
> KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2) will only return a value that is
> greater than 4096 bytes if any dynamic features have been enabled with
> ``arch_prctl()``; this however may change in the future.

Would this make people think that KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2) doesn’t
return the value (i.e. return 0) if it is smaller than 4096?
(i.e. KVM_GET_XSAVE2 doesn't work with size < 4096, which isn’t true)

I plan to just reword a bit:
Currently, KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2) will only return a size value,
and the value is greater than 4096 bytes if any dynamic features have been enabled with
``arch_prctl()``. More types of values could be returned in the future.

Thanks,
Wei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ