qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] kvm_arch_put_registers and xsave


From: Peter Maydell
Subject: Re: [Qemu-devel] kvm_arch_put_registers and xsave
Date: Sun, 19 Jun 2016 21:54:31 +0100

On 19 June 2016 at 20:36, Alex Bligh <address@hidden> wrote:
> Looking at kvm_arch_put_registers it appears to be pretty complicated.
> It appears to 'put' each individual register type, as well as putting
> an xsave region. I'm a bit confused why the ordinary registers 'put'
> are not then overwritten by the xsave put.
>
> Assuming I am only targeting processors supporting XSAVE (which I
> believe is reasonable given what Macs support Hypervisor.Framework),
> is there a reason I shouldn't merely XRSTOR (by writing the
> XSAVE region with the appropriate hv_ call) and ignore all the
> other register futzing? Or is it more complicated than that
> because (presumably) something sets up register states in the
> cpu->regs, cpu->sregs areas? I'm a bit confused as to how all
> this works to be honest. Any ideas / docs to point to?

The purpose of the get/put functions, broadly, is "copy
state from the hypervisor into QEMU's cpu state struct
and vice-versa". The specific details are down to KVM's ABI
(and to historical details like some KVM ioctls being newer
or optional). For a from-scratch hypervisor I think all
you need to do is copy the state from env->regs,
env->xmm_regs, etc etc into the hypervisor and back,
however is best suited to the hypervisor's APIs.

thanks
-- PMM



reply via email to

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