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: 9710257 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 D98346021C for ; Wed, 3 May 2017 18:33:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFA382861E for ; Wed, 3 May 2017 18:33:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C422F28627; Wed, 3 May 2017 18:33:10 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68BC22861E for ; Wed, 3 May 2017 18:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbdECSdI (ORCPT ); Wed, 3 May 2017 14:33:08 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36754 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751209AbdECSdF (ORCPT ); Wed, 3 May 2017 14:33:05 -0400 Received: by mail-wm0-f50.google.com with SMTP id u65so155650916wmu.1 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=OXD1u50v9wEulFaf/CyDVfT6zFw1/sE8FpwhPtyCyofkr7F2AU+mkF3gZLpGFcvs/w kskRcIs8GIKExm9jzH5wxjmii2gxhh88RtOGGVSKV22mMo8zU0rN7XRf9qIDAiJY1Gey CKRCQJYx53ncnuvdfJhkiFE+zRtoXAb3b0M4ubnyBgWDd3rZBlk4be1hXJQAy3asGFsq Yy8Bv4JcEuIRD09V2KYHrfkLc2Hd9Fli1fto9xq8xM5+gj/Oi3FdWuVc/Ml7+frSGTYZ UxgpUtqPQCiU6y9kvkI+puKZvBPu6RJvZeJOhoQ1vJ5GftY09fnK79EO6gvPFQluK6/0 /CnA== X-Gm-Message-State: AN3rC/6b3nmXi61eBvINQhfqwdhdWdvKdmwSeZZKfhDB9sLsjvxBCcPo z5of0snaws2+3GoiJnGE1w== 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 Cc: kvm@vger.kernel.org, Marc Zyngier , Alexander Graf , Peter Maydell , Christoffer Dall 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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; +}