From patchwork Tue May 16 18:45:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9729513 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 1BBE160386 for ; Tue, 16 May 2017 18:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C58A1FFB9 for ; Tue, 16 May 2017 18:47:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F267828631; Tue, 16 May 2017 18:47:28 +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 9B8A21FFB9 for ; Tue, 16 May 2017 18:47:28 +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=Cc9jsGWttgoTE6u04ggGnlvgBLz7xZj+qR3g+7LIkCY=; b=A+dX86/Ww+HKrl3ZGJTHcVohp9 4qRBzkzpG6VY5bTESKjad5D9JA/sLwFu9x6y3ZJ3eaHAXlBz8oM3M4jSGWmxQ8RX/xPIQQrAR02gx dlGPHb42ueum+bvSfNeJsHiF0a1GLzCJPKLQ8UbUs80YCgBETrZxn3sKSmzeTNMtodMRmOrBwQIXp MCzwq2gZWcnszcwGqyKHJk4TfoHXoCwzwG8009C/zsrbqBjdTLyWMn9sQ5OJxyE49NoDAPDBINd2b RcBdY7z2SHaed0+kXt+UVc5efs4yilblQ41RJ7/A+7u7NW3C3/GbPpUBmtKnUNsTLpdQrv1JpKNyu thAKgI3A==; 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 1dAhVG-0003JO-O5; Tue, 16 May 2017 18:47:26 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dAhUY-0002O4-Hp for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2017 18:46:44 +0000 Received: by mail-wm0-x236.google.com with SMTP id d127so129519660wmf.0 for ; Tue, 16 May 2017 11:46:19 -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=UmpTNglKJ99bSp4qLlM07RiGysOkBmTZPGLxRfblHxc=; b=Mc6wVlOjLkJHdAVjJbjlSmGF2Gnj/OJdmWgMOYvoRy5HhVpW+IjiA34YH6k7MsL2qO uX+D3BQm/RIo8kRtXlW7ttmqsE8l7kD9lIwuDlNbnnPTxN72v6+uaCecwDrjC/fBYGNV ry8+easO+GFpnDlHRBHhkos9phc1p4kK47wUY= 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=UmpTNglKJ99bSp4qLlM07RiGysOkBmTZPGLxRfblHxc=; b=kjV3btWOyjWe0gB3YPMpbNYjjUvtsiD0dxI62lDzSI5FGI38adUtsJCPJoRPZMjZO0 C2br8i7cMzhJq6fO5DBHSpwCwTRCeMZWslTRvC4q1mpsHss3Wqu72CXn20zLkdCl9o/K 9boF6dzUb/rwSFQt5u6pqKmo0/gO+nHd7BBXsANhiyv77S3yfqmVUlB9qHwpmK3qmcYg I8M7UPiVrEydJeksOL7fzmyAh0xnojcDBv0sHx+ceqddAYYwuFZHUz3SbBabHBEktyHn 4ktMgC3N2/HY01ABQPw/UWaKkdSFeXo5UB7zSauHJbh1OBmDR+mSbznnnftRIvViWatP wwoA== X-Gm-Message-State: AODbwcBA1zOOcirolKambNzub4LQHcyrM+IqKsmhSHYOBFFefnCrKUec RGuNepWqNp//5hKZ X-Received: by 10.80.174.131 with SMTP id e3mr86671edd.166.1494960378080; Tue, 16 May 2017 11:46:18 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id c2sm25102edc.34.2017.05.16.11.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 May 2017 11:46:17 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/9] KVM: arm: Handle VCPU device attributes in guest.c Date: Tue, 16 May 2017 20:45:49 +0200 Message-Id: <20170516184556.26785-3-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170516184556.26785-1-cdall@linaro.org> References: <20170516184556.26785-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170516_114642_742134_51D561BB X-CRM114-Status: GOOD ( 12.23 ) 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 , Christoffer Dall , Alexander Graf , kvm@vger.kernel.org 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 f0e6657..26c1195 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; +}