xen-ia64-devel
[Xen-ia64-devel] [PATCH 14/17] ia64/pv_ops: define initialization hooks,
To: |
tony.luck@xxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx |
Subject: |
[Xen-ia64-devel] [PATCH 14/17] ia64/pv_ops: define initialization hooks, pv_init_ops, for paravirtualized environment. |
From: |
Isaku Yamahata <yamahata@xxxxxxxxxxxxx> |
Date: |
Mon, 19 May 2008 22:13:41 +0900 |
Cc: |
yamahata@xxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx, Alex Williamson <alex.williamson@xxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx |
Delivery-date: |
Mon, 19 May 2008 06:18:40 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxx |
In-reply-to: |
<12112028241775-git-send-email-yamahata@xxxxxxxxxxxxx> |
List-help: |
<mailto:xen-ia64-devel-request@lists.xensource.com?subject=help> |
List-id: |
Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com> |
List-post: |
<mailto:xen-ia64-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<12112028241775-git-send-email-yamahata@xxxxxxxxxxxxx> |
Sender: |
xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx |
define pv_init_ops hooks which represents various initialization
hooks for paravirtualized environment. and add hooks.
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
arch/ia64/kernel/paravirt.c | 7 ++++
arch/ia64/kernel/setup.c | 10 ++++++
arch/ia64/kernel/smpboot.c | 2 +
include/asm-ia64/paravirt.h | 70 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/kernel/paravirt.c b/arch/ia64/kernel/paravirt.c
index 7126ea8..5daf659 100644
--- a/arch/ia64/kernel/paravirt.c
+++ b/arch/ia64/kernel/paravirt.c
@@ -42,6 +42,13 @@ struct pv_info pv_info = {
};
/***************************************************************************
+ * pv_init_ops
+ * initialization hooks.
+ */
+
+struct pv_init_ops pv_init_ops;
+
+/***************************************************************************
* pv_cpu_ops
* intrinsics hooks.
*/
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index e9596cd..9173add 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -51,6 +51,7 @@
#include <asm/mca.h>
#include <asm/meminit.h>
#include <asm/page.h>
+#include <asm/paravirt.h>
#include <asm/patch.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
@@ -341,6 +342,8 @@ reserve_memory (void)
rsvd_region[n].end = (unsigned long) ia64_imva(_end);
n++;
+ n += paravirt_reserve_memory(&rsvd_region[n]);
+
#ifdef CONFIG_BLK_DEV_INITRD
if (ia64_boot_param->initrd_start) {
rsvd_region[n].start = (unsigned
long)__va(ia64_boot_param->initrd_start);
@@ -519,6 +522,8 @@ setup_arch (char **cmdline_p)
{
unw_init();
+ paravirt_arch_setup_early();
+
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64)
__end___vtop_patchlist);
*cmdline_p = __va(ia64_boot_param->command_line);
@@ -573,6 +578,9 @@ setup_arch (char **cmdline_p)
acpi_boot_init();
#endif
+ paravirt_banner();
+ paravirt_arch_setup_console(cmdline_p);
+
#ifdef CONFIG_VT
if (!conswitchp) {
# if defined(CONFIG_DUMMY_CONSOLE)
@@ -592,6 +600,8 @@ setup_arch (char **cmdline_p)
#endif
/* enable IA-64 Machine Check Abort Handling unless disabled */
+ if (paravirt_arch_setup_nomca())
+ nomca = 1;
if (!nomca)
ia64_mca_init();
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index d7ad42b..933f388 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -50,6 +50,7 @@
#include <asm/machvec.h>
#include <asm/mca.h>
#include <asm/page.h>
+#include <asm/paravirt.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
@@ -642,6 +643,7 @@ void __devinit smp_prepare_boot_cpu(void)
cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), cpu_callin_map);
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
+ paravirt_post_smp_prepare_boot_cpu();
}
#ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/asm-ia64/paravirt.h b/include/asm-ia64/paravirt.h
index 1032b21..84d74c3 100644
--- a/include/asm-ia64/paravirt.h
+++ b/include/asm-ia64/paravirt.h
@@ -55,11 +55,81 @@ static inline unsigned int get_kernel_rpl(void)
return pv_info.kernel_rpl;
}
+/******************************************************************************
+ * initialization hooks.
+ */
+struct rsvd_region;
+
+struct pv_init_ops {
+ void (*banner)(void);
+
+ int (*reserve_memory)(struct rsvd_region *region);
+
+ void (*arch_setup_early)(void);
+ void (*arch_setup_console)(char **cmdline_p);
+ int (*arch_setup_nomca)(void);
+
+ void (*post_smp_prepare_boot_cpu)(void);
+};
+
+extern struct pv_init_ops pv_init_ops;
+
+static inline void paravirt_banner(void)
+{
+ if (pv_init_ops.banner)
+ pv_init_ops.banner();
+}
+
+static inline int paravirt_reserve_memory(struct rsvd_region *region)
+{
+ if (pv_init_ops.reserve_memory)
+ return pv_init_ops.reserve_memory(region);
+ return 0;
+}
+
+static inline void paravirt_arch_setup_early(void)
+{
+ if (pv_init_ops.arch_setup_early)
+ pv_init_ops.arch_setup_early();
+}
+
+static inline void paravirt_arch_setup_console(char **cmdline_p)
+{
+ if (pv_init_ops.arch_setup_console)
+ pv_init_ops.arch_setup_console(cmdline_p);
+}
+
+static inline int paravirt_arch_setup_nomca(void)
+{
+ if (pv_init_ops.arch_setup_nomca)
+ return pv_init_ops.arch_setup_nomca();
+ return 0;
+}
+
+static inline void paravirt_post_smp_prepare_boot_cpu(void)
+{
+ if (pv_init_ops.post_smp_prepare_boot_cpu)
+ pv_init_ops.post_smp_prepare_boot_cpu();
+}
+
#endif /* !__ASSEMBLY__ */
#else
/* fallback for native case */
+#ifndef __ASSEMBLY__
+
+#define paravirt_banner() do { } while (0)
+#define paravirt_reserve_memory(region) 0
+
+#define paravirt_arch_setup_early() do { } while (0)
+#define paravirt_arch_setup_console(cmdline_p) do { } while (0)
+#define paravirt_arch_setup_nomca() 0
+#define paravirt_post_smp_prepare_boot_cpu() do { } while (0)
+
+#endif /* __ASSEMBLY__ */
+
+
#endif /* CONFIG_PARAVIRT_GUEST */
#endif /* __ASM_PARAVIRT_H */
--
1.5.3
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-ia64-devel] [PATCH 00/17] ia64/pv_ops take 6, Isaku Yamahata
- [Xen-ia64-devel] [PATCH 02/17] ia64/pv_ops: preparation: move the constants, LOAD_OFFSET, to a header file., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 03/17] ia64/pv_ops: preparation: introduce ia64_set_rr0_to_rr4() to make kernel paravirtualization friendly., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 06/17] ia64/pv_ops: add an early setup hook for pv_ops., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 05/17] ia64/pv_ops: introduce pv_info which describes some random info., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 04/17] ia64/pv_ops: preparation: introduce ia64_get_psr_i() to make kernel paravirtualization friendly., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 14/17] ia64/pv_ops: define initialization hooks, pv_init_ops, for paravirtualized environment.,
Isaku Yamahata <=
- [Xen-ia64-devel] [PATCH 13/17] ia64/pv_ops: paravirtualize NR_IRQS, Isaku Yamahata
- [Xen-ia64-devel] [PATCH 12/17] ia64/pv_ops: paravirtualize entry.S, Isaku Yamahata
- [Xen-ia64-devel] [PATCH 15/17] ia64/pv_ops: add hooks, pv_iosapic_ops, to paravirtualize iosapic., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 08/17] ia64/pv_ops: preparation for paravirtulization of hand written assembly code., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 11/17] ia64/pv_ops: paravirtualize ivt.S, Isaku Yamahata
- [Xen-ia64-devel] [PATCH 07/17] ia64/pv_ops: introduce pv_cpu_ops to paravirtualize privileged instructions., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 09/17] ia64/pv_ops: define paravirtualized instructions for native., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 16/17] ia64/pv_ops: add hooks, pv_irq_ops, to paravirtualized irq related operations., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 17/17] ia64/pv_ops: add to hooks, pv_time_ops, for steal time accounting., Isaku Yamahata
- [Xen-ia64-devel] [PATCH 10/17] ia64/pv_ops: paravirtualize minstate.h., Isaku Yamahata
|
|
|