CVS commit: src/sys/arch/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:49 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
xen/hypervisor.h: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/include/hypervisor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.56 src/sys/arch/xen/include/hypervisor.h:1.57
--- src/sys/arch/xen/include/hypervisor.h:1.56	Sat Feb 25 00:32:26 2023
+++ src/sys/arch/xen/include/hypervisor.h	Sat Feb 25 00:34:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.56 2023/02/25 00:32:26 riastradh Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.57 2023/02/25 00:34:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,21 +26,21 @@
  */
 
 /*
- * 
+ *
  * Communication to/from hypervisor.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
  * restriction, including without limitation the rights to use, copy, modify,
  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  * and to permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -187,10 +187,10 @@ void hypervisor_set_ipending(uint64_t, i
 void hypervisor_machdep_attach(void);
 void hypervisor_machdep_resume(void);
 
-/* 
+/*
  * Force a proper event-channel callback from Xen after clearing the
  * callback mask. We do this in a very simple manner, by making a call
- * down into Xen. The pending flag will be checked by Xen on return. 
+ * down into Xen. The pending flag will be checked by Xen on return.
  */
 static __inline void hypervisor_force_callback(void)
 {



CVS commit: src/sys/arch/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:49 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
xen/hypervisor.h: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/include/hypervisor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:26 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
xen: Fix sense of xen_rmb/wmb to make sense.

Use membar_acquire and membar_release, not membar_consumer and
membar_producer, out of paranoia -- that better matches Linux's
rmb/wmb (at least for non-I/O loads and stores).

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010248.html


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.55 src/sys/arch/xen/include/hypervisor.h:1.56
--- src/sys/arch/xen/include/hypervisor.h:1.55	Wed Sep  7 00:40:19 2022
+++ src/sys/arch/xen/include/hypervisor.h	Sat Feb 25 00:32:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.55 2022/09/07 00:40:19 knakahara Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.56 2023/02/25 00:32:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -111,8 +111,8 @@ struct xen_npx_attach_args {
 #undef xen_wmb
 
 #define xen_mb()  membar_sync()
-#define xen_rmb() membar_producer()
-#define xen_wmb() membar_consumer()
+#define xen_rmb() membar_acquire()
+#define xen_wmb() membar_release()
 #endif /* __XEN_INTERFACE_VERSION */
 
 #include 

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.6 src/sys/arch/xen/include/xenring.h:1.7
--- src/sys/arch/xen/include/xenring.h:1.6	Sat Apr 25 15:26:17 2020
+++ src/sys/arch/xen/include/xenring.h	Sat Feb 25 00:32:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.6 2020/04/25 15:26:17 bouyer Exp $ */
+/* $NetBSD: xenring.h,v 1.7 2023/02/25 00:32:26 riastradh Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -25,8 +25,8 @@
 #undef xen_wmb
 
 #define xen_mb()  membar_sync()
-#define xen_rmb() membar_producer()
-#define xen_wmb() membar_consumer()
+#define xen_rmb() membar_acquire()
+#define xen_wmb() membar_release()
 
 /*
  * Define ring types. These were previously part of the public API.



CVS commit: src/sys/arch/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:26 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
xen: Fix sense of xen_rmb/wmb to make sense.

Use membar_acquire and membar_release, not membar_consumer and
membar_producer, out of paranoia -- that better matches Linux's
rmb/wmb (at least for non-I/O loads and stores).

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010248.html


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2020-05-14 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu May 14 19:36:03 UTC 2020

Modified Files:
src/sys/arch/xen/include: intr.h

Log Message:
xen_vec_alloc() is no more


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/intr.h
diff -u src/sys/arch/xen/include/intr.h:1.55 src/sys/arch/xen/include/intr.h:1.56
--- src/sys/arch/xen/include/intr.h:1.55	Sat Apr 25 15:26:17 2020
+++ src/sys/arch/xen/include/intr.h	Thu May 14 19:36:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.55 2020/04/25 15:26:17 bouyer Exp $	*/
+/*	$NetBSD: intr.h,v 1.56 2020/05/14 19:36:02 jdolecek Exp $	*/
 /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
 
 /*-
@@ -71,7 +71,6 @@ int xen_intr_biglock_wrapper(void *);
 #endif
 
 #if defined(DOM0OPS) || NPCI > 0
-int xen_vec_alloc(int);
 int xen_pic_to_gsi(struct pic *, int);
 #endif /* defined(DOM0OPS) || NPCI > 0 */
 



CVS commit: src/sys/arch/xen/include

2020-05-14 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu May 14 19:36:03 UTC 2020

Modified Files:
src/sys/arch/xen/include: intr.h

Log Message:
xen_vec_alloc() is no more


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 18:25:12 UTC 2020

Modified Files:
src/sys/arch/xen/include: intrdefs.h

Log Message:
XEN_IPI_KICK was replaced by XEN_IPI_AST.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/include/intrdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/intrdefs.h
diff -u src/sys/arch/xen/include/intrdefs.h:1.15 src/sys/arch/xen/include/intrdefs.h:1.16
--- src/sys/arch/xen/include/intrdefs.h:1.15	Fri Apr  3 22:20:36 2020
+++ src/sys/arch/xen/include/intrdefs.h	Tue Apr 21 18:25:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.15 2020/04/03 22:20:36 ad Exp $ */
+/* $NetBSD: intrdefs.h,v 1.16 2020/04/21 18:25:11 ad Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -6,7 +6,6 @@
 #define _XEN_INTRDEFS_H_
 
 /* Xen IPI types */
-#define XEN_IPI_KICK		0x
 #define XEN_IPI_HALT		0x0001
 #define XEN_IPI_SYNCH_FPU	0x0002
 #define XEN_IPI_DDB		0x0004



CVS commit: src/sys/arch/xen/include

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 18:25:12 UTC 2020

Modified Files:
src/sys/arch/xen/include: intrdefs.h

Log Message:
XEN_IPI_KICK was replaced by XEN_IPI_AST.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/include/intrdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 14:51:07 UTC 2020

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
add blkif_x86_{32,64}_request_indirect types


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 14:51:07 UTC 2020

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
add blkif_x86_{32,64}_request_indirect types


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.4 src/sys/arch/xen/include/xenring.h:1.5
--- src/sys/arch/xen/include/xenring.h:1.4	Sun Apr  7 12:23:54 2019
+++ src/sys/arch/xen/include/xenring.h	Tue Apr 21 14:51:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.4 2019/04/07 12:23:54 bouyer Exp $ */
+/* $NetBSD: xenring.h,v 1.5 2020/04/21 14:51:06 jdolecek Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -51,6 +51,19 @@ struct blkif_x86_32_response {
 } __packed;
 typedef struct blkif_x86_32_response blkif_x86_32_response_t;
 
+struct blkif_x86_32_request_indirect {
+uint8_toperation;/* BLKIF_OP_INDIRECT*/
+uint8_tindirect_op;  /* BLKIF_OP_{READ/WRITE}*/
+uint16_t   nr_segments;  /* number of segments   */
+uint64_t   id;		 /* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint16_t	   _pad2;
+grant_ref_tindirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+uint64_t   _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_32_request_indirect blkif_x86_32_request_indirect_t;
+
 /* amd64-type requests/responses (always used in frontends ) */
 
 struct blkif_x86_64_request {
@@ -70,6 +83,25 @@ struct blkif_x86_64_response {
 };
 typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+struct blkif_x86_64_request_indirect {
+uint8_toperation;/* BLKIF_OP_INDIRECT*/
+uint8_tindirect_op;  /* BLKIF_OP_{READ/WRITE}*/
+uint16_t   nr_segments;  /* number of segments   */
+uint32_t   _pad1;
+uint64_t   id;   /* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint16_t	   _pad2;
+grant_ref_tindirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+uint32_t   _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_64_request_indirect blkif_x86_64_request_indirect_t;
+
+CTASSERT(sizeof(struct blkif_x86_32_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+CTASSERT(sizeof(struct blkif_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
 



CVS commit: src/sys/arch/xen/include

2019-04-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Apr  7 12:23:54 UTC 2019

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
blkif_x86_{32,64}_* are not identical to blkif_*, internal fields have
different alignements and this change their sizes. Copy them back from
their netbsd-8 definitions.
Fixes PR port-xen/54099


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-04-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Apr  7 12:23:54 UTC 2019

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
blkif_x86_{32,64}_* are not identical to blkif_*, internal fields have
different alignements and this change their sizes. Copy them back from
their netbsd-8 definitions.
Fixes PR port-xen/54099


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.3 src/sys/arch/xen/include/xenring.h:1.4
--- src/sys/arch/xen/include/xenring.h:1.3	Sat Feb  2 15:09:32 2019
+++ src/sys/arch/xen/include/xenring.h	Sun Apr  7 12:23:54 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.3 2019/02/02 15:09:32 cherry Exp $ */
+/* $NetBSD: xenring.h,v 1.4 2019/04/07 12:23:54 bouyer Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -32,14 +32,46 @@
  * Define ring types. These were previously part of the public API.
  * Not anymore.
  */
-DEFINE_RING_TYPES(blkif_x86_32, struct blkif_request, struct blkif_response);
-DEFINE_RING_TYPES(blkif_x86_64, struct blkif_request, struct blkif_response);
+/* i386 requests/responses */
+struct blkif_x86_32_request {
+uint8_toperation;/* BLKIF_OP_??? */
+uint8_tnr_segments;  /* number of segments   */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint64_t   id;   /* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+} __packed;
+typedef struct blkif_x86_32_request blkif_x86_32_request_t;
+
+struct blkif_x86_32_response {
+uint64_tid;  /* copied from request */
+uint8_t operation;   /* copied from request */
+uint8_t _pad;
+int16_t status;  /* BLKIF_RSP_???   */
+} __packed;
+typedef struct blkif_x86_32_response blkif_x86_32_response_t;
+
+/* amd64-type requests/responses (always used in frontends ) */
+
+struct blkif_x86_64_request {
+uint8_toperation;/* BLKIF_OP_??? */
+uint8_tnr_segments;  /* number of segments   */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint64_t __attribute__((__aligned__(8))) id;/* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+};
+typedef struct blkif_x86_64_request blkif_x86_64_request_t;
 
-typedef struct blkif_request blkif_x86_64_request_t;
-typedef struct blkif_response blkif_x86_64_response_t;
-typedef struct blkif_request blkif_x86_32_request_t;
-typedef struct blkif_response blkif_x86_32_response_t;
+struct blkif_x86_64_response {
+uint64_t __attribute__((__aligned__(8))) id; /* copied from request */
+uint8_t operation;   /* copied from request */
+int16_t status;  /* BLKIF_RSP_???   */
+};
+typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
+DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
 
 union blkif_back_ring_proto {
 	blkif_back_ring_t ring_n; /* native/common members */



CVS commit: src/sys/arch/xen/include

2019-02-10 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sun Feb 10 11:10:34 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
Catchup hypercall interfaces for HYPERVISOR_sched_op which use
arguments to __XEN_INTERFACE_VERSION__ >= 0x00030201

We've been using the sched_op_compat API with sched_op arguments.

fixes PR port-xen/53965


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.11 src/sys/arch/xen/include/amd64/hypercalls.h:1.12
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.11	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Sun Feb 10 11:10:34 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.11 2019/02/02 12:32:55 cherry Exp $ */
+/* $NetBSD: hypercalls.h,v 1.12 2019/02/10 11:10:34 cherry Exp $ */
 /**
  * hypercall.h
  * 
@@ -320,8 +320,18 @@ static inline int
 HYPERVISOR_suspend(
 	unsigned long srec)
 {
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+	struct sched_shutdown shutdown_reason = {
+		.reason = SHUTDOWN_suspend,
+	};
+
+	return _hypercall3(int, sched_op, SCHEDOP_shutdown,
+	_reason, srec);
+#else
 	return _hypercall3(int, sched_op, SCHEDOP_shutdown,
  SHUTDOWN_suspend, srec);
+#endif
 }
 
 static inline long
@@ -342,21 +352,51 @@ static inline long
 HYPERVISOR_shutdown(
 	void)
 {
-	return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_poweroff);
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+	struct sched_shutdown shutdown_reason = {
+		.reason = SHUTDOWN_poweroff,
+	};
+
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown,
+	_reason);
+#else
+-	return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_poweroff);
+#endif
 }
 
 static inline long
 HYPERVISOR_crash(
 	void)
 {
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+	struct sched_shutdown shutdown_reason = {
+		.reason = SHUTDOWN_crash,
+	};
+
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown,
+	_reason);
+#else
 	return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_crash);
+#endif
 }
 
 static inline long
 HYPERVISOR_reboot(
 	void)
 {
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+	struct sched_shutdown shutdown_reason = {
+		.reason = SHUTDOWN_reboot,
+	};
+
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown,
+	_reason);
+#else
 	return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_reboot);
+#endif
 }
 
 static inline int

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.18 src/sys/arch/xen/include/i386/hypercalls.h:1.19
--- src/sys/arch/xen/include/i386/hypercalls.h:1.18	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/include/i386/hypercalls.h	Sun Feb 10 11:10:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.18 2019/02/02 12:32:55 cherry Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.19 2019/02/10 11:10:34 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -368,9 +368,21 @@ HYPERVISOR_shutdown(void)
 long ret;
 unsigned long ign1, ign2;
 
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+struct sched_shutdown shutdown_reason = {
+	.reason = SHUTDOWN_poweroff
+};
+
 _hypercall(__HYPERVISOR_sched_op,
-	_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_poweroff)),
+	_harg("1" (SCHEDOP_shutdown), "2"  (_reason)),
 	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#else
+ _hypercall(__HYPERVISOR_sched_op,
+	_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_poweroff)),
+ 	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+
+#endif	
 
 return ret;
 }
@@ -381,9 +393,20 @@ HYPERVISOR_crash(void)
 long ret;
 unsigned long ign1, ign2;
 
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+struct sched_shutdown shutdown_reason = {
+	.reason = SHUTDOWN_crash
+};
+
+_hypercall(__HYPERVISOR_sched_op,
+	_harg("1" (SCHEDOP_shutdown), "2"  (_reason)),
+	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#else
 _hypercall(__HYPERVISOR_sched_op,
 	_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_crash)),
 	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#endif
 
 return ret;
 }
@@ -394,9 +417,20 @@ HYPERVISOR_reboot(void)
 long ret;
 unsigned long ign1, ign2;
 
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+
+struct sched_shutdown shutdown_reason = {
+	.reason = SHUTDOWN_reboot
+};
+
+_hypercall(__HYPERVISOR_sched_op,
+	_harg("1" (SCHEDOP_shutdown), "2"  (_reason)),
+	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#else
 _hypercall(__HYPERVISOR_sched_op,
 	_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_reboot)),
 	_harg("=a" 

CVS commit: src/sys/arch/xen/include

2019-02-10 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sun Feb 10 11:10:34 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
Catchup hypercall interfaces for HYPERVISOR_sched_op which use
arguments to __XEN_INTERFACE_VERSION__ >= 0x00030201

We've been using the sched_op_compat API with sched_op arguments.

fixes PR port-xen/53965


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 15:09:32 UTC 2019

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
Fix build. A multiline macro needs 'line continuation'.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.2 src/sys/arch/xen/include/xenring.h:1.3
--- src/sys/arch/xen/include/xenring.h:1.2	Sat Feb  2 14:50:15 2019
+++ src/sys/arch/xen/include/xenring.h	Sat Feb  2 15:09:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.2 2019/02/02 14:50:15 cherry Exp $ */
+/* $NetBSD: xenring.h,v 1.3 2019/02/02 15:09:32 cherry Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -10,7 +10,7 @@
 #ifndef _XEN_RING_H
 #define _XEN_RING_H
 
-#if (__XEN_INTERFACE_VERSION__ >= 0x00030201) &&
+#if (__XEN_INTERFACE_VERSION__ >= 0x00030201) && \
 	(__XEN_INTERFACE_VERSION < 0x00030208)
 
 #include 



CVS commit: src/sys/arch/xen/include

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 15:09:32 UTC 2019

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
Fix build. A multiline macro needs 'line continuation'.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 14:50:15 UTC 2019

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
Remove mb(), rmb() and wmb() from the kernel namespace.

These are introduced by external/bsd/common/include/asm/barrier.h

The purpose of barrier.h is to bridge the use of linux API calls
within code which uses them, such as drm code. The XEN api implicitly
uses these calls which are linuxisms within io/ring.h

This diff undos the damage.

The correct fix is to modify io/ring.h to not assume that all OSs that
XEN runs on has these functions, and to appropriately conditionally via
#ifdef __NetBSD__/#endif use the appropriate NetBSD functions. These
changes then need to be pushed upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 14:50:15 UTC 2019

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
Remove mb(), rmb() and wmb() from the kernel namespace.

These are introduced by external/bsd/common/include/asm/barrier.h

The purpose of barrier.h is to bridge the use of linux API calls
within code which uses them, such as drm code. The XEN api implicitly
uses these calls which are linuxisms within io/ring.h

This diff undos the damage.

The correct fix is to modify io/ring.h to not assume that all OSs that
XEN runs on has these functions, and to appropriately conditionally via
#ifdef __NetBSD__/#endif use the appropriate NetBSD functions. These
changes then need to be pushed upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/include/xenring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.47 src/sys/arch/xen/include/hypervisor.h:1.48
--- src/sys/arch/xen/include/hypervisor.h:1.47	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/include/hypervisor.h	Sat Feb  2 14:50:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.47 2019/02/02 12:32:55 cherry Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.48 2019/02/02 14:50:15 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -80,7 +80,7 @@ struct xen_npx_attach_args {
 #define	s32 int32_t
 #define	s64 int64_t
 
-#include  /* Linux mb() and friends */
+#include 
 
 #include 
 #include 
@@ -94,6 +94,18 @@ struct xen_npx_attach_args {
 #include 
 #include 
 
+/* Undo namespace damage from xen/include/public/io/ring.h
+ * The proper fix is to get upstream to stop assuming that all OSs use
+ * mb(), rmb(), wmb().
+ */
+#undef xen_mb
+#undef xen_rmb
+#undef xen_wmb
+
+#define xen_mb()  membar_sync()
+#define xen_rmb() membar_producer()
+#define xen_wmb() membar_consumer()
+
 #include 
 
 #undef u8

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.1 src/sys/arch/xen/include/xenring.h:1.2
--- src/sys/arch/xen/include/xenring.h:1.1	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/include/xenring.h	Sat Feb  2 14:50:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.1 2019/02/02 12:32:55 cherry Exp $ */
+/* $NetBSD: xenring.h,v 1.2 2019/02/02 14:50:15 cherry Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -10,10 +10,28 @@
 #ifndef _XEN_RING_H
 #define _XEN_RING_H
 
-#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+#if (__XEN_INTERFACE_VERSION__ >= 0x00030201) &&
+	(__XEN_INTERFACE_VERSION < 0x00030208)
 
 #include 
 
+/*
+ * Undo namespace damage from xen/include/public/io/ring.h
+ * The proper fix is to get upstream to stop assuming that all OSs use
+ * mb(), rmb(), wmb().
+ */
+#undef xen_mb
+#undef xen_rmb
+#undef xen_wmb
+
+#define xen_mb()  membar_sync()
+#define xen_rmb() membar_producer()
+#define xen_wmb() membar_consumer()
+
+/*
+ * Define ring types. These were previously part of the public API.
+ * Not anymore.
+ */
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_request, struct blkif_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_request, struct blkif_response);
 
@@ -30,5 +48,6 @@ union blkif_back_ring_proto {
 };
 typedef union blkif_back_ring_proto blkif_back_ring_proto_t;
 
-#endif /* __XEN_INTERFACE_VERSION__ >= 0x00030201 */
+#endif /* __XEN_INTERFACE_VERSION__ */
+
 #endif /* _XEN_RING_H_ */



CVS commit: src/sys/arch/xen/include/xen-public

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 12:40:32 UTC 2019

Removed Files:
src/sys/arch/xen/include/xen-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h
mem_event.h memory.h nmi.h physdev.h platform.h sched.h sysctl.h
tmem.h trace.h vcpu.h version.h xen-compat.h xen.h xencomm.h
xenoprof.h
src/sys/arch/xen/include/xen-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen-public/io: blkif.h console.h fbif.h fsif.h
kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h usbif.h
vscsiif.h xenbus.h xs_wire.h
src/sys/arch/xen/include/xen-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
Remove legacy XEN source public API from source.

These have now been moved to sys/external/mit/xen-include-public/dist


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/COPYING \
src/sys/arch/xen/include/xen-public/arch-ia64.h \
src/sys/arch/xen/include/xen-public/callback.h \
src/sys/arch/xen/include/xen-public/elfnote.h \
src/sys/arch/xen/include/xen-public/features.h \
src/sys/arch/xen/include/xen-public/kexec.h \
src/sys/arch/xen/include/xen-public/memory.h \
src/sys/arch/xen/include/xen-public/nmi.h \
src/sys/arch/xen/include/xen-public/platform.h \
src/sys/arch/xen/include/xen-public/sched.h \
src/sys/arch/xen/include/xen-public/vcpu.h \
src/sys/arch/xen/include/xen-public/version.h \
src/sys/arch/xen/include/xen-public/xen-compat.h \
src/sys/arch/xen/include/xen-public/xencomm.h \
src/sys/arch/xen/include/xen-public/xenoprof.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen-public/arch-x86_32.h \
src/sys/arch/xen/include/xen-public/arch-x86_64.h \
src/sys/arch/xen/include/xen-public/dom0_ops.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen-public/domctl.h \
src/sys/arch/xen/include/xen-public/elfstructs.h \
src/sys/arch/xen/include/xen-public/sysctl.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen-public/libelf.h \
src/sys/arch/xen/include/xen-public/mem_event.h \
src/sys/arch/xen/include/xen-public/tmem.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen-public/physdev.h
cvs rdiff -u -r1.11 -r0 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h \
src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h \
src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/hvm/e820.h \
src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen-public/hvm/params.h \
src/sys/arch/xen/include/xen-public/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen-public/hvm/vmx_assist.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen-public/io/blkif.h
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/io/console.h \
src/sys/arch/xen/include/xen-public/io/fbif.h \
src/sys/arch/xen/include/xen-public/io/fsif.h \
src/sys/arch/xen/include/xen-public/io/kbdif.h \
src/sys/arch/xen/include/xen-public/io/pciif.h \
src/sys/arch/xen/include/xen-public/io/protocols.h \
src/sys/arch/xen/include/xen-public/io/tpmif.h \
src/sys/arch/xen/include/xen-public/io/xenbus.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen-public/io/ring.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen-public/io/usbif.h \

CVS commit: src/sys/arch/xen/include/xen-public

2019-02-02 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Feb  2 12:40:32 UTC 2019

Removed Files:
src/sys/arch/xen/include/xen-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h
mem_event.h memory.h nmi.h physdev.h platform.h sched.h sysctl.h
tmem.h trace.h vcpu.h version.h xen-compat.h xen.h xencomm.h
xenoprof.h
src/sys/arch/xen/include/xen-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen-public/io: blkif.h console.h fbif.h fsif.h
kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h usbif.h
vscsiif.h xenbus.h xs_wire.h
src/sys/arch/xen/include/xen-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
Remove legacy XEN source public API from source.

These have now been moved to sys/external/mit/xen-include-public/dist


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/COPYING \
src/sys/arch/xen/include/xen-public/arch-ia64.h \
src/sys/arch/xen/include/xen-public/callback.h \
src/sys/arch/xen/include/xen-public/elfnote.h \
src/sys/arch/xen/include/xen-public/features.h \
src/sys/arch/xen/include/xen-public/kexec.h \
src/sys/arch/xen/include/xen-public/memory.h \
src/sys/arch/xen/include/xen-public/nmi.h \
src/sys/arch/xen/include/xen-public/platform.h \
src/sys/arch/xen/include/xen-public/sched.h \
src/sys/arch/xen/include/xen-public/vcpu.h \
src/sys/arch/xen/include/xen-public/version.h \
src/sys/arch/xen/include/xen-public/xen-compat.h \
src/sys/arch/xen/include/xen-public/xencomm.h \
src/sys/arch/xen/include/xen-public/xenoprof.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen-public/arch-x86_32.h \
src/sys/arch/xen/include/xen-public/arch-x86_64.h \
src/sys/arch/xen/include/xen-public/dom0_ops.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen-public/domctl.h \
src/sys/arch/xen/include/xen-public/elfstructs.h \
src/sys/arch/xen/include/xen-public/sysctl.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen-public/libelf.h \
src/sys/arch/xen/include/xen-public/mem_event.h \
src/sys/arch/xen/include/xen-public/tmem.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen-public/physdev.h
cvs rdiff -u -r1.11 -r0 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h \
src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h \
src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen-public/arch-x86/xen.h
cvs rdiff -u -r1.1.1.2 -r0 \
src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/hvm/e820.h \
src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen-public/hvm/params.h \
src/sys/arch/xen/include/xen-public/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen-public/hvm/vmx_assist.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen-public/io/blkif.h
cvs rdiff -u -r1.1.1.2 -r0 src/sys/arch/xen/include/xen-public/io/console.h \
src/sys/arch/xen/include/xen-public/io/fbif.h \
src/sys/arch/xen/include/xen-public/io/fsif.h \
src/sys/arch/xen/include/xen-public/io/kbdif.h \
src/sys/arch/xen/include/xen-public/io/pciif.h \
src/sys/arch/xen/include/xen-public/io/protocols.h \
src/sys/arch/xen/include/xen-public/io/tpmif.h \
src/sys/arch/xen/include/xen-public/io/xenbus.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen-public/io/ring.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen-public/io/usbif.h \

CVS commit: src/sys/arch/xen/include

2019-01-23 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Jan 24 04:16:16 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
The event_channel_op hypercall uses a newer API since
__XEN_INTERFACE_VERSION__  0x00030202

Since hvm_op only supports event_channel_op via the newer API, we
can't get away with our current event_channel_op_compat shim.

We thus introduce the new API to our internal hypercall C API
interface.

This change should have no effect on the PV kernels, since they will
continue to use the pre 0x00030202 API.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-01-23 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Jan 24 04:16:16 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
The event_channel_op hypercall uses a newer API since
__XEN_INTERFACE_VERSION__  0x00030202

Since hvm_op only supports event_channel_op via the newer API, we
can't get away with our current event_channel_op_compat shim.

We thus introduce the new API to our internal hypercall C API
interface.

This change should have no effect on the PV kernels, since they will
continue to use the pre 0x00030202 API.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.9 src/sys/arch/xen/include/amd64/hypercalls.h:1.10
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.9	Thu Jan 24 04:11:38 2019
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Thu Jan 24 04:16:16 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.9 2019/01/24 04:11:38 cherry Exp $ */
+/* $NetBSD: hypercalls.h,v 1.10 2019/01/24 04:16:16 cherry Exp $ */
 /**
  * hypercall.h
  * 
@@ -242,9 +242,14 @@ HYPERVISOR_update_va_mapping(
 }
 
 static inline int
-HYPERVISOR_event_channel_op(void *op)
+HYPERVISOR_event_channel_op(evtchn_op_t *op)
 {
+	KASSERT(op != NULL);
+#if __XEN_INTERFACE_VERSION__ < 0x00030202
 	return _hypercall1(int, event_channel_op, op);
+#else
+	return _hypercall2(int, event_channel_op, op->cmd, >u);
+#endif
 }
 
 static inline int

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.16 src/sys/arch/xen/include/i386/hypercalls.h:1.17
--- src/sys/arch/xen/include/i386/hypercalls.h:1.16	Thu Jul 26 17:20:08 2018
+++ src/sys/arch/xen/include/i386/hypercalls.h	Thu Jan 24 04:16:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.16 2018/07/26 17:20:08 maxv Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.17 2019/01/24 04:16:16 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -457,14 +457,20 @@ HYPERVISOR_multicall(void *call_list, in
 
 
 static __inline int
-HYPERVISOR_event_channel_op(void *op)
+HYPERVISOR_event_channel_op(evtchn_op_t *op)
 {
 int ret;
 unsigned long ign1;
 
+#if __XEN_INTERFACE_VERSION__ < 0x00030202
 _hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op)),
 	_harg("=a" (ret), "=b" (ign1)));
+#else
+unsigned long ign2;
 
+_hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op->cmd), "2" (>u)),
+	_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#endif
 return ret;
 }
 



CVS commit: src/sys/arch/xen/include/amd64

2019-01-23 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Jan 24 04:11:38 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h

Log Message:
hvm_op returns a signed value.

The pattern is that a hypercall which returns a value < 0 may imply an
error.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/amd64/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.8 src/sys/arch/xen/include/amd64/hypercalls.h:1.9
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.8	Wed Dec  7 16:01:39 2011
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Thu Jan 24 04:11:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.8 2011/12/07 16:01:39 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.9 2019/01/24 04:11:38 cherry Exp $ */
 /**
  * hypercall.h
  * 
@@ -361,11 +361,11 @@ HYPERVISOR_nmi_op(
 	return _hypercall2(int, nmi_op, op, arg);
 }
 
-static inline unsigned long
+static inline long
 HYPERVISOR_hvm_op(
 int op, void *arg)
 {
-return _hypercall2(unsigned long, hvm_op, op, arg);
+return _hypercall2(long, hvm_op, op, arg);
 }
 
 static inline int



CVS commit: src/sys/arch/xen/include/amd64

2019-01-23 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Jan 24 04:11:38 UTC 2019

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h

Log Message:
hvm_op returns a signed value.

The pattern is that a hypercall which returns a value < 0 may imply an
error.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/amd64/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2019-01-08 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jan  8 19:59:24 UTC 2019

Modified Files:
src/sys/arch/xen/include: xen_shm.h

Log Message:
remove explicit  include, code including this already includes



To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/include/xen_shm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen_shm.h
diff -u src/sys/arch/xen/include/xen_shm.h:1.9 src/sys/arch/xen/include/xen_shm.h:1.10
--- src/sys/arch/xen/include/xen_shm.h:1.9	Mon Oct 19 18:41:10 2009
+++ src/sys/arch/xen/include/xen_shm.h	Tue Jan  8 19:59:24 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: xen_shm.h,v 1.9 2009/10/19 18:41:10 bouyer Exp $  */
+/*  $NetBSD: xen_shm.h,v 1.10 2019/01/08 19:59:24 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -26,7 +26,6 @@
  */
 
 #include "opt_xen.h"
-#include 
 
 #define XENSHM_MAX_PAGES_PER_REQUEST (MAXPHYS >> PAGE_SHIFT)
 



CVS commit: src/sys/arch/xen/include

2019-01-08 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jan  8 19:59:24 UTC 2019

Modified Files:
src/sys/arch/xen/include: xen_shm.h

Log Message:
remove explicit  include, code including this already includes



To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/include/xen_shm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2018-10-09 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Oct 10 04:16:58 UTC 2018

Modified Files:
src/sys/arch/xen/include: xen.h

Log Message:
In  xen_atomic_test_and_clear_bit()

Use the appropriate sized variable for inline assembler.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/include/xen.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen.h
diff -u src/sys/arch/xen/include/xen.h:1.40 src/sys/arch/xen/include/xen.h:1.41
--- src/sys/arch/xen/include/xen.h:1.40	Sun Oct  7 11:25:55 2018
+++ src/sys/arch/xen/include/xen.h	Wed Oct 10 04:16:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen.h,v 1.40 2018/10/07 11:25:55 mlelstv Exp $	*/
+/*	$NetBSD: xen.h,v 1.41 2018/10/10 04:16:58 cherry Exp $	*/
 
 /*
  *
@@ -248,7 +248,7 @@ xen_atomic_clearbits_l (volatile XATOMIC
 static __inline XATOMIC_T
 xen_atomic_test_and_clear_bit(volatile void *ptr, unsigned long bitno)
 {
-	int result;
+	long result;
 
 	__asm volatile(__LOCK_PREFIX
 #ifdef __x86_64__



CVS commit: src/sys/arch/xen/include

2018-10-09 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Oct 10 04:16:58 UTC 2018

Modified Files:
src/sys/arch/xen/include: xen.h

Log Message:
In  xen_atomic_test_and_clear_bit()

Use the appropriate sized variable for inline assembler.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/include/xen.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2017-11-04 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Nov  4 09:31:08 UTC 2017

Modified Files:
src/sys/arch/xen/include: i82093var.h

Log Message:
protect header against recursive include


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/i82093var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/i82093var.h
diff -u src/sys/arch/xen/include/i82093var.h:1.4 src/sys/arch/xen/include/i82093var.h:1.5
--- src/sys/arch/xen/include/i82093var.h:1.4	Mon Mar 22 16:43:08 2010
+++ src/sys/arch/xen/include/i82093var.h	Sat Nov  4 09:31:08 2017
@@ -1,4 +1,7 @@
-/*	 $NetBSD: i82093var.h,v 1.4 2010/03/22 16:43:08 cegger Exp $ */
+/*	 $NetBSD: i82093var.h,v 1.5 2017/11/04 09:31:08 cherry Exp $ */
+
+#ifndef _XEN_I82093VAR_H_
+#define _XEN_I82093VAR_H_
 
 #include "opt_xen.h"
 #define _IOAPIC_CUSTOM_RW
@@ -36,3 +39,5 @@ ioapic_write_ul(struct ioapic_softc *sc,
 	if (ret)
 		printf("PHYSDEVOP_APIC_WRITE ret %d\n", ret);
 }
+
+#endif /* !_XEN_I82093VAR_H_ */



CVS commit: src/sys/arch/xen/include

2017-11-04 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Nov  4 09:31:08 UTC 2017

Modified Files:
src/sys/arch/xen/include: i82093var.h

Log Message:
protect header against recursive include


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/i82093var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2016-10-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 16 06:40:44 UTC 2016

Modified Files:
src/sys/arch/xen/include: intr.h

Log Message:
This should return the amd64 build to a working state (and hopefully
i386 as well) - but this is a hideous hack, and should be reverted
as soon as a better (which means any) alternative is available.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/include/intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2016-10-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 16 06:40:44 UTC 2016

Modified Files:
src/sys/arch/xen/include: intr.h

Log Message:
This should return the amd64 build to a working state (and hopefully
i386 as well) - but this is a hideous hack, and should be reverted
as soon as a better (which means any) alternative is available.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/include/intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/intr.h
diff -u src/sys/arch/xen/include/intr.h:1.37 src/sys/arch/xen/include/intr.h:1.38
--- src/sys/arch/xen/include/intr.h:1.37	Thu Jul  7 06:55:40 2016
+++ src/sys/arch/xen/include/intr.h	Sun Oct 16 06:40:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.37 2016/07/07 06:55:40 msaitoh Exp $	*/
+/*	$NetBSD: intr.h,v 1.38 2016/10/16 06:40:43 kre Exp $	*/
 /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
 
 /*-
@@ -185,6 +185,14 @@ void xen_broadcast_ipi(uint32_t);
 #define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */
 #endif /* MULTIPROCESSOR */
 
+/*
+ * XXX Hack: allow xen kernels to build with recent (Oct 2016) changes
+ *	 to acpi interrupt establishment (until a better solution)
+ */
+#define intr_establish_xname(a,b,c,d,e,f,g,h,i) intr_establish(a,b,c,d,e,f,g,h)
+#define isa_intr_establish_xname(a,b,c,d,e,f,g) isa_intr_establish(a,b,c,d,e,f)
+/* kcaH XXX */
+
 #endif /* !_LOCORE */
 
 #endif /* _XEN_INTR_H_ */



CVS commit: src/sys/arch/xen/include

2014-06-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jun 14 02:53:02 UTC 2014

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
Define a macro to check hypervisor version.  OK cherry@


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/include/hypervisor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.43 src/sys/arch/xen/include/hypervisor.h:1.44
--- src/sys/arch/xen/include/hypervisor.h:1.43	Sun Jan 13 21:01:05 2013
+++ src/sys/arch/xen/include/hypervisor.h	Sat Jun 14 02:53:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.43 2013/01/13 21:01:05 bouyer Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.44 2014/06/14 02:53:02 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -136,6 +136,15 @@ extern int xen_version;
 #define XEN_MAJOR(x) (((x)  0x)  16)
 #define XEN_MINOR(x) ((x)  0x)
 
+/*
+ * Does the hypervisor we're running on support an api
+ * call at the requested version number ?
+ */
+#define XEN_VERSION_SUPPORTED(major, minor)		\
+	(XEN_MAJOR(xen_version)  (major) ||		\
+	 (XEN_MAJOR(xen_version) == (major) 		\
+	  XEN_MINOR(xen_version) = (minor)))
+
 /* hypervisor_machdep.c */
 void hypervisor_send_event(struct cpu_info *, unsigned int);
 void hypervisor_unmask_event(unsigned int);



CVS commit: src/sys/arch/xen/include

2014-06-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jun 14 02:53:02 UTC 2014

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
Define a macro to check hypervisor version.  OK cherry@


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/include/hypervisor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen-public/arch-x86

2011-12-09 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Dec  9 10:14:20 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public/arch-x86: xen.h

Log Message:
re-apply merge loss


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen-public/arch-x86/xen.h
diff -u src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.1.1.2 src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.2
--- src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.1.1.2	Wed Dec  7 14:41:17 2011
+++ src/sys/arch/xen/include/xen-public/arch-x86/xen.h	Fri Dec  9 10:14:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xen.h,v 1.1.1.2 2011/12/07 14:41:17 cegger Exp $ */
+/* $NetBSD: xen.h,v 1.2 2011/12/09 10:14:20 cegger Exp $ */
 /**
  * arch-x86/xen.h
  * 
@@ -46,10 +46,14 @@
 #define __XEN_GUEST_HANDLE(name)__guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)  __XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
-#ifdef __XEN_TOOLS__
+
+#if __XEN_INTERFACE_VERSION__ = 0x00030201
+#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
+#else
+#define set_xen_guest_handle(hnd, val)  (hnd) = val
+#define get_xen_guest_handle(val, hnd)  val = (hnd)
 #endif
-#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__i386__)
 #include xen-x86_32.h



CVS commit: src/sys/arch/xen/include/xen-public/arch-x86

2011-12-09 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Dec  9 10:14:20 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public/arch-x86: xen.h

Log Message:
re-apply merge loss


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 14:41:19 UTC 2011

Update of /cvsroot/src/sys/arch/xen/include/xen-public
In directory ivanova.netbsd.org:/tmp/cvs-serv11047

Log Message:
Welcome to Xen 4.1.2 headers.

New interfaces for PV drivers:
- Xen transcedent memory
- USB IO
- SCSI IO

PCI IO improvements:
- PCI MSI support
- PCI Express AER support

New features:
- xen honors flags to be placed into guest kernel available pte bits
  if enabled (for grant table)
- support for 128 vcpus
  (old interface is still present and supports up to 32 vcpus)
- PCI passthrough: new hypercalls to support SR-IOV
- new hypercall for physical cpu hotplugging
- new hypercall for physical page offlining
- fixes to compile with clang
- machine check recovery mechanism

Status:

Vendor Tag: Xen
Release Tags:   xen-4_1_2

C src/sys/arch/xen/include/xen-public/grant_table.h
U src/sys/arch/xen/include/xen-public/xencomm.h
N src/sys/arch/xen/include/xen-public/tmem.h
C src/sys/arch/xen/include/xen-public/dom0_ops.h
U src/sys/arch/xen/include/xen-public/nmi.h
U src/sys/arch/xen/include/xen-public/kexec.h
U src/sys/arch/xen/include/xen-public/platform.h
U src/sys/arch/xen/include/xen-public/sysctl.h
C src/sys/arch/xen/include/xen-public/event_channel.h
U src/sys/arch/xen/include/xen-public/features.h
U src/sys/arch/xen/include/xen-public/COPYING
C src/sys/arch/xen/include/xen-public/physdev.h
U src/sys/arch/xen/include/xen-public/version.h
U src/sys/arch/xen/include/xen-public/elfnote.h
U src/sys/arch/xen/include/xen-public/callback.h
U src/sys/arch/xen/include/xen-public/memory.h
N src/sys/arch/xen/include/xen-public/mem_event.h
C src/sys/arch/xen/include/xen-public/trace.h
U src/sys/arch/xen/include/xen-public/xen-compat.h
U src/sys/arch/xen/include/xen-public/sched.h
U src/sys/arch/xen/include/xen-public/vcpu.h
C src/sys/arch/xen/include/xen-public/arch-x86_32.h
C src/sys/arch/xen/include/xen-public/arch-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-ia64.h
U src/sys/arch/xen/include/xen-public/xenoprof.h
C src/sys/arch/xen/include/xen-public/xen.h
U src/sys/arch/xen/include/xen-public/domctl.h
U src/sys/arch/xen/include/xen-public/xsm/flask_op.h
U src/sys/arch/xen/include/xen-public/xsm/acm.h
U src/sys/arch/xen/include/xen-public/xsm/acm_ops.h
U src/sys/arch/xen/include/xen-public/io/console.h
U src/sys/arch/xen/include/xen-public/io/tpmif.h
U src/sys/arch/xen/include/xen-public/io/ring.h
U src/sys/arch/xen/include/xen-public/io/protocols.h
U src/sys/arch/xen/include/xen-public/io/pciif.h
N src/sys/arch/xen/include/xen-public/io/usbif.h
U src/sys/arch/xen/include/xen-public/io/kbdif.h
U src/sys/arch/xen/include/xen-public/io/fbif.h
C src/sys/arch/xen/include/xen-public/io/blkif.h
U src/sys/arch/xen/include/xen-public/io/xenbus.h
N src/sys/arch/xen/include/xen-public/io/vscsiif.h
U src/sys/arch/xen/include/xen-public/io/fsif.h
U src/sys/arch/xen/include/xen-public/io/xs_wire.h
C src/sys/arch/xen/include/xen-public/io/netif.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h
U src/sys/arch/xen/include/xen-public/hvm/save.h
U src/sys/arch/xen/include/xen-public/hvm/params.h
U src/sys/arch/xen/include/xen-public/hvm/ioreq.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_op.h
U src/sys/arch/xen/include/xen-public/hvm/e820.h
U src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
U src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h
U src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h

10 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jXen:yesterday -jXen src/sys/arch/xen/include/xen-public



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:04:19 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public: event_channel.h grant_table.h
physdev.h trace.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86: xen-x86_32.h
src/sys/arch/xen/include/xen-public/io: blkif.h netif.h xs_wire.h

Log Message:
merge.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/physdev.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/io/blkif.h \
src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/sys/arch/xen/include/xen-public/io/xs_wire.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen-public/event_channel.h
diff -u src/sys/arch/xen/include/xen-public/event_channel.h:1.5 src/sys/arch/xen/include/xen-public/event_channel.h:1.6
--- src/sys/arch/xen/include/xen-public/event_channel.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/event_channel.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: event_channel.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: event_channel.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * event_channel.h
  * 
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
 
+#include xen.h
+
 /*
  * Prototype for this hypercall is:
  *  int event_channel_op(int cmd, void *args)
Index: src/sys/arch/xen/include/xen-public/grant_table.h
diff -u src/sys/arch/xen/include/xen-public/grant_table.h:1.5 src/sys/arch/xen/include/xen-public/grant_table.h:1.6
--- src/sys/arch/xen/include/xen-public/grant_table.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/grant_table.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: grant_table.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: grant_table.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * grant_table.h
  * 
@@ -29,6 +29,7 @@
 #ifndef __XEN_PUBLIC_GRANT_TABLE_H__
 #define __XEN_PUBLIC_GRANT_TABLE_H__
 
+#include xen.h
 
 /***
  * GRANT TABLE REPRESENTATION
@@ -85,12 +86,26 @@
  */
 
 /*
+ * Reference to a grant entry in a specified domain's grant table.
+ */
+typedef uint32_t grant_ref_t;
+
+/*
  * A grant table comprises a packed array of grant entries in one or more
  * page frames shared between Xen and a guest.
  * [XEN]: This field is written by Xen and read by the sharing guest.
  * [GST]: This field is written by the guest and read by Xen.
  */
-struct grant_entry {
+
+/*
+ * Version 1 of the grant table entry structure is maintained purely
+ * for backwards compatibility.  New guests should use version 2.
+ */
+#if __XEN_INTERFACE_VERSION__  0x0003020a
+#define grant_entry_v1 grant_entry
+#define grant_entry_v1_t grant_entry_t
+#endif
+struct grant_entry_v1 {
 /* GTF_xxx: various type and flag information.  [XEN,GST] */
 uint16_t flags;
 /* The domain being granted foreign privileges. [GST] */
@@ -101,7 +116,7 @@ struct grant_entry {
  */
 uint32_t frame;
 };
-typedef struct grant_entry grant_entry_t;
+typedef struct grant_entry_v1 grant_entry_v1_t;
 
 /*
  * Type of grant entry.
@@ -109,10 +124,13 @@ typedef struct grant_entry grant_entry_t
  *  GTF_permit_access: Allow @domid to map/access @frame.
  *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
  *   to this guest. Xen writes the page number to @frame.
+ *  GTF_transitive: Allow @domid to transitively access a subrange of
+ *  @trans_grant in @trans_domid.  No mappings are allowed.
  */
 #define GTF_invalid (0U0)
 #define GTF_permit_access   (1U0)
 #define GTF_accept_transfer (2U0)
+#define GTF_transitive  (3U0)
 #define GTF_type_mask   (3U0)
 
 /*
@@ -121,6 +139,9 @@ typedef struct grant_entry grant_entry_t
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
+ *will only be allowed to copy from the grant, and not
+ *map it. [GST]
  */
 #define _GTF_readonly   (2)
 #define GTF_readonly(1U_GTF_readonly)
@@ -134,6 

CVS commit: src/sys/arch/xen/include

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:01:39 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.7 src/sys/arch/xen/include/amd64/hypercalls.h:1.8
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.7	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.7 2011/12/07 15:47:42 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.8 2011/12/07 16:01:39 cegger Exp $ */
 /**
  * hypercall.h
  * 
@@ -399,7 +399,7 @@ HYPERVISOR_dom0_op(
 }
 #endif	/* __XEN_INTERFACE_VERSION__ */
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.13 src/sys/arch/xen/include/i386/hypercalls.h:1.14
--- src/sys/arch/xen/include/i386/hypercalls.h:1.13	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.13 2011/12/07 15:47:42 cegger Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.14 2011/12/07 16:01:39 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -173,7 +173,7 @@ HYPERVISOR_get_debugreg(int reg)
 return ret;
 }
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static __inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)



CVS commit: src/sys/arch/xen/include/xen3-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:11:02 UTC 2011

Removed Files:
src/sys/arch/xen/include/xen3-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h memory.h
nmi.h physdev.h platform.h sched.h sysctl.h trace.h vcpu.h
version.h xen-compat.h xen.h xencomm.h xenoprof.h
src/sys/arch/xen/include/xen3-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen3-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen3-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen3-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen3-public/io: blkif.h console.h fbif.h
fsif.h kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h xenbus.h
xs_wire.h
src/sys/arch/xen/include/xen3-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
remove xen3-public


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/COPYING \
src/sys/arch/xen/include/xen3-public/callback.h \
src/sys/arch/xen/include/xen3-public/elfstructs.h \
src/sys/arch/xen/include/xen3-public/nmi.h \
src/sys/arch/xen/include/xen3-public/xenoprof.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/arch-ia64.h \
src/sys/arch/xen/include/xen3-public/physdev.h \
src/sys/arch/xen/include/xen3-public/trace.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_32.h \
src/sys/arch/xen/include/xen3-public/memory.h \
src/sys/arch/xen/include/xen3-public/sched.h \
src/sys/arch/xen/include/xen3-public/vcpu.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_64.h \
src/sys/arch/xen/include/xen3-public/dom0_ops.h \
src/sys/arch/xen/include/xen3-public/event_channel.h \
src/sys/arch/xen/include/xen3-public/version.h \
src/sys/arch/xen/include/xen3-public/xen-compat.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/domctl.h \
src/sys/arch/xen/include/xen3-public/features.h \
src/sys/arch/xen/include/xen3-public/kexec.h \
src/sys/arch/xen/include/xen3-public/libelf.h \
src/sys/arch/xen/include/xen3-public/platform.h \
src/sys/arch/xen/include/xen3-public/sysctl.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/elfnote.h \
src/sys/arch/xen/include/xen3-public/xencomm.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/xen/include/xen3-public/grant_table.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/xen.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/debug_op.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/memmap.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-mca.h
cvs rdiff -u -r1.4 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_64.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen.h
cvs rdiff -u -r1.2 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/hvm/e820.h \
src/sys/arch/xen/include/xen3-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen3-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen3-public/hvm/params.h \
src/sys/arch/xen/include/xen3-public/hvm/vmx_assist.h
cvs rdiff -u -r1.3 -r0 \
src/sys/arch/xen/include/xen3-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen3-public/hvm/save.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/io/blkif.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/io/console.h \
src/sys/arch/xen/include/xen3-public/io/kbdif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/io/fbif.h \
src/sys/arch/xen/include/xen3-public/io/protocols.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen3-public/io/fsif.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/io/netif.h \
src/sys/arch/xen/include/xen3-public/io/xenbus.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/io/pciif.h \
src/sys/arch/xen/include/xen3-public/io/tpmif.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/xen/include/xen3-public/io/ring.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/io/xs_wire.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/xsm/acm.h \

CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 13:15:47 UTC 2011

Update of /cvsroot/src/sys/arch/xen/include/xen-public
In directory ivanova.netbsd.org:/tmp/cvs-serv3955

Log Message:
re-import xen3-public to rename this to xen-public

Status:

Vendor Tag: Xen
Release Tags:   xen-3_3_0

N src/sys/arch/xen/include/xen-public/COPYING
N src/sys/arch/xen/include/xen-public/arch-ia64.h
C src/sys/arch/xen/include/xen-public/arch-x86_32.h
C src/sys/arch/xen/include/xen-public/arch-x86_64.h
N src/sys/arch/xen/include/xen-public/callback.h
C src/sys/arch/xen/include/xen-public/dom0_ops.h
N src/sys/arch/xen/include/xen-public/domctl.h
N src/sys/arch/xen/include/xen-public/elfnote.h
N src/sys/arch/xen/include/xen-public/elfstructs.h
C src/sys/arch/xen/include/xen-public/event_channel.h
N src/sys/arch/xen/include/xen-public/features.h
C src/sys/arch/xen/include/xen-public/grant_table.h
N src/sys/arch/xen/include/xen-public/kexec.h
N src/sys/arch/xen/include/xen-public/libelf.h
N src/sys/arch/xen/include/xen-public/memory.h
N src/sys/arch/xen/include/xen-public/nmi.h
C src/sys/arch/xen/include/xen-public/physdev.h
N src/sys/arch/xen/include/xen-public/platform.h
N src/sys/arch/xen/include/xen-public/sched.h
N src/sys/arch/xen/include/xen-public/sysctl.h
C src/sys/arch/xen/include/xen-public/trace.h
N src/sys/arch/xen/include/xen-public/vcpu.h
C src/sys/arch/xen/include/xen-public/xen.h
N src/sys/arch/xen/include/xen-public/version.h
N src/sys/arch/xen/include/xen-public/xen-compat.h
N src/sys/arch/xen/include/xen-public/xencomm.h
N src/sys/arch/xen/include/xen-public/xenoprof.h
N src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h
N src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
N src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h
N src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
N src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h
N src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h
N src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
N src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
N src/sys/arch/xen/include/xen-public/arch-x86/xen.h
N src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h
N src/sys/arch/xen/include/xen-public/hvm/hvm_op.h
N src/sys/arch/xen/include/xen-public/hvm/e820.h
N src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h
N src/sys/arch/xen/include/xen-public/hvm/ioreq.h
N src/sys/arch/xen/include/xen-public/hvm/params.h
N src/sys/arch/xen/include/xen-public/hvm/save.h
N src/sys/arch/xen/include/xen-public/hvm/vmx_assist.h
C src/sys/arch/xen/include/xen-public/io/blkif.h
N src/sys/arch/xen/include/xen-public/io/console.h
N src/sys/arch/xen/include/xen-public/io/fbif.h
N src/sys/arch/xen/include/xen-public/io/fsif.h
N src/sys/arch/xen/include/xen-public/io/kbdif.h
C src/sys/arch/xen/include/xen-public/io/netif.h
N src/sys/arch/xen/include/xen-public/io/pciif.h
N src/sys/arch/xen/include/xen-public/io/protocols.h
N src/sys/arch/xen/include/xen-public/io/ring.h
N src/sys/arch/xen/include/xen-public/io/tpmif.h
N src/sys/arch/xen/include/xen-public/io/xenbus.h
N src/sys/arch/xen/include/xen-public/io/xs_wire.h
N src/sys/arch/xen/include/xen-public/xsm/acm_ops.h
N src/sys/arch/xen/include/xen-public/xsm/acm.h
N src/sys/arch/xen/include/xen-public/xsm/flask_op.h

10 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jXen:yesterday -jXen src/sys/arch/xen/include/xen-public



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 13:24:04 UTC 2011

Added Files:
src/sys/arch/xen/include/xen-public: arch-x86_32.h arch-x86_64.h
dom0_ops.h event_channel.h grant_table.h physdev.h trace.h xen.h
src/sys/arch/xen/include/xen-public/io: blkif.h netif.h

Log Message:
merge. The 'conflicts' happened because xen-public was once used for xen2 
headers.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.5 src/sys/arch/xen/include/xen-public/arch-x86_32.h \
src/sys/arch/xen/include/xen-public/arch-x86_64.h \
src/sys/arch/xen/include/xen-public/dom0_ops.h \
src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/physdev.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r0 -r1.10 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r0 -r1.5 src/sys/arch/xen/include/xen-public/io/blkif.h \
src/sys/arch/xen/include/xen-public/io/netif.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 14:41:19 UTC 2011

Update of /cvsroot/src/sys/arch/xen/include/xen-public
In directory ivanova.netbsd.org:/tmp/cvs-serv11047

Log Message:
Welcome to Xen 4.1.2 headers.

New interfaces for PV drivers:
- Xen transcedent memory
- USB IO
- SCSI IO

PCI IO improvements:
- PCI MSI support
- PCI Express AER support

New features:
- xen honors flags to be placed into guest kernel available pte bits
  if enabled (for grant table)
- support for 128 vcpus
  (old interface is still present and supports up to 32 vcpus)
- PCI passthrough: new hypercalls to support SR-IOV
- new hypercall for physical cpu hotplugging
- new hypercall for physical page offlining
- fixes to compile with clang
- machine check recovery mechanism

Status:

Vendor Tag: Xen
Release Tags:   xen-4_1_2

C src/sys/arch/xen/include/xen-public/grant_table.h
U src/sys/arch/xen/include/xen-public/xencomm.h
N src/sys/arch/xen/include/xen-public/tmem.h
C src/sys/arch/xen/include/xen-public/dom0_ops.h
U src/sys/arch/xen/include/xen-public/nmi.h
U src/sys/arch/xen/include/xen-public/kexec.h
U src/sys/arch/xen/include/xen-public/platform.h
U src/sys/arch/xen/include/xen-public/sysctl.h
C src/sys/arch/xen/include/xen-public/event_channel.h
U src/sys/arch/xen/include/xen-public/features.h
U src/sys/arch/xen/include/xen-public/COPYING
C src/sys/arch/xen/include/xen-public/physdev.h
U src/sys/arch/xen/include/xen-public/version.h
U src/sys/arch/xen/include/xen-public/elfnote.h
U src/sys/arch/xen/include/xen-public/callback.h
U src/sys/arch/xen/include/xen-public/memory.h
N src/sys/arch/xen/include/xen-public/mem_event.h
C src/sys/arch/xen/include/xen-public/trace.h
U src/sys/arch/xen/include/xen-public/xen-compat.h
U src/sys/arch/xen/include/xen-public/sched.h
U src/sys/arch/xen/include/xen-public/vcpu.h
C src/sys/arch/xen/include/xen-public/arch-x86_32.h
C src/sys/arch/xen/include/xen-public/arch-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-ia64.h
U src/sys/arch/xen/include/xen-public/xenoprof.h
C src/sys/arch/xen/include/xen-public/xen.h
U src/sys/arch/xen/include/xen-public/domctl.h
U src/sys/arch/xen/include/xen-public/xsm/flask_op.h
U src/sys/arch/xen/include/xen-public/xsm/acm.h
U src/sys/arch/xen/include/xen-public/xsm/acm_ops.h
U src/sys/arch/xen/include/xen-public/io/console.h
U src/sys/arch/xen/include/xen-public/io/tpmif.h
U src/sys/arch/xen/include/xen-public/io/ring.h
U src/sys/arch/xen/include/xen-public/io/protocols.h
U src/sys/arch/xen/include/xen-public/io/pciif.h
N src/sys/arch/xen/include/xen-public/io/usbif.h
U src/sys/arch/xen/include/xen-public/io/kbdif.h
U src/sys/arch/xen/include/xen-public/io/fbif.h
C src/sys/arch/xen/include/xen-public/io/blkif.h
U src/sys/arch/xen/include/xen-public/io/xenbus.h
N src/sys/arch/xen/include/xen-public/io/vscsiif.h
U src/sys/arch/xen/include/xen-public/io/fsif.h
U src/sys/arch/xen/include/xen-public/io/xs_wire.h
C src/sys/arch/xen/include/xen-public/io/netif.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h
U src/sys/arch/xen/include/xen-public/hvm/save.h
U src/sys/arch/xen/include/xen-public/hvm/params.h
U src/sys/arch/xen/include/xen-public/hvm/ioreq.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_op.h
U src/sys/arch/xen/include/xen-public/hvm/e820.h
U src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
U src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h
U src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h

10 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jXen:yesterday -jXen src/sys/arch/xen/include/xen-public



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:04:19 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public: event_channel.h grant_table.h
physdev.h trace.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86: xen-x86_32.h
src/sys/arch/xen/include/xen-public/io: blkif.h netif.h xs_wire.h

Log Message:
merge.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/physdev.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/io/blkif.h \
src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/sys/arch/xen/include/xen-public/io/xs_wire.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen-public/io

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:40:15 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public/io: ring.h

Log Message:
merge. (forgot in previous)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/sys/arch/xen/include/xen-public/io/ring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:01:39 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen3-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:11:02 UTC 2011

Removed Files:
src/sys/arch/xen/include/xen3-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h memory.h
nmi.h physdev.h platform.h sched.h sysctl.h trace.h vcpu.h
version.h xen-compat.h xen.h xencomm.h xenoprof.h
src/sys/arch/xen/include/xen3-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen3-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen3-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen3-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen3-public/io: blkif.h console.h fbif.h
fsif.h kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h xenbus.h
xs_wire.h
src/sys/arch/xen/include/xen3-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
remove xen3-public


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/COPYING \
src/sys/arch/xen/include/xen3-public/callback.h \
src/sys/arch/xen/include/xen3-public/elfstructs.h \
src/sys/arch/xen/include/xen3-public/nmi.h \
src/sys/arch/xen/include/xen3-public/xenoprof.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/arch-ia64.h \
src/sys/arch/xen/include/xen3-public/physdev.h \
src/sys/arch/xen/include/xen3-public/trace.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_32.h \
src/sys/arch/xen/include/xen3-public/memory.h \
src/sys/arch/xen/include/xen3-public/sched.h \
src/sys/arch/xen/include/xen3-public/vcpu.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_64.h \
src/sys/arch/xen/include/xen3-public/dom0_ops.h \
src/sys/arch/xen/include/xen3-public/event_channel.h \
src/sys/arch/xen/include/xen3-public/version.h \
src/sys/arch/xen/include/xen3-public/xen-compat.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/domctl.h \
src/sys/arch/xen/include/xen3-public/features.h \
src/sys/arch/xen/include/xen3-public/kexec.h \
src/sys/arch/xen/include/xen3-public/libelf.h \
src/sys/arch/xen/include/xen3-public/platform.h \
src/sys/arch/xen/include/xen3-public/sysctl.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/elfnote.h \
src/sys/arch/xen/include/xen3-public/xencomm.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/xen/include/xen3-public/grant_table.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/xen.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/debug_op.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/memmap.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-mca.h
cvs rdiff -u -r1.4 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_64.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen.h
cvs rdiff -u -r1.2 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/hvm/e820.h \
src/sys/arch/xen/include/xen3-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen3-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen3-public/hvm/params.h \
src/sys/arch/xen/include/xen3-public/hvm/vmx_assist.h
cvs rdiff -u -r1.3 -r0 \
src/sys/arch/xen/include/xen3-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen3-public/hvm/save.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/io/blkif.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/io/console.h \
src/sys/arch/xen/include/xen3-public/io/kbdif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/io/fbif.h \
src/sys/arch/xen/include/xen3-public/io/protocols.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen3-public/io/fsif.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/io/netif.h \
src/sys/arch/xen/include/xen3-public/io/xenbus.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/io/pciif.h \
src/sys/arch/xen/include/xen3-public/io/tpmif.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/xen/include/xen3-public/io/ring.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/io/xs_wire.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/xsm/acm.h \

CVS commit: src/sys/arch/xen/include

2011-08-10 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Aug 10 06:29:23 UTC 2011

Added Files:
src/sys/arch/xen/include: intrdefs.h

Log Message:
Add Xen specific ipi bitmasks


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.10 src/sys/arch/xen/include/intrdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/xen/include/intrdefs.h
diff -u /dev/null src/sys/arch/xen/include/intrdefs.h:1.10
--- /dev/null	Wed Aug 10 06:29:23 2011
+++ src/sys/arch/xen/include/intrdefs.h	Wed Aug 10 06:29:23 2011
@@ -0,0 +1,17 @@
+/* $NetBSD: intrdefs.h,v 1.10 2011/08/10 06:29:23 cherry Exp $ */
+
+/* This file co-exists, and is included via machine/intrdefs.h */
+
+#ifndef _XEN_INTRDEFS_H_
+#define _XEN_INTRDEFS_H_
+
+/* Xen IPI types */
+#define XEN_IPI_KICK		0x
+#define XEN_IPI_HALT		0x0001
+#define XEN_IPI_SYNCH_FPU	0x0002
+#define XEN_IPI_DDB		0x0004
+#define XEN_IPI_XCALL		0x0008
+
+#define XEN_NIPIS 4 /* IPI_KICK doesn't have a handler */
+
+#endif /* _XEN_INTRDEFS_H_ */



CVS commit: src/sys/arch/xen/include

2011-08-10 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Aug 10 06:29:23 UTC 2011

Added Files:
src/sys/arch/xen/include: intrdefs.h

Log Message:
Add Xen specific ipi bitmasks


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.10 src/sys/arch/xen/include/intrdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include/xen3-public/io

2011-07-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul 27 23:10:41 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen3-public/io: ring.h

Log Message:
Make this use offsetof and __typeof__ to appease gcc4.5


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/xen3-public/io/ring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen3-public/io/ring.h
diff -u src/sys/arch/xen/include/xen3-public/io/ring.h:1.11 src/sys/arch/xen/include/xen3-public/io/ring.h:1.12
--- src/sys/arch/xen/include/xen3-public/io/ring.h:1.11	Fri Aug 22 15:28:11 2008
+++ src/sys/arch/xen/include/xen3-public/io/ring.h	Wed Jul 27 23:10:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ring.h,v 1.11 2008/08/22 15:28:11 cegger Exp $ */
+/* $NetBSD: ring.h,v 1.12 2011/07/27 23:10:40 matt Exp $ */
 /**
  * ring.h
  * 
@@ -60,7 +60,7 @@
  * power of two (so we can mask with (size-1) to loop around).
  */
 #define __RING_SIZE(_s, _sz) \
-(__RD32(((_sz) - (long)(_s)-ring + (long)(_s)) / sizeof((_s)-ring[0])))
+(__RD32(((_sz) - offsetof(__typeof__(*(_s)), ring)) / sizeof((_s)-ring[0])))
 
 /*
  * Macros to make the correct C datatypes for a new kind of ring.



CVS commit: src/sys/arch/xen/include/xen3-public/io

2011-07-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul 27 23:10:41 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen3-public/io: ring.h

Log Message:
Make this use offsetof and __typeof__ to appease gcc4.5


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/xen3-public/io/ring.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2011-04-29 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Apr 29 22:45:41 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenpmap.h

Log Message:
Apply DRY: xpmap_{mtop,ptom}() can reuse xpmap_{mtop,ptom}_masked() for
the frame number lookup.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/include/xenpmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.26 src/sys/arch/xen/include/xenpmap.h:1.27
--- src/sys/arch/xen/include/xenpmap.h:1.26	Sun Apr 17 09:50:33 2011
+++ src/sys/arch/xen/include/xenpmap.h	Fri Apr 29 22:45:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.26 2011/04/17 09:50:33 mrg Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.27 2011/04/29 22:45:41 jym Exp $	*/
 
 /*
  *
@@ -76,14 +76,6 @@
 #define pfn_to_mfn(pfn) (xpmap_phys_to_machine_mapping[(pfn)])
 
 static __inline paddr_t
-xpmap_mtop(paddr_t mpa)
-{
-	return (
-	((paddr_t)machine_to_phys_mapping[mpa  PAGE_SHIFT]  PAGE_SHIFT)
-	+ XPMAP_OFFSET) | (mpa  ~PG_FRAME);
-}
-
-static __inline paddr_t
 xpmap_mtop_masked(paddr_t mpa)
 {
 	return (
@@ -92,11 +84,9 @@
 }
 
 static __inline paddr_t
-xpmap_ptom(paddr_t ppa)
+xpmap_mtop(paddr_t mpa)
 {
-	return (((paddr_t)xpmap_phys_to_machine_mapping[(ppa -
-	XPMAP_OFFSET)  PAGE_SHIFT])  PAGE_SHIFT)
-		| (ppa  ~PG_FRAME);
+	return (xpmap_mtop_masked(mpa) | (mpa  ~PG_FRAME));
 }
 
 static __inline paddr_t
@@ -106,6 +96,12 @@
 	XPMAP_OFFSET)  PAGE_SHIFT])  PAGE_SHIFT);
 }
 
+static __inline paddr_t
+xpmap_ptom(paddr_t ppa)
+{
+	return (xpmap_ptom_masked(ppa) | (ppa  ~PG_FRAME));
+}
+
 static inline void
 MULTI_update_va_mapping(
 	multicall_entry_t *mcl, vaddr_t va,



CVS commit: src/sys/arch/xen/include

2011-04-29 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Apr 29 22:45:41 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenpmap.h

Log Message:
Apply DRY: xpmap_{mtop,ptom}() can reuse xpmap_{mtop,ptom}_masked() for
the frame number lookup.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/include/xenpmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 09:50:33 UTC 2011

Modified Files:
src/sys/arch/xen/include: xen.h xenpmap.h

Log Message:
apply some _KERNEL_OPT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/include/xenpmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xen.h
diff -u src/sys/arch/xen/include/xen.h:1.32 src/sys/arch/xen/include/xen.h:1.33
--- src/sys/arch/xen/include/xen.h:1.32	Wed Jul 29 12:02:06 2009
+++ src/sys/arch/xen/include/xen.h	Sun Apr 17 09:50:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen.h,v 1.32 2009/07/29 12:02:06 cegger Exp $	*/
+/*	$NetBSD: xen.h,v 1.33 2011/04/17 09:50:33 mrg Exp $	*/
 
 /*
  *
@@ -27,7 +27,10 @@
 
 #ifndef _XEN_H
 #define _XEN_H
+
+#ifdef _KERNEL_OPT
 #include opt_xen.h
+#endif
 
 
 #ifndef _LOCORE

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.25 src/sys/arch/xen/include/xenpmap.h:1.26
--- src/sys/arch/xen/include/xenpmap.h:1.25	Thu Feb 10 00:23:14 2011
+++ src/sys/arch/xen/include/xenpmap.h	Sun Apr 17 09:50:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.25 2011/02/10 00:23:14 jym Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.26 2011/04/17 09:50:33 mrg Exp $	*/
 
 /*
  *
@@ -29,7 +29,10 @@
 
 #ifndef _XEN_XENPMAP_H_
 #define _XEN_XENPMAP_H_
+
+#ifdef _KERNEL_OPT
 #include opt_xen.h
+#endif
 
 #define	INVALID_P2M_ENTRY	(~0UL)
 



CVS commit: src/sys/arch/xen/include

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 09:50:33 UTC 2011

Modified Files:
src/sys/arch/xen/include: xen.h xenpmap.h

Log Message:
apply some _KERNEL_OPT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/include/xenpmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 22:57:24 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
Add the HYPERVISOR_sysctl() hypercall.

Although the hypercall arguments (like struct sysctl_readconsole) are not
compatible between different XEN_SYSCTL_INTERFACE_VERSIONs (one of the
reasons why the sysctl calls should only be used by xentools directly),
it's still practical to have when one wants to query Xen's dmesg from
ddb(4) in case of a panic.

Note: additional code is needed for readconsole() functionality, but adding
the hypercall should not cause any harm.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/i386/hypercalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.5 src/sys/arch/xen/include/amd64/hypercalls.h:1.6
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.5	Thu Nov 13 01:45:48 2008
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.5 2008/11/13 01:45:48 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.6 2011/03/30 22:57:24 jym Exp $ */
 /**
  * hypercall.h
  * 
@@ -406,4 +406,10 @@
 	return _hypercall1(int, mca, mc);
 }
 
+static inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+	return _hypercall1(int, sysctl, sysctl);
+}
+
 #endif /* __HYPERCALL_H__ */

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.10 src/sys/arch/xen/include/i386/hypercalls.h:1.11
--- src/sys/arch/xen/include/i386/hypercalls.h:1.10	Mon Oct 19 18:41:11 2009
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.10 2009/10/19 18:41:11 bouyer Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.11 2011/03/30 22:57:24 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -534,4 +534,16 @@
 
 return ret;
 }
+
+static __inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+int ret;
+unsigned long ign1;
+
+_hypercall(__HYPERVISOR_sysctl, _harg(1 (sysctl)),
+	_harg(=a (ret), =b (ign1)));
+
+return ret;
+}
 #endif /* _XENI386_HYPERVISOR_H_ */



CVS commit: src/sys/arch/xen/include

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 11:13:03 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
fix typo in ioctl definition


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/xenio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.8 src/sys/arch/xen/include/xenio.h:1.9
--- src/sys/arch/xen/include/xenio.h:1.8	Wed Dec 15 14:45:47 2010
+++ src/sys/arch/xen/include/xenio.h	Mon Jan 10 11:13:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.8 2010/12/15 14:45:47 cegger Exp $	*/
+/*	$NetBSD: xenio.h,v 1.9 2011/01/10 11:13:03 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -112,7 +112,7 @@
 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
 _IOR('P', 5, int)
 #define IOCTL_PRIVCMD_MMAPBATCH_V2  \
-_IOW('P, 6, privcmd_mmapbatch_v2_t)
+_IOW('P', 6, privcmd_mmapbatch_v2_t)
 
 /* Interface to /dev/xenevt */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */



CVS commit: src/sys/arch/xen/include

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 11:13:03 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
fix typo in ioctl definition


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/xenio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 14:28:22 UTC 2010

Added Files:
src/sys/arch/xen/include: xenio_gntdev.h

Log Message:
add gnttab ioctl definitions to implement


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/xen/include/xenio_gntdev.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/xen/include/xenio_gntdev.h
diff -u /dev/null src/sys/arch/xen/include/xenio_gntdev.h:1.1
--- /dev/null	Wed Dec 15 14:28:22 2010
+++ src/sys/arch/xen/include/xenio_gntdev.h	Wed Dec 15 14:28:22 2010
@@ -0,0 +1,119 @@
+/**
+ * gntdev.h
+ * 
+ * Interface to /dev/xen/gntdev.
+ * 
+ * Copyright (c) 2007, D G Murray
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the Software), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_GNTDEV_H__
+#define __XEN_GNTDEV_H__
+
+struct ioctl_gntdev_grant_ref {
+	/* The domain ID of the grant to be mapped. */
+	uint32_t domid;
+	/* The grant reference of the grant to be mapped. */
+	uint32_t ref;
+};
+
+/*
+ * Inserts the grant references into the mapping table of an instance
+ * of gntdev. N.B. This does not perform the mapping, which is deferred
+ * until mmap() is called with @index as the offset.
+ */
+#define IOCTL_GNTDEV_MAP_GRANT_REF\
+	_IOWR('G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
+struct ioctl_gntdev_map_grant_ref {
+	/* IN parameters */
+	/* The number of grants to be mapped. */
+	uint32_t count;
+	uint32_t pad;
+	/* OUT parameters */
+	/* The offset to be used on a subsequent call to mmap(). */
+	uint64_t index;
+	/* Variable IN parameter. */
+	/* Array of grant references, of size @count. */
+	struct ioctl_gntdev_grant_ref refs[1];
+};
+
+/*
+ * Removes the grant references from the mapping table of an instance of
+ * of gntdev. N.B. munmap() must be called on the relevant virtual address(es)
+ * before this ioctl is called, or an error will result.
+ */
+#define IOCTL_GNTDEV_UNMAP_GRANT_REF\
+	_IOW('G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))   
+struct ioctl_gntdev_unmap_grant_ref {
+	/* IN parameters */
+	/* The offset was returned by the corresponding map operation. */
+	uint64_t index;
+	/* The number of pages to be unmapped. */
+	uint32_t count;
+	uint32_t pad;
+};
+
+/*
+ * Returns the offset in the driver's address space that corresponds
+ * to @vaddr. This can be used to perform a munmap(), followed by an
+ * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
+ * the caller. The number of pages that were allocated at the same time as
+ * @vaddr is returned in @count.
+ *
+ * N.B. Where more than one page has been mapped into a contiguous range, the
+ *  supplied @vaddr must correspond to the start of the range; otherwise
+ *  an error will result. It is only possible to munmap() the entire
+ *  contiguously-allocated range at once, and not any subrange thereof.
+ */
+#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR			\
+	_IOWR('G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
+struct ioctl_gntdev_get_offset_for_vaddr {
+	/* IN parameters */
+	/* The virtual address of the first mapped page in a range. */
+	uint64_t vaddr;
+	/* OUT parameters */
+	/* The offset that was used in the initial mmap() operation. */
+	uint64_t offset;
+	/* The number of pages mapped in the VM area that begins at @vaddr. */
+	uint32_t count;
+	uint32_t pad;
+};
+
+/*
+ * Sets the maximum number of grants that may mapped at once by this gntdev
+ * instance.
+ *
+ * N.B. This must be called before any other ioctl is 

CVS commit: src/sys/arch/xen/include

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 14:45:47 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
add privcmd ioctl that got introduced with Xen 4


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/xenio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.7 src/sys/arch/xen/include/xenio.h:1.8
--- src/sys/arch/xen/include/xenio.h:1.7	Fri Sep  3 06:07:24 2010
+++ src/sys/arch/xen/include/xenio.h	Wed Dec 15 14:45:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.7 2010/09/03 06:07:24 cegger Exp $	*/
+/*	$NetBSD: xenio.h,v 1.8 2010/12/15 14:45:47 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -58,6 +58,14 @@
 unsigned long *arr; /* array of mfns - top nibble set on err */
 } privcmd_mmapbatch_t; 
 
+typedef struct privcmd_mmapbatch_v2 {
+int num; /* number of pages to populate */
+domid_t dom; /* target domain */
+uint64_t addr;  /* virtual address */
+const xen_pfn_t *arr; /* array of mfns */
+int *err; /* array of error codes */
+} privcmd_mmapbatch_v2_t; 
+
 typedef struct privcmd_blkmsg
 {
 unsigned long op;
@@ -103,6 +111,8 @@
  */
 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
 _IOR('P', 5, int)
+#define IOCTL_PRIVCMD_MMAPBATCH_V2  \
+_IOW('P, 6, privcmd_mmapbatch_v2_t)
 
 /* Interface to /dev/xenevt */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */



CVS commit: src/sys/arch/xen/include

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 14:45:47 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
add privcmd ioctl that got introduced with Xen 4


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/xenio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-11-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 14 13:40:32 UTC 2010

Modified Files:
src/sys/arch/xen/include: i82489var.h

Log Message:
Explain why we hardwire lapic_cpu_number() to 0 on Xen.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/include/i82489var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/i82489var.h
diff -u src/sys/arch/xen/include/i82489var.h:1.1 src/sys/arch/xen/include/i82489var.h:1.2
--- src/sys/arch/xen/include/i82489var.h:1.1	Thu Sep 28 18:53:15 2006
+++ src/sys/arch/xen/include/i82489var.h	Sun Nov 14 13:40:31 2010
@@ -1,5 +1,11 @@
-/*	$NetBSD: i82489var.h,v 1.1 2006/09/28 18:53:15 bouyer Exp $	*/
+/*	$NetBSD: i82489var.h,v 1.2 2010/11/14 13:40:31 bouyer Exp $	*/
 
 #include x86/i82489var.h
+
+/*
+ * Xen doesn't give acces to the lapic. In addition, the lapic number provided
+ * by the dom0 to Xen when setting up iopics is ignored, the hypervisor will
+ * decide itself to which physical CPU the interrupt should be routed to.
+ */
 #undef lapic_cpu_number
 #define lapic_cpu_number() (0)



CVS commit: src/sys/arch/xen/include

2010-11-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 14 13:40:32 UTC 2010

Modified Files:
src/sys/arch/xen/include: i82489var.h

Log Message:
Explain why we hardwire lapic_cpu_number() to 0 on Xen.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/include/i82489var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-09-03 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Sep  3 06:07:24 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h xenio3.h

Log Message:
match header protection with filename


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenio.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/include/xenio3.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.6 src/sys/arch/xen/include/xenio.h:1.7
--- src/sys/arch/xen/include/xenio.h:1.6	Sun Feb 17 16:21:19 2008
+++ src/sys/arch/xen/include/xenio.h	Fri Sep  3 06:07:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.6 2008/02/17 16:21:19 bouyer Exp $	*/
+/*	$NetBSD: xenio.h,v 1.7 2010/09/03 06:07:24 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -27,8 +27,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __XEN_XENIO3_H__
-#define __XEN_XENIO3_H__
+#ifndef __XEN_XENIO_H__
+#define __XEN_XENIO_H__
 
 /* Interface to /proc/xen/privcmd */
 
@@ -112,4 +112,4 @@
 /* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
 #define EVTCHN_UNBIND _IOW('E', 3, unsigned long)
 
-#endif /* __XEN_XENIO3_H__ */
+#endif /* __XEN_XENIO_H__ */

Index: src/sys/arch/xen/include/xenio3.h
diff -u src/sys/arch/xen/include/xenio3.h:1.2 src/sys/arch/xen/include/xenio3.h:1.3
--- src/sys/arch/xen/include/xenio3.h:1.2	Sun Feb 17 16:21:19 2008
+++ src/sys/arch/xen/include/xenio3.h	Fri Sep  3 06:07:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: xenio3.h,v 1.2 2008/02/17 16:21:19 bouyer Exp $ */
+/* $NetBSD: xenio3.h,v 1.3 2010/09/03 06:07:24 cegger Exp $ */
 /**
  * evtchn.h
  * 
@@ -28,8 +28,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __XEN_XENIO_H__
-#define __XEN_XENIO_H__
+#ifndef __XEN_XENIO3_H__
+#define __XEN_XENIO3_H__
 
 /*
  * Bind a fresh port to VIRQ @virq.
@@ -86,4 +86,4 @@
 #define IOCTL_EVTCHN_RESET\
 	_IO('E', 9)
 
-#endif /* __XEN_XENIO_H__ */
+#endif /* __XEN_XENIO3_H__ */



CVS commit: src/sys/arch/xen/include

2010-09-03 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Sep  3 06:07:24 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h xenio3.h

Log Message:
match header protection with filename


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenio.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/include/xenio3.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-03-22 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Mar 22 16:43:08 UTC 2010

Modified Files:
src/sys/arch/xen/include: i82093var.h

Log Message:
Ignore ioapic write failures.
They happen when writing to ioapic pins Xen already disabled.
This makes netbsd dom0 booting.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/i82093var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/i82093var.h
diff -u src/sys/arch/xen/include/i82093var.h:1.3 src/sys/arch/xen/include/i82093var.h:1.4
--- src/sys/arch/xen/include/i82093var.h:1.3	Wed Jul 29 12:02:06 2009
+++ src/sys/arch/xen/include/i82093var.h	Mon Mar 22 16:43:08 2010
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093var.h,v 1.3 2009/07/29 12:02:06 cegger Exp $ */
+/*	 $NetBSD: i82093var.h,v 1.4 2010/03/22 16:43:08 cegger Exp $ */
 
 #include opt_xen.h
 #define _IOAPIC_CUSTOM_RW
@@ -33,8 +33,6 @@
 	op.u.apic_op.reg = regid;
 	op.u.apic_op.value = val;
 	ret = HYPERVISOR_physdev_op(op);
-	if (ret) {
+	if (ret)
 		printf(PHYSDEVOP_APIC_WRITE ret %d\n, ret);
-		panic(PHYSDEVOP_APIC_WRITE);
-	}
 }



CVS commit: src/sys/arch/xen/include

2010-03-22 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Mar 22 16:43:08 UTC 2010

Modified Files:
src/sys/arch/xen/include: i82093var.h

Log Message:
Ignore ioapic write failures.
They happen when writing to ioapic pins Xen already disabled.
This makes netbsd dom0 booting.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/i82093var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-02-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Feb 25 22:20:03 UTC 2010

Modified Files:
src/sys/arch/xen/include: pci_machdep.h

Log Message:
Fix Xen.

XXX Almost everything in this header file, x86, amd64, and i386 should
XXX share.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/include/pci_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-02-25 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Feb 25 22:20:03 UTC 2010

Modified Files:
src/sys/arch/xen/include: pci_machdep.h

Log Message:
Fix Xen.

XXX Almost everything in this header file, x86, amd64, and i386 should
XXX share.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/include/pci_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.15 src/sys/arch/xen/include/pci_machdep.h:1.16
--- src/sys/arch/xen/include/pci_machdep.h:1.15	Tue Feb 16 00:47:46 2010
+++ src/sys/arch/xen/include/pci_machdep.h	Thu Feb 25 22:20:03 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.15 2010/02/16 00:47:46 dyoung Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.16 2010/02/25 22:20:03 dyoung Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -79,19 +79,50 @@
 	} mode2;
 };
 
-typedef union x86_pci_tag_u pcitag_t;
-
 #ifndef DOM0OPS
 int		xpci_enumerate_bus(struct pci_softc *, const int *,
 		   int (*)(struct pci_attach_args *), struct pci_attach_args *);
 #define PCI_MACHDEP_ENUMERATE_BUS xpci_enumerate_bus
 #endif
-typedef void *pci_chipset_tag_t;
+struct pci_chipset_tag;
+struct pci_attach_args;
 
+/*
+ * Types provided to machine-independent PCI code
+ */
+typedef struct pci_chipset_tag *pci_chipset_tag_t;
+typedef union x86_pci_tag_u pcitag_t;
 typedef struct xen_intr_handle pci_intr_handle_t;
 
+struct pci_chipset_tag {
+	pcireg_t (*pc_conf_read)(pci_chipset_tag_t, pcitag_t, int);
+
+	void (*pc_conf_write)(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
+
+#if 0
+	int (*pc_find_rom)(struct pci_attach_args *, bus_space_tag_t,
+	bus_space_handle_t, int, bus_space_handle_t *, bus_space_size_t *);
+#endif
+
+	int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *);
+
+	const char *(*pc_intr_string)(pci_chipset_tag_t, pci_intr_handle_t);
+
+	const struct evcnt *(*pc_intr_evcnt)(pci_chipset_tag_t,
+	pci_intr_handle_t);
+
+	void *(*pc_intr_establish)(pci_chipset_tag_t, pci_intr_handle_t, int,
+	int (*)(void *), void *);
+
+	void (*pc_intr_disestablish)(pci_chipset_tag_t, void *);
+
+	pcitag_t (*pc_make_tag)(pci_chipset_tag_t, int, int, int);
+
+	void (*pc_decompose_tag)(pci_chipset_tag_t, pcitag_t,
+	int *, int *, int *);
+};
+
 /* functions provided to MI PCI */
-struct pci_attach_args;
 
 void		pci_attach_hook(device_t, device_t,
 		struct pcibus_attach_args *);



CVS commit: src/sys/arch/xen/include

2010-02-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Feb 15 23:55:25 UTC 2010

Modified Files:
src/sys/arch/xen/include: pci_machdep.h

Log Message:
Get pci_mode out of the global namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/pci_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/xen/include

2010-02-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Feb 15 23:55:25 UTC 2010

Modified Files:
src/sys/arch/xen/include: pci_machdep.h

Log Message:
Get pci_mode out of the global namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/pci_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.13 src/sys/arch/xen/include/pci_machdep.h:1.14
--- src/sys/arch/xen/include/pci_machdep.h:1.13	Mon Oct 19 18:41:10 2009
+++ src/sys/arch/xen/include/pci_machdep.h	Mon Feb 15 23:55:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.13 2009/10/19 18:41:10 bouyer Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.14 2010/02/15 23:55:24 dyoung Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -121,7 +121,6 @@
  */
 #define	X86_PCI_INTERRUPT_LINE_NO_CONNECTION	0xff
 
-extern int pci_mode;
 int pci_mode_detect(void);
 int pci_bus_flags(void);
 



CVS commit: src/sys/arch/xen/include

2010-02-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Feb 16 00:47:46 UTC 2010

Modified Files:
src/sys/arch/xen/include: pci_machdep.h

Log Message:
Declare pci_mode_set().


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/include/pci_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.14 src/sys/arch/xen/include/pci_machdep.h:1.15
--- src/sys/arch/xen/include/pci_machdep.h:1.14	Mon Feb 15 23:55:24 2010
+++ src/sys/arch/xen/include/pci_machdep.h	Tue Feb 16 00:47:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.14 2010/02/15 23:55:24 dyoung Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.15 2010/02/16 00:47:46 dyoung Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -121,6 +121,7 @@
  */
 #define	X86_PCI_INTERRUPT_LINE_NO_CONNECTION	0xff
 
+void pci_mode_set(int);
 int pci_mode_detect(void);
 int pci_bus_flags(void);