Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/arch/xen Pull up following revision(s) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/e80bc56b06ed
branches: netbsd-6
changeset: 773789:e80bc56b06ed
user: riz <riz%NetBSD.org@localhost>
date: Wed Feb 22 18:48:45 2012 +0000
description:
Pull up following revision(s) (requested by bouyer in ticket #28):
sys/arch/xen/include/hypervisor.h: revision 1.38
sys/arch/xen/xen/hypervisor.c: revision 1.61
sys/arch/xen/xen/clock.c: revision 1.62
- make xen_version globally available, with macros to access major and
minor xen version.
- In xen_initclocks(), do a VCPUOP_stop_periodic_timer only for Xen 3.1
and later
Should fix PR port-xen/45961
- make xen_version globally available, with macros to access major and
minor xen version.
- In xen_initclocks(), do a VCPUOP_stop_periodic_timer only for Xen 3.1
and later
Should fix PR port-xen/45961
diffstat:
sys/arch/xen/include/hypervisor.h | 6 +++++-
sys/arch/xen/xen/clock.c | 13 ++++++++-----
sys/arch/xen/xen/hypervisor.c | 11 ++++++-----
3 files changed, 19 insertions(+), 11 deletions(-)
diffs (101 lines):
diff -r 81540082d4e8 -r e80bc56b06ed sys/arch/xen/include/hypervisor.h
--- a/sys/arch/xen/include/hypervisor.h Wed Feb 22 18:45:26 2012 +0000
+++ b/sys/arch/xen/include/hypervisor.h Wed Feb 22 18:48:45 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.h,v 1.36 2011/12/07 15:47:42 cegger Exp $ */
+/* $NetBSD: hypervisor.h,v 1.36.2.1 2012/02/22 18:48:45 riz Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -133,6 +133,10 @@
void do_hypervisor_callback(struct intrframe *regs);
void hypervisor_enable_event(unsigned int);
+extern int xen_version;
+#define XEN_MAJOR(x) (((x) & 0xffff0000) >> 16)
+#define XEN_MINOR(x) ((x) & 0x0000ffff)
+
/* hypervisor_machdep.c */
void hypervisor_send_event(struct cpu_info *, unsigned int);
void hypervisor_unmask_event(unsigned int);
diff -r 81540082d4e8 -r e80bc56b06ed sys/arch/xen/xen/clock.c
--- a/sys/arch/xen/xen/clock.c Wed Feb 22 18:45:26 2012 +0000
+++ b/sys/arch/xen/xen/clock.c Wed Feb 22 18:48:45 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.61 2012/02/12 14:38:18 jym Exp $ */
+/* $NetBSD: clock.c,v 1.61.2.1 2012/02/22 18:48:45 riz Exp $ */
/*
*
@@ -29,7 +29,7 @@
#include "opt_xen.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.61 2012/02/12 14:38:18 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.61.2.1 2012/02/22 18:48:45 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -458,10 +458,13 @@
* after a while. Use the one-shot timer every NS_PER_TICK
* and rearm it from the event handler.
*/
- err = HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer,
- ci->ci_cpuid,
+ if (XEN_MAJOR(xen_version) > 3 || XEN_MINOR(xen_version) > 0) {
+ /* exists only on Xen 3.1 and later */
+ err = HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer,
+ ci->ci_cpuid,
NULL);
- KASSERT(err == 0);
+ KASSERT(err == 0);
+ }
err = HYPERVISOR_set_timer_op(
vcpu_system_time[ci->ci_cpuid] + NS_PER_TICK);
diff -r 81540082d4e8 -r e80bc56b06ed sys/arch/xen/xen/hypervisor.c
--- a/sys/arch/xen/xen/hypervisor.c Wed Feb 22 18:45:26 2012 +0000
+++ b/sys/arch/xen/xen/hypervisor.c Wed Feb 22 18:48:45 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.60 2011/12/09 11:47:49 cherry Exp $ */
+/* $NetBSD: hypervisor.c,v 1.60.2.1 2012/02/22 18:48:45 riz Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.60 2011/12/09 11:47:49 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.60.2.1 2012/02/22 18:48:45 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,6 +169,8 @@
#endif
#endif
+int xen_version;
+
/* power management, for save/restore */
static bool hypervisor_suspend(device_t, const pmf_qual_t *);
static bool hypervisor_resume(device_t, const pmf_qual_t *);
@@ -201,7 +203,6 @@
void
hypervisor_attach(device_t parent, device_t self, void *aux)
{
- int xen_version;
#if NPCI >0
#ifdef PCI_BUS_FIXUP
@@ -213,8 +214,8 @@
xenkernfs_init();
xen_version = HYPERVISOR_xen_version(XENVER_version, NULL);
- aprint_normal(": Xen version %d.%d\n", (xen_version & 0xffff0000) >> 16,
- xen_version & 0x0000ffff);
+ aprint_normal(": Xen version %d.%d\n", XEN_MAJOR(xen_version),
+ XEN_MINOR(xen_version));
xengnt_init();
events_init();
Home |
Main Index |
Thread Index |
Old Index