All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	Eddie Dong <eddie.dong@intel.com>,
	linux-kernel@vger.kernel.org,
	xen-devel <xen-devel@lists.xensource.com>,
	Sheng Yang <sheng@linux.intel.com>
Subject: [RFC][PATCH 06/10] xen/hybrid: Add shared_info page for xen
Date: Wed, 16 Sep 2009 16:42:27 +0800	[thread overview]
Message-ID: <1253090551-7969-7-git-send-email-sheng@linux.intel.com> (raw)
In-Reply-To: <1253090551-7969-1-git-send-email-sheng@linux.intel.com>

Reserved shared_info page in xen-head.S, as hypercall page

Notice that we would modify the shared_info page, so put it in the data
section.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 arch/x86/xen/enlighten.c |   25 +++++++++++++++++++++++++
 arch/x86/xen/xen-head.S  |    6 ++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b95c696..b6751ed 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -31,6 +31,7 @@
 #include <xen/interface/version.h>
 #include <xen/interface/physdev.h>
 #include <xen/interface/vcpu.h>
+#include <xen/interface/memory.h>
 #include <xen/interface/hvm/hvm_op.h>
 #include <xen/features.h>
 #include <xen/page.h>
@@ -1112,6 +1113,28 @@ static int init_hybrid_info(void)
 	return 0;
 }
 
+extern struct shared_info shared_info_page;
+
+static int __init init_shared_info(void)
+{
+	struct xen_add_to_physmap xatp;
+
+	xatp.domid = DOMID_SELF;
+	xatp.idx = 0;
+	xatp.space = XENMAPSPACE_shared_info;
+	xatp.gpfn = __pa(&shared_info_page) >> PAGE_SHIFT;
+	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
+		BUG();
+
+	HYPERVISOR_shared_info = (struct shared_info *)&shared_info_page;
+
+	/* Don't do the full vcpu_info placement stuff until we have a
+	   possible map and a non-dummy shared_info. */
+	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
+
+	return 0;
+}
+
 void __init xen_start_hybrid(void)
 {
 	int r;
@@ -1124,5 +1147,7 @@ void __init xen_start_hybrid(void)
 		return;
 
 	xen_hybrid_init_irq_ops();
+
+	init_shared_info();
 }
 
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a5ff24..26041ce 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -33,6 +33,12 @@ ENTRY(hypercall_page)
 	.skip PAGE_SIZE_asm
 .popsection
 
+.pushsection .data
+	.align PAGE_SIZE_asm
+ENTRY(shared_info_page)
+	.skip PAGE_SIZE_asm
+.popsection
+
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
 	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
-- 
1.5.4.5


  parent reply	other threads:[~2009-09-16  8:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16  8:42 [RFC][PATCH 0/10] Xen Hybrid extension support Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 01/10] xen/pvhvm: add support for hvm_op Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 02/10] xen/hybrid: Import cpuid.h from Xen Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 03/10] xen/hybrid: Xen Hybrid Extension initialization Sheng Yang
2009-09-16 20:24   ` [Xen-devel] " Jeremy Fitzhardinge
2009-09-17  6:22     ` Keir Fraser
2009-09-17 16:46       ` Jeremy Fitzhardinge
2009-09-16  8:42 ` [RFC][PATCH 04/10] xen/hybrid: Modify pv_init_ops and xen_info Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 05/10] xen/hybrid: Add PV halt support Sheng Yang
2009-09-16  8:42 ` Sheng Yang [this message]
2009-09-16  8:42 ` [RFC][PATCH 07/10] xen/hybrid: Add PV timer support Sheng Yang
2009-09-16 20:25   ` [Xen-devel] " Jeremy Fitzhardinge
2009-09-17  5:54     ` Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 08/10] x86: Don't ack_APIC_irq() if lapic is disabled in GENERIC_INTERRUPT_VECTOR handler Sheng Yang
2009-09-16  8:58   ` Cyrill Gorcunov
2009-09-16  9:03     ` Cyrill Gorcunov
2009-09-16  9:37       ` Cyrill Gorcunov
2009-09-17  3:54         ` Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 09/10] xen/hybrid: Make event channel work with QEmu emulated devices Sheng Yang
2009-09-16 20:35   ` [Xen-devel] " Jeremy Fitzhardinge
2009-09-17  5:58     ` Sheng Yang
2009-09-16  8:42 ` [RFC][PATCH 10/10] xen/hybrid: Enable grant table and xenbus Sheng Yang
2009-09-16 13:31 ` [Xen-devel] [RFC][PATCH 0/10] Xen Hybrid extension support Konrad Rzeszutek Wilk
2009-09-17  8:59   ` Sheng Yang

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=1253090551-7969-7-git-send-email-sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=eddie.dong@intel.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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.