From patchwork Sun Feb 2 21:41:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 24015 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19BEA202FA for ; Sun, 2 Feb 2014 21:41:06 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id tp5sf25042352ieb.11 for ; Sun, 02 Feb 2014 13:41:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=r3OfoYiByEhkTsHPgMwkOa5H5wDyfdwOzPYKucfXCNQ=; b=GuFXnjIXX53whP2iDDx/yDzxGaXnWCRqcA0muaW4+L1LNpexQx/6ev7IqGp47rlMXv Z8hPvKZcv4FdHh4DkVg+QoVx0kHTEf9Dv4ZKOZwHxg2Om6IBC33e8L60h6XYZ5CImkpp eUzP3plaD/X1GhcFYrjxbrEYH51HUKIX/+LpMLvF1e2v3bUfjRsKXzdGgd/PPjO1iyR+ NtZInpuAKd7TMAHp2RZ+/EUDkD3qVcR9it9eJbN2hM9tmW5SHc4N1wEddeLfzonpAZxH ncLIrdDcY2vVe1p6zFLBbKCoYchxUNp5pbKGS8GV+XldJVD289v8s3sK6jHjAlr1cDH3 WFCQ== X-Gm-Message-State: ALoCoQlajJOMOLS2i2bOqCi+OOWIqa0TxJ1JpVTJjz9mBGPVNUBpq5ggEP89QwJLh1qcgMJR4FEv X-Received: by 10.182.95.68 with SMTP id di4mr12841455obb.4.1391377266188; Sun, 02 Feb 2014 13:41:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.102 with SMTP id l93ls1736548qge.93.gmail; Sun, 02 Feb 2014 13:41:06 -0800 (PST) X-Received: by 10.58.161.227 with SMTP id xv3mr696150veb.31.1391377266120; Sun, 02 Feb 2014 13:41:06 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id qt5si6168542vcb.23.2014.02.02.13.41.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 13:41:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so4423712veb.33 for ; Sun, 02 Feb 2014 13:41:06 -0800 (PST) X-Received: by 10.220.131.210 with SMTP id y18mr26308179vcs.12.1391377266060; Sun, 02 Feb 2014 13:41:06 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp114114vcz; Sun, 2 Feb 2014 13:41:05 -0800 (PST) X-Received: by 10.66.164.229 with SMTP id yt5mr33943065pab.67.1391377265239; Sun, 02 Feb 2014 13:41:05 -0800 (PST) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id tq5si18168142pac.211.2014.02.02.13.41.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 13:41:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id md12so6335895pbc.2 for ; Sun, 02 Feb 2014 13:41:04 -0800 (PST) X-Received: by 10.66.233.71 with SMTP id tu7mr33544005pac.22.1391377264861; Sun, 02 Feb 2014 13:41:04 -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 ac5sm19948532pbc.37.2014.02.02.13.41.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 13:41:03 -0800 (PST) From: Christoffer Dall To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, patches@linaro.org, Christoffer Dall Subject: [PATCH] arm64: KVM: Add VGIC device control for arm64 Date: Sun, 2 Feb 2014 13:41:02 -0800 Message-Id: <1391377262-30188-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This fixes the build breakage introduced by c07a0191ef2de1f9510f12d1f88e3b0b5cd8d66f and adds support for the device control API and save/restore of the VGIC state for ARMv8. The defines were simply missing from the arm64 header files and uaccess.h must be implicitly imported from somewhere else on arm. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- arch/arm64/include/uapi/asm/kvm.h | 9 +++++++++ virt/kvm/arm/vgic.c | 1 + 2 files changed, 10 insertions(+) diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 495ab6f..eaf54a3 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -148,6 +148,15 @@ struct kvm_arch_memory_slot { #define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2) #define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2) +/* 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 #define KVM_ARM_IRQ_TYPE_MASK 0xff diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index be456ce..8ca405c 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -24,6 +24,7 @@ #include #include #include +#include #include