From patchwork Thu Jun 8 13:34:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9775471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E8BB460350 for ; Thu, 8 Jun 2017 14:06:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D890A28543 for ; Thu, 8 Jun 2017 14:06:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD9282855A; Thu, 8 Jun 2017 14:06:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B90328543 for ; Thu, 8 Jun 2017 14:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GWnb68plREc6sc6xPL/fJOSAVrYwoHHKY6eHNmUPP80=; b=W9zdQbgygkI6YXLUeRm/Q00Xwv mTq4KCmhC2xPMCywT1NGrJ156dCPRQHU0Yeq6kx2yDJjnNFldO898cuGJPmNhD40/ZVwAYwZJyGaS h3/tsf5w5IaSuBAzNQj8pnUZfvTMksG6G2HB7TPP/cb/r19GzL46qoV9LKZwGLfjsMTuo5LVkG0nF pT2Ke2Je/XTQcfaw5ZpRS0dl4hGqflnRhlUCNa3buFTaaxj3LZ07ZKeJa08EWI0zxNCqPtAihkTnj AoVhjruW3BlwhbWakrcgE3+G50ySlnGTG6D4pZlekX83wfPP9UsJp6Zymdl8T7PZOWZ2I7Zm+Z19O +6fBDxGg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIy5N-0007ZL-Cl; Thu, 08 Jun 2017 14:06:53 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dIy4B-0005xk-Tf for linux-arm-kernel@bombadil.infradead.org; Thu, 08 Jun 2017 14:05:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k/r4z303eX94bteFRo8kco07DVzA3Ft4GjTv/KDkOds=; b=jEr8TSe/ORt2ONo7B8IxhNsd+ IIFuGzn+JT8fdk+juMz/5RNDqazPtdgZ1XYu/f5zkTPsNf5/+sIrVanq2rsQYnl/VhiENW7Zjv6o/ uqFbxBf+aQd4LzR5STUkzEFMTV9dSisxqsO0B8L/KRNlCcTRaQTHBRTO3dAEMRQCkCPDvxSfUGO0z hiyzPlj8Hz4EoB5Cf2C9weCZ2rii2mdtp1vI+IedMOFwxWLejRYWI6BNXiOOtRNqQSo5L6dROGUFS Whuon+Px47ReXtMamN1nC6mxaVX90xk5WGmhucalYsc5eKCU5zgD/HGglsWEY5QfVzT0aG/ZDBsV+ GhSYt2g8g==; Received: from mail-wm0-f43.google.com ([74.125.82.43]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dIxbh-0006ny-3u for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2017 13:36:14 +0000 Received: by mail-wm0-f43.google.com with SMTP id 7so138095556wmo.1 for ; Thu, 08 Jun 2017 06:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k/r4z303eX94bteFRo8kco07DVzA3Ft4GjTv/KDkOds=; b=JOCUdmsgJTGC4rF9pdGF37fyDt+vlRICCjHHO9J02YTaBms1nqsodT/G0CWDu9a8Gl q35L59sg6hrCUmQIN1M0y5OIgI5ih8oDjRBIQnpxF1CZ+nrwAGKq+9+H15wX/4wAK8nq 9QXA9zx/U8vI99TB0YScn5SXvE/CDujVKz/qM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k/r4z303eX94bteFRo8kco07DVzA3Ft4GjTv/KDkOds=; b=XYlitXSewa+i6uFVB5bPUfD3DbMoHzS8SV9OYsCdU4hUikDbF45O6Fmox/sYDJCGVf gz4NBxZYne/MYPrH+dYeB4hEZwCYTLjfqfFQEYNllzYSe/xe50I9yTfncBcnwlIpPn6i C2g+s5p+jDET5CVx7jYaKO7pWTaRqxKH0CVFKIWGyPsVfVctjUS0RJuUQm5RCd2pGfiB jAOWebjLUfh9JlfTdbl55ndiiJFTXByNgVMAfoHpvD2ilgdQ+15VH2NGzoJWEvPo233M sd6Li3GPVt2QqkVoUiaFyGMThi/e8YcsFNN0wHyv3Nk/Qc6o8ILkAlVEeuCOkNDkdVJ3 CNdA== X-Gm-Message-State: AODbwcANF+QVpe8rVxCJpVd8SM31NueqejwnmQQAbDGVTFVBUqymjtGa uWrfmqjICXFYjSWo1yF1tg== X-Received: by 10.80.151.221 with SMTP id f29mr17184632edb.126.1496928891152; Thu, 08 Jun 2017 06:34:51 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id i38sm3981285eda.18.2017.06.08.06.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Jun 2017 06:34:50 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/9] KVM: arm: Handle VCPU device attributes in guest.c Date: Thu, 8 Jun 2017 15:34:39 +0200 Message-Id: <20170608133446.3875-3-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170608133446.3875-1-cdall@linaro.org> References: <20170608133446.3875-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170608_093613_358990_BD335495 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Peter Maydell , kvm@vger.kernel.org, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As we are about to support VCPU attributes to set the timer IRQ numbers in guest.c, move the static inlines for the VCPU attributes handlers from the header file to guest.c. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 22 +++++++-------------- arch/arm/kvm/guest.c | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 00ad56e..127e2dd 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -291,20 +291,12 @@ static inline void kvm_arm_init_debug(void) {} static inline void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) {} static inline void kvm_arm_clear_debug(struct kvm_vcpu *vcpu) {} static inline void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) {} -static inline int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu, - struct kvm_device_attr *attr) -{ - return -ENXIO; -} -static inline int kvm_arm_vcpu_arch_get_attr(struct kvm_vcpu *vcpu, - struct kvm_device_attr *attr) -{ - return -ENXIO; -} -static inline int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu, - struct kvm_device_attr *attr) -{ - return -ENXIO; -} + +int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr); +int kvm_arm_vcpu_arch_get_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr); +int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr); #endif /* __ARM_KVM_HOST_H__ */ diff --git a/arch/arm/kvm/guest.c b/arch/arm/kvm/guest.c index fa6182a..acea05e 100644 --- a/arch/arm/kvm/guest.c +++ b/arch/arm/kvm/guest.c @@ -301,3 +301,45 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, { return -EINVAL; } + +int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr) +{ + int ret; + + switch (attr->group) { + default: + ret = -ENXIO; + break; + } + + return ret; +} + +int kvm_arm_vcpu_arch_get_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr) +{ + int ret; + + switch (attr->group) { + default: + ret = -ENXIO; + break; + } + + return ret; +} + +int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu, + struct kvm_device_attr *attr) +{ + int ret; + + switch (attr->group) { + default: + ret = -ENXIO; + break; + } + + return ret; +}