qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 15/22] x86: Grant AMX permission for guest


From: David Edmondson
Subject: Re: [PULL 15/22] x86: Grant AMX permission for guest
Date: Wed, 16 Mar 2022 17:48:04 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Wednesday, 2022-03-16 at 16:05:01 GMT, Daniel P. Berrangé wrote:

> On Wed, Mar 16, 2022 at 04:57:39PM +0100, Peter Krempa wrote:
>> On Tue, Mar 08, 2022 at 12:34:38 +0100, Paolo Bonzini wrote:
>> > From: Yang Zhong <yang.zhong@intel.com>
>> > 
>> > Kernel allocates 4K xstate buffer by default. For XSAVE features
>> > which require large state component (e.g. AMX), Linux kernel
>> > dynamically expands the xstate buffer only after the process has
>> > acquired the necessary permissions. Those are called dynamically-
>> > enabled XSAVE features (or dynamic xfeatures).
>> > 
>> > There are separate permissions for native tasks and guests.
>> > 
>> > Qemu should request the guest permissions for dynamic xfeatures
>> > which will be exposed to the guest. This only needs to be done
>> > once before the first vcpu is created.
>> > 
>> > KVM implemented one new ARCH_GET_XCOMP_SUPP system attribute API to
>> > get host side supported_xcr0 and Qemu can decide if it can request
>> > dynamically enabled XSAVE features permission.
>> > https://lore.kernel.org/all/20220126152210.3044876-1-pbonzini@redhat.com/
>> > 
>> > Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
>> > Signed-off-by: Jing Liu <jing2.liu@intel.com>
>> > Message-Id: <20220217060434.52460-4-yang.zhong@intel.com>
>> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> > ---
>> >  target/i386/cpu.c          |  7 +++++
>> >  target/i386/cpu.h          |  4 +++
>> >  target/i386/kvm/kvm-cpu.c  | 12 ++++----
>> >  target/i386/kvm/kvm.c      | 57 ++++++++++++++++++++++++++++++++++++++
>> >  target/i386/kvm/kvm_i386.h |  1 +
>> >  5 files changed, 75 insertions(+), 6 deletions(-)
>> 
>> With this commit qemu crashes for me when invoking the following
>> QMP command:
>
> It is way worse than that even. If you remove '-S' you get an
> immediate kaboom on startup on AMD hosts

Which AMD CPU is in this host?

> $ ./build/qemu-system-x86_64 -accel kvm
> Unable to init server: Could not connect: Connection refused
> qemu-system-x86_64: ../target/i386/kvm/kvm-cpu.c:105: kvm_cpu_xsave_init: 
> Assertion `esa->size == eax' failed.
> Aborted (core dumped)
>
> With regards,
> Daniel

dme.
-- 
My girl Friday, she no square.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]