From: Huaitong Han <huaitong.han@intel.com>
To: pbonzini@redhat.com, rth@twiddle.net, afaerber@suse.de,
ehabkost@redhat.com
Cc: Huaitong Han <huaitong.han@intel.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 3/3] qemu, pkeys: add pkeys support for qemu migration
Date: Mon, 9 Nov 2015 19:55:34 +0800 [thread overview]
Message-ID: <1447070134-4324-4-git-send-email-huaitong.han@intel.com> (raw)
In-Reply-To: <1447070134-4324-1-git-send-email-huaitong.han@intel.com>
This patch adds pkeys support for qemu migration.
Signed-off-by: Huaitong Han <huaitong.han@intel.com>
---
target-i386/machine.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/target-i386/machine.c b/target-i386/machine.c
index a0df64b..1b190c7 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -725,6 +725,26 @@ static const VMStateDescription vmstate_xss = {
VMSTATE_END_OF_LIST()
}
};
+#ifdef TARGET_X86_64
+static bool pkru_needed(void *opaque)
+{
+ X86CPU *cpu = opaque;
+ CPUX86State *env = &cpu->env;
+
+ return env->pkru != 0;
+}
+
+static const VMStateDescription vmstate_pkru = {
+ .name = "cpu/pkru",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = pkru_needed,
+ .fields = (VMStateField[]){
+ VMSTATE_UINT32(env.pkru, X86CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+#endif
VMStateDescription vmstate_x86_cpu = {
.name = "cpu",
@@ -844,6 +864,9 @@ VMStateDescription vmstate_x86_cpu = {
&vmstate_msr_hyperv_time,
&vmstate_avx512,
&vmstate_xss,
+#ifdef TARGET_X86_64
+ &vmstate_pkru,
+#endif
NULL
}
};
--
2.4.3
prev parent reply other threads:[~2015-11-09 11:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 11:55 [Qemu-devel] [PATCH 0/3] qemu, pkeys: add memory protection-key support Huaitong Han
2015-11-09 11:55 ` [Qemu-devel] [PATCH 1/3] qemu, pkeys: add pkeys support for qemu cpuid handling Huaitong Han
2015-11-09 12:24 ` Paolo Bonzini
2015-11-09 15:19 ` Andreas Färber
2015-11-09 11:55 ` [Qemu-devel] [PATCH 2/3] qemu, pkeys: add pkeys support for qemu xsave state handling Huaitong Han
2015-11-09 18:49 ` Eduardo Habkost
2015-11-09 11:55 ` Huaitong Han [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=1447070134-4324-4-git-send-email-huaitong.han@intel.com \
--to=huaitong.han@intel.com \
--cc=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).