From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
George Dunlap <george.dunlap@eu.citrix.com>,
Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH RFC] pvh: clearly specify used parameters in vcpu_guest_context
Date: Fri, 15 Nov 2013 16:50:22 +0100 [thread overview]
Message-ID: <1384530622-31703-1-git-send-email-roger.pau@citrix.com> (raw)
The aim of this patch is to define a stable way in which PVH is
going to do AP bringup.
Since we are running inside of a HVM container, PVH should only need
to set flags, cr3 and user_regs in order to bring up a vCPU, the rest
can be set once the vCPU is started using the bare metal methods.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
---
xen/arch/x86/domain.c | 11 +++--------
xen/arch/x86/hvm/vmx/vmx.c | 4 ----
xen/include/public/arch-x86/xen.h | 6 ++----
3 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a3868f9..b643eaf 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -704,9 +704,11 @@ int arch_set_info_guest(
/* PVH 32bitfixme */
ASSERT(!compat);
- if ( c(ctrlreg[1]) || c(ldt_base) || c(ldt_ents) ||
+ if ( c(ctrlreg[0]) || c(ctrlreg[1]) || c(ctrlreg[2]) ||
+ c(ctrlreg[4]) || c(ldt_base) || c(ldt_ents) ||
c(user_regs.cs) || c(user_regs.ss) || c(user_regs.es) ||
c(user_regs.ds) || c(user_regs.fs) || c(user_regs.gs) ||
+ c(kernel_ss) || c(kernel_sp) || c.nat->gs_base_kernel ||
c.nat->gdt_ents || c.nat->fs_base || c.nat->gs_base_user )
return -EINVAL;
}
@@ -745,13 +747,6 @@ int arch_set_info_guest(
if ( has_hvm_container_vcpu(v) )
{
- /*
- * NB: TF_kernel_mode is set unconditionally for HVM guests,
- * so we always use the gs_base_kernel here. If we change this
- * function to imitate the PV functionality, we'll need to
- * make it pay attention to the kernel bit.
- */
- hvm_set_info_guest(v, compat ? 0 : c.nat->gs_base_kernel);
if ( is_hvm_vcpu(v) || v->is_initialised )
goto out;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f0132a4..90999ca 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1492,10 +1492,6 @@ static void vmx_set_info_guest(struct vcpu *v, uint64_t gs_base_kernel)
__vmwrite(GUEST_INTERRUPTIBILITY_INFO, intr_shadow);
}
- /* PVH 32bitfixme */
- if ( is_pvh_vcpu(v) )
- __vmwrite(GUEST_GS_BASE, gs_base_kernel);
-
vmx_vmcs_exit(v);
}
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 5d220ce..46736ae 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -161,10 +161,8 @@ typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
* - For HVM guests, the structures read include: fpu_ctxt (if
* VGCT_I387_VALID is set), flags, user_regs, debugreg[*]
*
- * - PVH guests are the same as HVM guests, but additionally set cr3,
- * and for 64-bit guests, gs_base_kernel. Additionally, the following
- * entries must be 0: ctrlreg[1], ldt_base, ldt_ents, user_regs.{cs,
- * ss, es, ds, fs, gs), gdt_ents, fs_base, and gs_base_user.
+ * - PVH guests are the same as HVM guests, but additionally use ctrlreg[3] to
+ * set cr3. All other unused fields must be set to 0.
*/
struct vcpu_guest_context {
/* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
--
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2013-11-15 15:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 15:50 Roger Pau Monne [this message]
2013-11-15 16:32 ` [PATCH RFC] pvh: clearly specify used parameters in vcpu_guest_context Jan Beulich
2013-11-15 16:40 ` George Dunlap
2013-11-15 16:45 ` Jan Beulich
2013-11-15 21:56 ` Mukesh Rathor
2013-11-15 23:56 ` Mukesh Rathor
2013-11-16 1:12 ` Mukesh Rathor
2013-11-16 1:56 ` Mukesh Rathor
2013-11-16 8:02 ` Roger Pau Monné
2013-11-18 12:15 ` George Dunlap
2013-11-18 16:17 ` Konrad Rzeszutek Wilk
2013-11-18 16:19 ` Konrad Rzeszutek Wilk
2013-11-18 11:50 ` George Dunlap
2013-11-15 16:55 ` Tim Deegan
2013-11-15 23:35 ` Mukesh Rathor
2013-11-16 8:04 ` Roger Pau Monné
2013-11-15 16:59 ` Roger Pau Monné
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=1384530622-31703-1-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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 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).