From 2fc136eecd0c647a6b13fcd00d0c41a1a28f35a5 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Wed, 12 Sep 2012 12:44:30 +0100 Subject: xen/m2p: do not reuse kmap_op->dev_bus_addr If the caller passes a valid kmap_op to m2p_add_override, we use kmap_op->dev_bus_addr to store the original mfn, but dev_bus_addr is part of the interface with Xen and if we are batching the hypercalls it might not have been written by the hypervisor yet. That means that later on Xen will write to it and we'll think that the original mfn is actually what Xen has written to it. Rather than "stealing" struct members from kmap_op, keep using page->index to store the original mfn and add another parameter to m2p_remove_override to get the corresponding kmap_op instead. It is now responsibility of the caller to keep track of which kmap_op corresponds to a particular page in the m2p_override (gntdev, the only user of this interface that passes a valid kmap_op, is already doing that). CC: stable@kernel.org Reported-and-Tested-By: Sander Eikelenboom Signed-off-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/grant_table.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/xen') diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 11e27c3..f19fff8 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h @@ -187,6 +187,7 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, struct gnttab_map_grant_ref *kmap_ops, struct page **pages, unsigned int count); int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, - struct page **pages, unsigned int count, bool clear_pte); + struct gnttab_map_grant_ref *kunmap_ops, + struct page **pages, unsigned int count); #endif /* __ASM_GNTTAB_H__ */ -- cgit v1.1 From 9fa5780beea1274d498a224822397100022da7d4 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 18 Sep 2012 12:23:02 +0100 Subject: USB EHCI/Xen: propagate controller reset information to hypervisor Just like for the in-tree early console debug port driver, the hypervisor - when using a debug port based console - also needs to be told about controller resets, so it can suppress using and then re-initialize the debug port accordingly. Other than the in-tree driver, the hypervisor driver actually cares about doing this only for the device where the debug is port actually in use, i.e. it needs to be told the coordinates of the device being reset (quite obviously, leveraging the addition done for that would likely benefit the in-tree driver too). Signed-off-by: Jan Beulich Acked-by: Konrad Rzeszutek Wilk Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- include/xen/interface/physdev.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/xen') diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 9ce788d..bfa1d50 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h @@ -258,6 +258,22 @@ struct physdev_pci_device { uint8_t devfn; }; +#define PHYSDEVOP_DBGP_RESET_PREPARE 1 +#define PHYSDEVOP_DBGP_RESET_DONE 2 + +#define PHYSDEVOP_DBGP_BUS_UNKNOWN 0 +#define PHYSDEVOP_DBGP_BUS_PCI 1 + +#define PHYSDEVOP_dbgp_op 29 +struct physdev_dbgp_op { + /* IN */ + uint8_t op; + uint8_t bus; + union { + struct physdev_pci_device pci; + } u; +}; + /* * Notify that some PIRQ-bound event channels have been unmasked. * ** This command is obsolete since interface version 0x00030202 and is ** -- cgit v1.1 From a1ce39288e6fbefdd8d607021d02384eb4a20b99 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 2 Oct 2012 18:01:25 +0100 Subject: UAPI: (Scripted) Convert #include "..." to #include in kernel system headers Convert #include "..." to #include in kernel system headers. Signed-off-by: David Howells Acked-by: Arnd Bergmann Acked-by: Thomas Gleixner Acked-by: Paul E. McKenney Acked-by: Dave Jones --- include/xen/interface/callback.h | 2 +- include/xen/interface/hvm/params.h | 2 +- include/xen/interface/io/blkif.h | 4 ++-- include/xen/interface/io/netif.h | 4 ++-- include/xen/interface/platform.h | 2 +- include/xen/interface/sched.h | 2 +- include/xen/interface/version.h | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include/xen') diff --git a/include/xen/interface/callback.h b/include/xen/interface/callback.h index 2ae3cd2..8c5fa0e 100644 --- a/include/xen/interface/callback.h +++ b/include/xen/interface/callback.h @@ -27,7 +27,7 @@ #ifndef __XEN_PUBLIC_CALLBACK_H__ #define __XEN_PUBLIC_CALLBACK_H__ -#include "xen.h" +#include /* * Prototype for this hypercall is: diff --git a/include/xen/interface/hvm/params.h b/include/xen/interface/hvm/params.h index 1b4f923..a6c7991 100644 --- a/include/xen/interface/hvm/params.h +++ b/include/xen/interface/hvm/params.h @@ -21,7 +21,7 @@ #ifndef __XEN_PUBLIC_HVM_PARAMS_H__ #define __XEN_PUBLIC_HVM_PARAMS_H__ -#include "hvm_op.h" +#include /* * Parameter space for HVMOP_{set,get}_param. diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index ee338bf..01c3d62 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h @@ -9,8 +9,8 @@ #ifndef __XEN_PUBLIC_IO_BLKIF_H__ #define __XEN_PUBLIC_IO_BLKIF_H__ -#include "ring.h" -#include "../grant_table.h" +#include +#include /* * Front->back notifications: When enqueuing a new request, sending a diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h index cb94668..9dfc120 100644 --- a/include/xen/interface/io/netif.h +++ b/include/xen/interface/io/netif.h @@ -9,8 +9,8 @@ #ifndef __XEN_PUBLIC_IO_NETIF_H__ #define __XEN_PUBLIC_IO_NETIF_H__ -#include "ring.h" -#include "../grant_table.h" +#include +#include /* * Notifications after enqueuing any type of message should be conditional on diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 61fa661..52ff837 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h @@ -27,7 +27,7 @@ #ifndef __XEN_PUBLIC_PLATFORM_H__ #define __XEN_PUBLIC_PLATFORM_H__ -#include "xen.h" +#include #define XENPF_INTERFACE_VERSION 0x03000001 diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h index dd55dac..9ce0839 100644 --- a/include/xen/interface/sched.h +++ b/include/xen/interface/sched.h @@ -9,7 +9,7 @@ #ifndef __XEN_PUBLIC_SCHED_H__ #define __XEN_PUBLIC_SCHED_H__ -#include "event_channel.h" +#include /* * The prototype for this hypercall is: diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h index e8b6519..ff372a5 100644 --- a/include/xen/interface/version.h +++ b/include/xen/interface/version.h @@ -55,7 +55,7 @@ struct xen_feature_info { }; /* Declares the features reported by XENVER_get_features. */ -#include "features.h" +#include /* arg == NULL; returns host memory page size. */ #define XENVER_pagesize 7 -- cgit v1.1 From 72503791edffe516848d0f01d377fa9cd0711970 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 9 Oct 2012 09:49:15 +0100 Subject: UAPI: (Scripted) Disintegrate include/xen Signed-off-by: David Howells Acked-by: Arnd Bergmann Acked-by: Thomas Gleixner Acked-by: Michael Kerrisk Acked-by: Paul E. McKenney Acked-by: Dave Jones --- include/xen/Kbuild | 2 -- include/xen/evtchn.h | 88 --------------------------------------------- include/xen/privcmd.h | 98 --------------------------------------------------- 3 files changed, 188 deletions(-) delete mode 100644 include/xen/evtchn.h delete mode 100644 include/xen/privcmd.h (limited to 'include/xen') diff --git a/include/xen/Kbuild b/include/xen/Kbuild index 84ad8f0..e69de29 100644 --- a/include/xen/Kbuild +++ b/include/xen/Kbuild @@ -1,2 +0,0 @@ -header-y += evtchn.h -header-y += privcmd.h diff --git a/include/xen/evtchn.h b/include/xen/evtchn.h deleted file mode 100644 index 14e833ee4..0000000 --- a/include/xen/evtchn.h +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** - * evtchn.h - * - * Interface to /dev/xen/evtchn. - * - * Copyright (c) 2003-2005, K A Fraser - * - * 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 __LINUX_PUBLIC_EVTCHN_H__ -#define __LINUX_PUBLIC_EVTCHN_H__ - -/* - * Bind a fresh port to VIRQ @virq. - * Return allocated port. - */ -#define IOCTL_EVTCHN_BIND_VIRQ \ - _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq)) -struct ioctl_evtchn_bind_virq { - unsigned int virq; -}; - -/* - * Bind a fresh port to remote <@remote_domain, @remote_port>. - * Return allocated port. - */ -#define IOCTL_EVTCHN_BIND_INTERDOMAIN \ - _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain)) -struct ioctl_evtchn_bind_interdomain { - unsigned int remote_domain, remote_port; -}; - -/* - * Allocate a fresh port for binding to @remote_domain. - * Return allocated port. - */ -#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \ - _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port)) -struct ioctl_evtchn_bind_unbound_port { - unsigned int remote_domain; -}; - -/* - * Unbind previously allocated @port. - */ -#define IOCTL_EVTCHN_UNBIND \ - _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind)) -struct ioctl_evtchn_unbind { - unsigned int port; -}; - -/* - * Unbind previously allocated @port. - */ -#define IOCTL_EVTCHN_NOTIFY \ - _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify)) -struct ioctl_evtchn_notify { - unsigned int port; -}; - -/* Clear and reinitialise the event buffer. Clear error condition. */ -#define IOCTL_EVTCHN_RESET \ - _IOC(_IOC_NONE, 'E', 5, 0) - -#endif /* __LINUX_PUBLIC_EVTCHN_H__ */ diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h deleted file mode 100644 index a853168..0000000 --- a/include/xen/privcmd.h +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** - * privcmd.h - * - * Interface to /proc/xen/privcmd. - * - * Copyright (c) 2003-2005, K A Fraser - * - * 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 __LINUX_PUBLIC_PRIVCMD_H__ -#define __LINUX_PUBLIC_PRIVCMD_H__ - -#include -#include -#include - -struct privcmd_hypercall { - __u64 op; - __u64 arg[5]; -}; - -struct privcmd_mmap_entry { - __u64 va; - __u64 mfn; - __u64 npages; -}; - -struct privcmd_mmap { - int num; - domid_t dom; /* target domain */ - struct privcmd_mmap_entry __user *entry; -}; - -struct privcmd_mmapbatch { - int num; /* number of pages to populate */ - domid_t dom; /* target domain */ - __u64 addr; /* virtual address */ - xen_pfn_t __user *arr; /* array of mfns - or'd with - PRIVCMD_MMAPBATCH_*_ERROR on err */ -}; - -#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U -#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U - -struct privcmd_mmapbatch_v2 { - unsigned int num; /* number of pages to populate */ - domid_t dom; /* target domain */ - __u64 addr; /* virtual address */ - const xen_pfn_t __user *arr; /* array of mfns */ - int __user *err; /* array of error codes */ -}; - -/* - * @cmd: IOCTL_PRIVCMD_HYPERCALL - * @arg: &privcmd_hypercall_t - * Return: Value returned from execution of the specified hypercall. - * - * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2 - * @arg: &struct privcmd_mmapbatch_v2 - * Return: 0 on success (i.e., arg->err contains valid error codes for - * each frame). On an error other than a failed frame remap, -1 is - * returned and errno is set to EINVAL, EFAULT etc. As an exception, - * if the operation was otherwise successful but any frame failed with - * -ENOENT, then -1 is returned and errno is set to ENOENT. - */ -#define IOCTL_PRIVCMD_HYPERCALL \ - _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) -#define IOCTL_PRIVCMD_MMAP \ - _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) -#define IOCTL_PRIVCMD_MMAPBATCH \ - _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) -#define IOCTL_PRIVCMD_MMAPBATCH_V2 \ - _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2)) - -#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ -- cgit v1.1