From patchwork Wed May 3 18:32:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9710269 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 6D9CC6021C for ; Wed, 3 May 2017 18:34:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 624B428622 for ; Wed, 3 May 2017 18:34:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609DD2869C; Wed, 3 May 2017 18:34:08 +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 BFA6A28692 for ; Wed, 3 May 2017 18:34:07 +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=pJVpjeRLPNRl0z+YgKX13nygrnGTfdV2QThAkTyZ7Kc=; b=Y1tTOj99Fd2rqyyxO/11hQUHSc 6P82rKHJf73KBPH9ZZvXr9D3WPpbCHJqR7yJpA5z2z5TIs9Pelum3v6LlK8eEtZVgZ6ieOFlXhqQG OABQjZoA8fCafIfSrYrTDh5tOM8Ztw604Wzgi+lC4Tj1wt2ORtsgGpUeByxbSXtRZOzHgKvMoVvT3 VRdWR6xTLQ+hAA++xwfV3nkvXVPxbv9NGX49vDOiyWr84XPRTPnizUu49mM31S3wZDa/aqCGMgpZR Vy35ruiw0n+nreEGbbAllhtfQEv25hPo1cwzirCvJ+UVBE22ZjoRZWbbP5ZizrAb4+frBZtM2Msxn aY88nB4Q==; 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 1d5z6E-0004kz-Dr; Wed, 03 May 2017 18:34:06 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5z5Z-0003vs-Ne for linux-arm-kernel@lists.infradead.org; Wed, 03 May 2017 18:33:28 +0000 Received: by mail-wm0-x232.google.com with SMTP id w64so155890492wma.0 for ; Wed, 03 May 2017 11:33:05 -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=BTj4z99wCQKkhQVPrqEnSC1lSmlrsd5T5jwKHDTNvz4=; b=HuFgF4MljhBC0Lewliz9Z4IHGJ2UdKTNXlXlcmJ8DyiNZNPJjBAMOOVL1JiLmdoQuH r6cf0BM04cMeP9WcXpKOt6+aqVuk40zSfMrN4Ko+KA4U0HzxqKoWwZV1HIsTI1QrID8C EpV5NJw0VNkyzrIin8+KLjGRYvJK18Vika9dk= 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=BTj4z99wCQKkhQVPrqEnSC1lSmlrsd5T5jwKHDTNvz4=; b=CMhttPjIcreFSUgIvIxE0fV5Tb1f1MmGsTb+C5Zg4eV41BtsEgPndnAhT1cnSfimE8 vYOLzOjhRIfXvSZPCl37gxw1CeMoKJcumLakxU/xGpjntBkY1Tw41mVS9xoxh6UKpRVy TeopraXqFWGiorhz96QQDoa71iBEYcFSmOYtYm+VsK6WLRME4wveLFUhXSePoSJmVzvK 741srW3BepPQgFUnkVR2IQbZ975xp3J+K3cw/SVBk0XM1rOrCnL4ziC179CNxoEedAJU 6n0/uV3fwusjpvSUO+5nn2WnIdTejGCGxJ7T5EJijkB+VOhsasbMVF2bRapg+faoeiwe Tfvw== X-Gm-Message-State: AN3rC/6CXuEj36lAir+3X4dOtVulyNq9NgGMR/4n3GcWSi7EO/+VZ6y7 GqxrlfcFzV2xreh5 X-Received: by 10.80.146.211 with SMTP id l19mr27174362eda.160.1493836383945; Wed, 03 May 2017 11:33:03 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id x2sm10666038edb.49.2017.05.03.11.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 May 2017 11:33:03 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/5] KVM: arm: Handle VCPU device attributes in guest.c Date: Wed, 3 May 2017 20:32:57 +0200 Message-Id: <20170503183300.4618-3-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170503183300.4618-1-cdall@linaro.org> References: <20170503183300.4618-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170503_113325_917086_7233D6B2 X-CRM114-Status: GOOD ( 12.09 ) 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 , Alexander Graf , 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 --- 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 d488b88..0e8c233 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -292,20 +292,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; +}