From patchwork Tue Sep 4 15:13:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 1402951 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7F88BDF280 for ; Tue, 4 Sep 2012 15:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932561Ab2IDPO5 (ORCPT ); Tue, 4 Sep 2012 11:14:57 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:59294 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757292Ab2IDPOB (ORCPT ); Tue, 4 Sep 2012 11:14:01 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Sep 2012 16:13:59 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 4 Sep 2012 16:13:57 +0100 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q84FDoSV49545254; Tue, 4 Sep 2012 15:13:50 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q84FDtMG029015; Tue, 4 Sep 2012 09:13:56 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q84FDraR028933; Tue, 4 Sep 2012 09:13:54 -0600 From: Cornelia Huck To: KVM , linux-s390 , qemu-devel Cc: Avi Kivity , Marcelo Tosatti , Anthony Liguori , Rusty Russell , Christian Borntraeger , Carsten Otte , Alexander Graf , Heiko Carstens , Martin Schwidefsky , Sebastian Ott Subject: [PATCH v2 1/5] Update headers for upcoming s390 changes. Date: Tue, 4 Sep 2012 17:13:49 +0200 Message-Id: <1346771633-53081-2-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1346771633-53081-1-git-send-email-cornelia.huck@de.ibm.com> References: <1346771633-53081-1-git-send-email-cornelia.huck@de.ibm.com> x-cbid: 12090415-2966-0000-0000-0000052F5415 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Cornelia Huck --- Changes v1->v2: - update to latest kvm interface changes --- linux-headers/asm-generic/kvm_para.h | 5 +++ linux-headers/asm-x86/kvm.h | 1 + linux-headers/linux/kvm.h | 80 ++++++++++++++++++++++++++++++++++-- 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 linux-headers/asm-generic/kvm_para.h diff --git a/linux-headers/asm-generic/kvm_para.h b/linux-headers/asm-generic/kvm_para.h new file mode 100644 index 0000000..63df88b --- /dev/null +++ b/linux-headers/asm-generic/kvm_para.h @@ -0,0 +1,5 @@ +#ifndef _ASM_GENERIC_KVM_PARA_H +#define _ASM_GENERIC_KVM_PARA_H + + +#endif diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 246617e..521bf25 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -25,6 +25,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..1e87d71 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 { @@ -163,6 +167,7 @@ struct kvm_pit_config { #define KVM_EXIT_OSI 18 #define KVM_EXIT_PAPR_HCALL 19 #define KVM_EXIT_S390_UCONTROL 20 +#define KVM_EXIT_S390_SCH_IO 21 /* For KVM_EXIT_INTERNAL_ERROR */ #define KVM_INTERNAL_ERROR_EMULATION 1 @@ -276,6 +281,20 @@ struct kvm_run { __u64 ret; __u64 args[9]; } papr_hcall; + /* KVM_EXIT_S390_SCH_IO */ + struct { + __u32 sch_id; +#define SCH_DO_CSCH 0 +#define SCH_DO_HSCH 1 +#define SCH_DO_SSCH 2 +#define SCH_DO_RSCH 3 +#define SCH_DO_XSCH 4 + __u8 func; + __u8 pad; + __u64 orb; + __u32 scsw[3]; + __u32 pmcw[7]; + } s390_sch_io; /* Fix the size of the union. */ char padding[256]; }; @@ -388,10 +407,17 @@ struct kvm_s390_psw { #define KVM_S390_PROGRAM_INT 0xfffe0001u #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u #define KVM_S390_RESTART 0xfffe0003u +#define KVM_S390_MCHK 0xfffe1000u #define KVM_S390_INT_VIRTIO 0xffff2603u #define KVM_S390_INT_SERVICE 0xffff2401u #define KVM_S390_INT_EMERGENCY 0xffff1201u #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u +#define KVM_S390_INT_IO(ai,cssid,ssid,schid) \ + (((schid)) | \ + ((ssid) << 16) | \ + ((cssid) << 18) | \ + ((ai) << 26)) + struct kvm_s390_interrupt { __u32 type; @@ -473,6 +499,45 @@ struct kvm_ppc_smmu_info { struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; }; +/* for KVM_S390_CSS_NOTIFY */ +struct kvm_css_notify { + __u8 cssid; + __u8 ssid; + __u16 schid; + __u32 scsw[3]; + __u32 pmcw[7]; + __u8 sense_data[32]; + __u8 unsolicited; + __u8 func; +}; + +/* for KVM_S390_CCW_HOTPLUG */ +struct kvm_s390_sch_info { + __u8 cssid; + __u8 ssid; + __u16 schid; + __u16 devno; + __u32 schib[12]; + int hotplugged; + int add; + int virtual; +}; + +/* for KVM_S390_CHP_HOTPLUG */ +struct kvm_s390_chp_info { + __u8 cssid; + __u8 chpid; + __u8 type; + int add; + int virtual; +}; + +/* for KVM_S390_ADD_CSS */ +struct kvm_s390_css_info { + __u8 cssid; + __u8 default_image; +}; + #define KVMIO 0xAE /* machine type bits, to be used as argument to KVM_CREATE_VM */ @@ -618,6 +683,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_S390_CSS_SUPPORT 82 #ifdef KVM_CAP_IRQ_ROUTING @@ -831,6 +900,11 @@ struct kvm_s390_ucas_mapping { #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) /* Available with KVM_CAP_PPC_ALLOC_HTAB */ #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) +/* Available with KVM_CAP_S390_CSS_SUPPORT */ +#define KVM_S390_CSS_NOTIFY _IOW(KVMIO, 0xae, struct kvm_css_notify) +#define KVM_S390_CCW_HOTPLUG _IOW(KVMIO, 0xab, struct kvm_s390_sch_info) +#define KVM_S390_CHP_HOTPLUG _IOW(KVMIO, 0xac, struct kvm_s390_chp_info) +#define KVM_S390_ADD_CSS _IOW(KVMIO, 0xad, struct kvm_s390_css_info) /* * ioctls for vcpu fds