From: Yang Zhong <yang.zhong@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
seanjc@google.com, yang.zhong@intel.com
Subject: Re: [PATCH 0/3] KVM: x86: export supported_xcr0 via UAPI
Date: Thu, 27 Jan 2022 13:39:29 +0800 [thread overview]
Message-ID: <20220127053929.GA8503@yangzhon-Virtual> (raw)
In-Reply-To: <20220126152210.3044876-1-pbonzini@redhat.com>
On Wed, Jan 26, 2022 at 10:22:07AM -0500, Paolo Bonzini wrote:
> While working on the QEMU support for AMX, I noticed that there is no
> equivalent of ARCH_GET_XCOMP_SUPP in the KVM API. This is important
> because KVM_GET_SUPPORTED_CPUID is meant to be passed (by simple-minded
> VMMs) to KVM_SET_CPUID2, and therefore it cannot include any dynamic
> xsave states that have not been enabled. Probing the availability of
> dynamic xsave states therefore, requires a new ioctl or arch_prctl.
>
> In order to avoid moving supported_xcr0 to the kernel from the KVM
> module just for this use, and to ensure that the value can only be
> probed if/after the KVM module has been loaded, this series goes
> for the former option.
>
> KVM_CHECK_EXTENSION cannot be used because it only has 32 bits of
> output; in order to limit the growth of capabilities and ioctls, the
> series adds a /dev/kvm variant of KVM_{GET,HAS}_DEVICE_ATTR that
> can be used in the future and by other architectures. It then
> implements it in x86 with just one group (0) and attribute
> (KVM_X86_XCOMP_GUEST_SUPP).
>
> The corresponding changes to the tests, in patches 1 and 3, are
> designed so that the code will be covered (to the possible extent)
> even when running the tests on systems that do not support AMX.
> However, the patches have not been tested with AMX.
>
Paolo, thanks for this patchset. I applied this patchset into latest
Linux release, and verified it from kvm selftest tool and Qemu side
(In order to verify this easily, I reused the older request permission
function like kvm selftest did), all work well. thanks!
Yang
> Thanks,
>
> Paolo
>
>
> Paolo Bonzini (3):
> selftests: kvm: move vm_xsave_req_perm call to amx_test
> KVM: x86: add system attribute to retrieve full set of supported xsave
> states
> selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP
>
> Documentation/virt/kvm/api.rst | 4 +-
> arch/x86/include/uapi/asm/kvm.h | 3 ++
> arch/x86/kvm/x86.c | 45 +++++++++++++++++++
> include/uapi/linux/kvm.h | 1 +
> tools/arch/x86/include/uapi/asm/kvm.h | 3 ++
> tools/include/uapi/linux/kvm.h | 1 +
> .../selftests/kvm/include/kvm_util_base.h | 1 -
> .../selftests/kvm/include/x86_64/processor.h | 1 +
> tools/testing/selftests/kvm/lib/kvm_util.c | 7 ---
> .../selftests/kvm/lib/x86_64/processor.c | 27 ++++++++---
> tools/testing/selftests/kvm/x86_64/amx_test.c | 2 +
> 11 files changed, 80 insertions(+), 15 deletions(-)
>
> --
> 2.31.1
prev parent reply other threads:[~2022-01-27 5:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 15:22 [PATCH 0/3] KVM: x86: export supported_xcr0 via UAPI Paolo Bonzini
2022-01-26 15:22 ` [PATCH 1/3] selftests: kvm: move vm_xsave_req_perm call to amx_test Paolo Bonzini
2022-01-26 15:22 ` [PATCH 2/3] KVM: x86: add system attribute to retrieve full set of supported xsave states Paolo Bonzini
2022-01-27 15:35 ` Sean Christopherson
2022-01-28 2:41 ` Yang Zhong
2022-01-28 6:07 ` Yang Zhong
2022-01-28 12:33 ` Paolo Bonzini
2022-01-26 15:22 ` [PATCH 3/3] selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP Paolo Bonzini
2022-01-27 5:39 ` Yang Zhong [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=20220127053929.GA8503@yangzhon-Virtual \
--to=yang.zhong@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@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;
as well as URLs for NNTP newsgroup(s).