From patchwork Tue Nov 19 06:16:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 292288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E0B652C00B3 for ; Tue, 19 Nov 2013 17:16:15 +1100 (EST) Received: from localhost ([::1]:47290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viebb-0005Sl-F3 for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2013 01:16:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vieaz-0005RG-2q for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vieat-0004KJ-7l for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:15:33 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:36214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vieat-0004K7-0X for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:15:27 -0500 Received: by mail-pd0-f182.google.com with SMTP id v10so2076717pde.27 for ; Mon, 18 Nov 2013 22:15:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6ZujeLJ9RlEb9xrlBJVqfEId6+xqvNn4FyXz9qufbLI=; b=KtnQyCfvJW0KTOipPKjmfmIpJW33qi7PgjY71tTyd/fHNe+S0lSQRPYPrkGcsH3qeG ciwKPP3bc7mYxHS1qJgUrKS3mIAMz3vxyp2FgCOtW9nTz+3hqS5u25twxvCfL+IjuscS PZ7YsUXfxsuzzTbbNmg1NQ9nHh2jgh/0D7nD3Mqsx/Q3Nhvh1Ih81M/XV6GNUUk6ax7/ R9Z1BawoL03HU2zPUHce656S9W+OWjxfTtd8PM3DJaAK6A1uch+CR6B4VdXZp6F7do9k PhwCsFHkjMZD6fJ9tO1VhVSfz2fPzKgFQvSL6MVRIjq/RK5w6igB4PYNEPDYFeCk2Pli fINA== X-Gm-Message-State: ALoCoQkDDIs+Ax7SfQi3asWGClIN2E1JGPGcmbRrPoHUjJm+1IfhhEgAczJUYljDxPsIOI3ehhV1 X-Received: by 10.66.27.138 with SMTP id t10mr3750pag.176.1384841726251; Mon, 18 Nov 2013 22:15:26 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id fk4sm31648068pab.23.2013.11.18.22.15.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 22:15:25 -0800 (PST) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Mon, 18 Nov 2013 22:16:33 -0800 Message-Id: <1384841796-19437-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1384841796-19437-1-git-send-email-christoffer.dall@linaro.org> References: <1384841796-19437-1-git-send-email-christoffer.dall@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.182 Cc: kvmarm@lists.cs.columbia.edu, Christoffer Dall , patches@linaro.org Subject: [Qemu-devel] [RFC PATCH v3 1/4] kvm: Update headers for device control api X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Update the KVM kernel headers to add support for the device control API on ARM used to create in-kernel devices and set and get attributes on these. This is needed for VGIC save/restore with KVM ARM targets. Headers are included from: git://git.linaro.org/people/cdall/linux-kvm-arm.git vgic-migrate-v3 Signed-off-by: Christoffer Dall --- linux-headers/asm-arm/kvm.h | 8 ++++++++ linux-headers/linux/kvm.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h index c1ee007..587f1ae 100644 --- a/linux-headers/asm-arm/kvm.h +++ b/linux-headers/asm-arm/kvm.h @@ -142,6 +142,14 @@ struct kvm_arch_memory_slot { #define KVM_REG_ARM_VFP_FPINST 0x1009 #define KVM_REG_ARM_VFP_FPINST2 0x100A +/* Device Control API: ARM VGIC */ +#define KVM_DEV_ARM_VGIC_GRP_ADDR 0 +#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1 +#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2 +#define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32 +#define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT) +#define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0 +#define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT) /* KVM_IRQ_LINE irq field index values */ #define KVM_ARM_IRQ_TYPE_SHIFT 24 diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 13e890c..1ae250d 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -843,6 +843,11 @@ struct kvm_device_attr { #define KVM_DEV_TYPE_FSL_MPIC_20 1 #define KVM_DEV_TYPE_FSL_MPIC_42 2 #define KVM_DEV_TYPE_XICS 3 +#define KVM_DEV_TYPE_VFIO 4 +#define KVM_DEV_VFIO_GROUP 1 +#define KVM_DEV_VFIO_GROUP_ADD 1 +#define KVM_DEV_VFIO_GROUP_DEL 2 +#define KVM_DEV_TYPE_ARM_VGIC_V2 5 /* * ioctls for VM fds