From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com, gleb@redhat.com, Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 1/5] qemu-kvm: kill xsave/xcrs helpers
Date: Sat, 23 Oct 2010 20:05:25 -0200 [thread overview]
Message-ID: <20101023220718.537467617@amt.cnet> (raw)
In-Reply-To: 20101023220524.049191736@amt.cnet
[-- Attachment #1: qemu-kvm-x86-2 --]
[-- Type: text/plain, Size: 3471 bytes --]
Use kvm_vcpu_ioctl directly instead.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: qemu-kvm/qemu-kvm-x86.c
===================================================================
--- qemu-kvm.orig/qemu-kvm-x86.c
+++ qemu-kvm/qemu-kvm-x86.c
@@ -825,7 +825,7 @@ void kvm_arch_load_regs(CPUState *env, i
*(uint64_t *)&xsave->region[XSAVE_XSTATE_BV] = env->xstate_bv;
memcpy(&xsave->region[XSAVE_YMMH_SPACE], env->ymmh_regs,
sizeof env->ymmh_regs);
- kvm_set_xsave(env, xsave);
+ kvm_vcpu_ioctl(env, KVM_SET_XSAVE, xsave);
if (kvm_check_extension(kvm_state, KVM_CAP_XCRS)) {
struct kvm_xcrs xcrs;
@@ -833,7 +833,7 @@ void kvm_arch_load_regs(CPUState *env, i
xcrs.flags = 0;
xcrs.xcrs[0].xcr = 0;
xcrs.xcrs[0].value = env->xcr0;
- kvm_set_xcrs(env, &xcrs);
+ kvm_vcpu_ioctl(env, KVM_SET_XCRS, &xcrs);
}
qemu_free(xsave);
} else {
@@ -1011,7 +1011,7 @@ void kvm_arch_save_regs(CPUState *env)
struct kvm_xsave* xsave;
uint16_t cwd, swd, twd, fop;
xsave = qemu_memalign(4096, sizeof(struct kvm_xsave));
- kvm_get_xsave(env, xsave);
+ kvm_vcpu_ioctl(env, KVM_GET_XSAVE, xsave);
cwd = (uint16_t)xsave->region[0];
swd = (uint16_t)(xsave->region[0] >> 16);
twd = (uint16_t)xsave->region[1];
@@ -1033,7 +1033,7 @@ void kvm_arch_save_regs(CPUState *env)
if (kvm_check_extension(kvm_state, KVM_CAP_XCRS)) {
struct kvm_xcrs xcrs;
- kvm_get_xcrs(env, &xcrs);
+ kvm_vcpu_ioctl(env, KVM_GET_XCRS, &xcrs);
if (xcrs.xcrs[0].xcr == 0) {
env->xcr0 = xcrs.xcrs[0].value;
}
Index: qemu-kvm/qemu-kvm.c
===================================================================
--- qemu-kvm.orig/qemu-kvm.c
+++ qemu-kvm/qemu-kvm.c
@@ -516,30 +516,6 @@ int kvm_set_mpstate(CPUState *env, struc
}
#endif
-#ifdef KVM_CAP_XSAVE
-int kvm_get_xsave(CPUState *env, struct kvm_xsave *xsave)
-{
- return kvm_vcpu_ioctl(env, KVM_GET_XSAVE, xsave);
-}
-
-int kvm_set_xsave(CPUState *env, struct kvm_xsave *xsave)
-{
- return kvm_vcpu_ioctl(env, KVM_SET_XSAVE, xsave);
-}
-#endif
-
-#ifdef KVM_CAP_XCRS
-int kvm_get_xcrs(CPUState *env, struct kvm_xcrs *xcrs)
-{
- return kvm_vcpu_ioctl(env, KVM_GET_XCRS, xcrs);
-}
-
-int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs)
-{
- return kvm_vcpu_ioctl(env, KVM_SET_XCRS, xcrs);
-}
-#endif
-
static int handle_mmio(CPUState *env)
{
unsigned long addr = env->kvm_run->mmio.phys_addr;
Index: qemu-kvm/qemu-kvm.h
===================================================================
--- qemu-kvm.orig/qemu-kvm.h
+++ qemu-kvm/qemu-kvm.h
@@ -284,34 +284,6 @@ int kvm_get_mpstate(CPUState *env, struc
int kvm_set_mpstate(CPUState *env, struct kvm_mp_state *mp_state);
#endif
-#ifdef KVM_CAP_XSAVE
-/*!
- * * \brief Read VCPU xsave state
- *
- */
-int kvm_get_xsave(CPUState *env, struct kvm_xsave *xsave);
-
-/*!
- * * \brief Write VCPU xsave state
- *
- */
-int kvm_set_xsave(CPUState *env, struct kvm_xsave *xsave);
-#endif
-
-#ifdef KVM_CAP_XCRS
-/*!
- * * \brief Read VCPU XCRs
- *
- */
-int kvm_get_xcrs(CPUState *env, struct kvm_xcrs *xcrs);
-
-/*!
- * * \brief Write VCPU XCRs
- *
- */
-int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs);
-#endif
-
/*!
* \brief Simulate an external vectored interrupt
*
next prev parent reply other threads:[~2010-10-23 22:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-23 22:05 [patch 0/5] use upstream x86 state save/restore code Marcelo Tosatti
2010-10-23 22:05 ` Marcelo Tosatti [this message]
2010-10-23 22:05 ` [patch 2/5] qemu-kvm: use upstream fpu/xsave/xcrs " Marcelo Tosatti
2010-10-23 22:05 ` [patch 3/5] qemu-kvm: use upstream sregs " Marcelo Tosatti
2010-10-23 22:05 ` [patch 4/5] qemu-kvm: use upstream regs " Marcelo Tosatti
2010-10-23 22:05 ` [patch 5/5] qemu-kvm: use upstream msr " Marcelo Tosatti
2010-10-24 13:46 ` [patch 0/5] use upstream x86 state " Avi Kivity
2010-10-24 21:05 ` Marcelo Tosatti
2010-10-25 9:56 ` Avi Kivity
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=20101023220718.537467617@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.