From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] qemu: Update Linux headers Date: Mon, 15 Oct 2012 15:54:20 -0500 Message-ID: <87vcebwj5v.fsf@codemonkey.ws> References: <20121015201439.23147.54946.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, alex.williamson@redhat.com To: Alex Williamson Return-path: Received: from mail-ob0-f174.google.com ([209.85.214.174]:44225 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754885Ab2JOUyY (ORCPT ); Mon, 15 Oct 2012 16:54:24 -0400 Received: by mail-ob0-f174.google.com with SMTP id uo13so5421876obb.19 for ; Mon, 15 Oct 2012 13:54:23 -0700 (PDT) In-Reply-To: <20121015201439.23147.54946.stgit@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: Alex Williamson writes: > Based on v3.7-rc1-3-g29bb4cc Normally this would go through qemu-kvm/uq/master but since this is from Linus' tree, it's less of a concern. Nonetheless, I'd prefer we did it from v3.7-rc1 instead of a random git snapshot. Regards, Anthony Liguori > > Signed-off-by: Alex Williamson > --- > > Trying to get KVM_IRQFD_FLAG_RESAMPLE and friends for vfio-pci > > linux-headers/asm-x86/kvm.h | 17 +++++++++++++++++ > linux-headers/linux/kvm.h | 25 +++++++++++++++++++++---- > linux-headers/linux/kvm_para.h | 6 +++--- > linux-headers/linux/vfio.h | 6 +++--- > linux-headers/linux/virtio_config.h | 6 +++--- > linux-headers/linux/virtio_ring.h | 6 +++--- > 6 files changed, 50 insertions(+), 16 deletions(-) > > diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h > index 246617e..a65ec29 100644 > --- a/linux-headers/asm-x86/kvm.h > +++ b/linux-headers/asm-x86/kvm.h > @@ -9,6 +9,22 @@ > #include > #include > > +#define DE_VECTOR 0 > +#define DB_VECTOR 1 > +#define BP_VECTOR 3 > +#define OF_VECTOR 4 > +#define BR_VECTOR 5 > +#define UD_VECTOR 6 > +#define NM_VECTOR 7 > +#define DF_VECTOR 8 > +#define TS_VECTOR 10 > +#define NP_VECTOR 11 > +#define SS_VECTOR 12 > +#define GP_VECTOR 13 > +#define PF_VECTOR 14 > +#define MF_VECTOR 16 > +#define MC_VECTOR 18 > + > /* Select x86 specific features in */ > #define __KVM_HAVE_PIT > #define __KVM_HAVE_IOAPIC > @@ -25,6 +41,7 @@ > #define __KVM_HAVE_DEBUGREGS > #define __KVM_HAVE_XSAVE > #define __KVM_HAVE_XCRS > +#define __KVM_HAVE_READONLY_MEM > > /* Architectural interrupt line count. */ > #define KVM_NR_INTERRUPTS 256 > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h > index 4b9e575..81d2feb 100644 > --- a/linux-headers/linux/kvm.h > +++ b/linux-headers/linux/kvm.h > @@ -101,9 +101,13 @@ struct kvm_userspace_memory_region { > __u64 userspace_addr; /* start of the userspace allocated memory */ > }; > > -/* for kvm_memory_region::flags */ > -#define KVM_MEM_LOG_DIRTY_PAGES 1UL > -#define KVM_MEMSLOT_INVALID (1UL << 1) > +/* > + * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, > + * other bits are reserved for kvm internal use which are defined in > + * include/linux/kvm_host.h. > + */ > +#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) > +#define KVM_MEM_READONLY (1UL << 1) > > /* for KVM_IRQ_LINE */ > struct kvm_irq_level { > @@ -618,6 +622,10 @@ struct kvm_ppc_smmu_info { > #define KVM_CAP_PPC_GET_SMMU_INFO 78 > #define KVM_CAP_S390_COW 79 > #define KVM_CAP_PPC_ALLOC_HTAB 80 > +#ifdef __KVM_HAVE_READONLY_MEM > +#define KVM_CAP_READONLY_MEM 81 > +#endif > +#define KVM_CAP_IRQFD_RESAMPLE 82 > > #ifdef KVM_CAP_IRQ_ROUTING > > @@ -683,12 +691,21 @@ struct kvm_xen_hvm_config { > #endif > > #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) > +/* > + * Available with KVM_CAP_IRQFD_RESAMPLE > + * > + * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies > + * the irqfd to operate in resampling mode for level triggered interrupt > + * emlation. See Documentation/virtual/kvm/api.txt. > + */ > +#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) > > struct kvm_irqfd { > __u32 fd; > __u32 gsi; > __u32 flags; > - __u8 pad[20]; > + __u32 resamplefd; > + __u8 pad[16]; > }; > > struct kvm_clock_data { > diff --git a/linux-headers/linux/kvm_para.h b/linux-headers/linux/kvm_para.h > index 7bdcf93..cea2c5c 100644 > --- a/linux-headers/linux/kvm_para.h > +++ b/linux-headers/linux/kvm_para.h > @@ -1,5 +1,5 @@ > -#ifndef __LINUX_KVM_PARA_H > -#define __LINUX_KVM_PARA_H > +#ifndef _UAPI__LINUX_KVM_PARA_H > +#define _UAPI__LINUX_KVM_PARA_H > > /* > * This header file provides a method for making a hypercall to the host > @@ -25,4 +25,4 @@ > */ > #include > > -#endif /* __LINUX_KVM_PARA_H */ > +#endif /* _UAPI__LINUX_KVM_PARA_H */ > diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h > index f787b72..4758d1b 100644 > --- a/linux-headers/linux/vfio.h > +++ b/linux-headers/linux/vfio.h > @@ -8,8 +8,8 @@ > * it under the terms of the GNU General Public License version 2 as > * published by the Free Software Foundation. > */ > -#ifndef VFIO_H > -#define VFIO_H > +#ifndef _UAPIVFIO_H > +#define _UAPIVFIO_H > > #include > #include > @@ -365,4 +365,4 @@ struct vfio_iommu_type1_dma_unmap { > > #define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) > > -#endif /* VFIO_H */ > +#endif /* _UAPIVFIO_H */ > diff --git a/linux-headers/linux/virtio_config.h b/linux-headers/linux/virtio_config.h > index 4f51d8f..b7cda39 100644 > --- a/linux-headers/linux/virtio_config.h > +++ b/linux-headers/linux/virtio_config.h > @@ -1,5 +1,5 @@ > -#ifndef _LINUX_VIRTIO_CONFIG_H > -#define _LINUX_VIRTIO_CONFIG_H > +#ifndef _UAPI_LINUX_VIRTIO_CONFIG_H > +#define _UAPI_LINUX_VIRTIO_CONFIG_H > /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so > * anyone can use the definitions to implement compatible drivers/servers. > * > @@ -51,4 +51,4 @@ > * suppressed them? */ > #define VIRTIO_F_NOTIFY_ON_EMPTY 24 > > -#endif /* _LINUX_VIRTIO_CONFIG_H */ > +#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ > diff --git a/linux-headers/linux/virtio_ring.h b/linux-headers/linux/virtio_ring.h > index 1b333e2..921694a 100644 > --- a/linux-headers/linux/virtio_ring.h > +++ b/linux-headers/linux/virtio_ring.h > @@ -1,5 +1,5 @@ > -#ifndef _LINUX_VIRTIO_RING_H > -#define _LINUX_VIRTIO_RING_H > +#ifndef _UAPI_LINUX_VIRTIO_RING_H > +#define _UAPI_LINUX_VIRTIO_RING_H > /* An interface for efficient virtio implementation, currently for use by KVM > * and lguest, but hopefully others soon. Do NOT change this since it will > * break existing servers and clients. > @@ -160,4 +160,4 @@ static __inline__ int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old > return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old); > } > > -#endif /* _LINUX_VIRTIO_RING_H */ > +#endif /* _UAPI_LINUX_VIRTIO_RING_H */ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNrgA-0000rE-4k for qemu-devel@nongnu.org; Mon, 15 Oct 2012 16:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNrg8-0000qW-Oa for qemu-devel@nongnu.org; Mon, 15 Oct 2012 16:54:26 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:40683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNrg8-0000qK-I5 for qemu-devel@nongnu.org; Mon, 15 Oct 2012 16:54:24 -0400 Received: by mail-ob0-f173.google.com with SMTP id wc18so5220051obb.4 for ; Mon, 15 Oct 2012 13:54:23 -0700 (PDT) From: Anthony Liguori In-Reply-To: <20121015201439.23147.54946.stgit@bling.home> References: <20121015201439.23147.54946.stgit@bling.home> Date: Mon, 15 Oct 2012 15:54:20 -0500 Message-ID: <87vcebwj5v.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] qemu: Update Linux headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Alex Williamson writes: > Based on v3.7-rc1-3-g29bb4cc Normally this would go through qemu-kvm/uq/master but since this is from Linus' tree, it's less of a concern. Nonetheless, I'd prefer we did it from v3.7-rc1 instead of a random git snapshot. Regards, Anthony Liguori > > Signed-off-by: Alex Williamson > --- > > Trying to get KVM_IRQFD_FLAG_RESAMPLE and friends for vfio-pci > > linux-headers/asm-x86/kvm.h | 17 +++++++++++++++++ > linux-headers/linux/kvm.h | 25 +++++++++++++++++++++---- > linux-headers/linux/kvm_para.h | 6 +++--- > linux-headers/linux/vfio.h | 6 +++--- > linux-headers/linux/virtio_config.h | 6 +++--- > linux-headers/linux/virtio_ring.h | 6 +++--- > 6 files changed, 50 insertions(+), 16 deletions(-) > > diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h > index 246617e..a65ec29 100644 > --- a/linux-headers/asm-x86/kvm.h > +++ b/linux-headers/asm-x86/kvm.h > @@ -9,6 +9,22 @@ > #include > #include > > +#define DE_VECTOR 0 > +#define DB_VECTOR 1 > +#define BP_VECTOR 3 > +#define OF_VECTOR 4 > +#define BR_VECTOR 5 > +#define UD_VECTOR 6 > +#define NM_VECTOR 7 > +#define DF_VECTOR 8 > +#define TS_VECTOR 10 > +#define NP_VECTOR 11 > +#define SS_VECTOR 12 > +#define GP_VECTOR 13 > +#define PF_VECTOR 14 > +#define MF_VECTOR 16 > +#define MC_VECTOR 18 > + > /* Select x86 specific features in */ > #define __KVM_HAVE_PIT > #define __KVM_HAVE_IOAPIC > @@ -25,6 +41,7 @@ > #define __KVM_HAVE_DEBUGREGS > #define __KVM_HAVE_XSAVE > #define __KVM_HAVE_XCRS > +#define __KVM_HAVE_READONLY_MEM > > /* Architectural interrupt line count. */ > #define KVM_NR_INTERRUPTS 256 > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h > index 4b9e575..81d2feb 100644 > --- a/linux-headers/linux/kvm.h > +++ b/linux-headers/linux/kvm.h > @@ -101,9 +101,13 @@ struct kvm_userspace_memory_region { > __u64 userspace_addr; /* start of the userspace allocated memory */ > }; > > -/* for kvm_memory_region::flags */ > -#define KVM_MEM_LOG_DIRTY_PAGES 1UL > -#define KVM_MEMSLOT_INVALID (1UL << 1) > +/* > + * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, > + * other bits are reserved for kvm internal use which are defined in > + * include/linux/kvm_host.h. > + */ > +#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) > +#define KVM_MEM_READONLY (1UL << 1) > > /* for KVM_IRQ_LINE */ > struct kvm_irq_level { > @@ -618,6 +622,10 @@ struct kvm_ppc_smmu_info { > #define KVM_CAP_PPC_GET_SMMU_INFO 78 > #define KVM_CAP_S390_COW 79 > #define KVM_CAP_PPC_ALLOC_HTAB 80 > +#ifdef __KVM_HAVE_READONLY_MEM > +#define KVM_CAP_READONLY_MEM 81 > +#endif > +#define KVM_CAP_IRQFD_RESAMPLE 82 > > #ifdef KVM_CAP_IRQ_ROUTING > > @@ -683,12 +691,21 @@ struct kvm_xen_hvm_config { > #endif > > #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) > +/* > + * Available with KVM_CAP_IRQFD_RESAMPLE > + * > + * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies > + * the irqfd to operate in resampling mode for level triggered interrupt > + * emlation. See Documentation/virtual/kvm/api.txt. > + */ > +#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) > > struct kvm_irqfd { > __u32 fd; > __u32 gsi; > __u32 flags; > - __u8 pad[20]; > + __u32 resamplefd; > + __u8 pad[16]; > }; > > struct kvm_clock_data { > diff --git a/linux-headers/linux/kvm_para.h b/linux-headers/linux/kvm_para.h > index 7bdcf93..cea2c5c 100644 > --- a/linux-headers/linux/kvm_para.h > +++ b/linux-headers/linux/kvm_para.h > @@ -1,5 +1,5 @@ > -#ifndef __LINUX_KVM_PARA_H > -#define __LINUX_KVM_PARA_H > +#ifndef _UAPI__LINUX_KVM_PARA_H > +#define _UAPI__LINUX_KVM_PARA_H > > /* > * This header file provides a method for making a hypercall to the host > @@ -25,4 +25,4 @@ > */ > #include > > -#endif /* __LINUX_KVM_PARA_H */ > +#endif /* _UAPI__LINUX_KVM_PARA_H */ > diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h > index f787b72..4758d1b 100644 > --- a/linux-headers/linux/vfio.h > +++ b/linux-headers/linux/vfio.h > @@ -8,8 +8,8 @@ > * it under the terms of the GNU General Public License version 2 as > * published by the Free Software Foundation. > */ > -#ifndef VFIO_H > -#define VFIO_H > +#ifndef _UAPIVFIO_H > +#define _UAPIVFIO_H > > #include > #include > @@ -365,4 +365,4 @@ struct vfio_iommu_type1_dma_unmap { > > #define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) > > -#endif /* VFIO_H */ > +#endif /* _UAPIVFIO_H */ > diff --git a/linux-headers/linux/virtio_config.h b/linux-headers/linux/virtio_config.h > index 4f51d8f..b7cda39 100644 > --- a/linux-headers/linux/virtio_config.h > +++ b/linux-headers/linux/virtio_config.h > @@ -1,5 +1,5 @@ > -#ifndef _LINUX_VIRTIO_CONFIG_H > -#define _LINUX_VIRTIO_CONFIG_H > +#ifndef _UAPI_LINUX_VIRTIO_CONFIG_H > +#define _UAPI_LINUX_VIRTIO_CONFIG_H > /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so > * anyone can use the definitions to implement compatible drivers/servers. > * > @@ -51,4 +51,4 @@ > * suppressed them? */ > #define VIRTIO_F_NOTIFY_ON_EMPTY 24 > > -#endif /* _LINUX_VIRTIO_CONFIG_H */ > +#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ > diff --git a/linux-headers/linux/virtio_ring.h b/linux-headers/linux/virtio_ring.h > index 1b333e2..921694a 100644 > --- a/linux-headers/linux/virtio_ring.h > +++ b/linux-headers/linux/virtio_ring.h > @@ -1,5 +1,5 @@ > -#ifndef _LINUX_VIRTIO_RING_H > -#define _LINUX_VIRTIO_RING_H > +#ifndef _UAPI_LINUX_VIRTIO_RING_H > +#define _UAPI_LINUX_VIRTIO_RING_H > /* An interface for efficient virtio implementation, currently for use by KVM > * and lguest, but hopefully others soon. Do NOT change this since it will > * break existing servers and clients. > @@ -160,4 +160,4 @@ static __inline__ int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old > return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old); > } > > -#endif /* _LINUX_VIRTIO_RING_H */ > +#endif /* _UAPI_LINUX_VIRTIO_RING_H */