From owner-p4-projects@FreeBSD.ORG Mon Feb 18 05:03:32 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8B26416A46E; Mon, 18 Feb 2008 05:03:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3795A16A421 for ; Mon, 18 Feb 2008 05:03:32 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 214B213C469 for ; Mon, 18 Feb 2008 05:03:32 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1I53VK8048503 for ; Mon, 18 Feb 2008 05:03:31 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1I53VOI048500 for perforce@freebsd.org; Mon, 18 Feb 2008 05:03:31 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 18 Feb 2008 05:03:31 GMT Message-Id: <200802180503.m1I53VOI048500@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 135624 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 05:03:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=135624 Change 135624 by kmacy@pandemonium:kmacy:xen31 on 2008/02/18 05:03:22 add compatibility hypercall support Affected files ... .. //depot/projects/xen31/sys/i386/include/cpufunc.h#7 edit .. //depot/projects/xen31/sys/i386/include/pmap.h#11 edit .. //depot/projects/xen31/sys/i386/include/xen/hypercall.h#8 edit .. //depot/projects/xen31/sys/i386/include/xen/hypervisor.h#6 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-os.h#6 edit .. //depot/projects/xen31/sys/kern/subr_kdb.c#4 edit .. //depot/projects/xen31/sys/xen/features.c#2 edit Differences ... ==== //depot/projects/xen31/sys/i386/include/cpufunc.h#7 (text+ko) ==== @@ -45,7 +45,6 @@ #ifdef XEN #include #define NO_EXCHANGE -#include #include #include #include ==== //depot/projects/xen31/sys/i386/include/pmap.h#11 (text+ko) ==== @@ -194,7 +194,6 @@ #ifdef XEN -#include #include #include #include ==== //depot/projects/xen31/sys/i386/include/xen/hypercall.h#8 (text+ko) ==== @@ -30,11 +30,14 @@ #ifndef __HYPERCALL_H__ #define __HYPERCALL_H__ +#include #include #include #define __STR(x) #x #define STR(x) __STR(x) +#define ENOXENSYS 38 + #if defined(XEN) #define HYPERCALL_STR(name) \ @@ -171,6 +174,13 @@ return _hypercall1(int, fpu_taskswitch, set); } +static inline int +HYPERVISOR_sched_op_compat( + int cmd, unsigned long arg) +{ + return _hypercall2(int, sched_op_compat, cmd, arg); +} + static inline int HYPERVISOR_sched_op( int cmd, void *arg) @@ -245,9 +255,19 @@ static inline int HYPERVISOR_event_channel_op( - int cmd, void *op) + int cmd, void *arg) { - return _hypercall2(int, event_channel_op, cmd, op); + int rc = _hypercall2(int, event_channel_op, cmd, arg); + + if (__predict_false(rc == -ENOXENSYS)) { + struct evtchn_op op; + op.cmd = cmd; + memcpy(&op.u, arg, sizeof(op.u)); + rc = _hypercall1(int, event_channel_op_compat, &op); + memcpy(arg, &op.u, sizeof(op.u)); + } + + return (rc); } static inline int @@ -266,9 +286,19 @@ static inline int HYPERVISOR_physdev_op( - int cmd, void *physdev_op) + int cmd, void *arg) { - return _hypercall2(int, physdev_op, cmd, physdev_op); + int rc = _hypercall2(int, physdev_op, cmd, arg); + + if (__predict_false(rc == -ENOXENSYS)) { + struct physdev_op op; + op.cmd = cmd; + memcpy(&op.u, arg, sizeof(op.u)); + rc = _hypercall1(int, physdev_op_compat, &op); + memcpy(arg, &op.u, sizeof(op.u)); + } + + return (rc); } static inline int @@ -312,10 +342,13 @@ struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_suspend }; - return _hypercall3(int, sched_op, SCHEDOP_shutdown, + int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown, &sched_shutdown, srec); + if (rc == -ENOXENSYS) + rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown, + SHUTDOWN_suspend, srec); + return (rc); } -#ifdef notyet static inline int HYPERVISOR_nmi_op( unsigned long op, void *arg) @@ -323,6 +356,7 @@ return _hypercall2(int, nmi_op, op, arg); } +#ifdef notyet static inline unsigned long HYPERVISOR_hvm_op( int op, void *arg) ==== //depot/projects/xen31/sys/i386/include/xen/hypervisor.h#6 (text+ko) ==== @@ -16,6 +16,7 @@ #endif #include +#include #include #include #include ==== //depot/projects/xen31/sys/i386/include/xen/xen-os.h#6 (text+ko) ==== @@ -4,10 +4,14 @@ * random collection of macros and definition */ -#ifndef _OS_H_ -#define _OS_H_ +#ifndef _XEN_OS_H_ +#define _XEN_OS_H_ #include +#ifdef PAE +#define CONFIG_X86_PAE +#endif +#include /* Force a proper event-channel callback from Xen. */ void force_evtchn_callback(void); @@ -70,7 +74,6 @@ /* Everything below this point is not included by assembler (.S) files. */ #ifndef __ASSEMBLY__ #include -#include void printk(const char *fmt, ...); ==== //depot/projects/xen31/sys/kern/subr_kdb.c#4 (text+ko) ==== @@ -306,6 +306,7 @@ */ #ifdef XEN #include /* needed for btext/etext */ +#include #endif void kdb_enter(const char *why, const char *msg) ==== //depot/projects/xen31/sys/xen/features.c#2 (text+ko) ==== @@ -1,3 +1,4 @@ +#include #include #include