From patchwork Mon Oct 8 12:34:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10629979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2433113BB for ; Mon, 8 Oct 2018 04:28:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119C028565 for ; Mon, 8 Oct 2018 04:28:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03C3928683; Mon, 8 Oct 2018 04:28:18 +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.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7C30228649 for ; Mon, 8 Oct 2018 04:28:17 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=XM2LBDkeW8DLLkX0xpK3dnvEPaQiXoVEYP72o+DNB6w=; b=aBmnbFM7iW04dJ RLVEM7r89eoO2mVj/8RKsnFdUCORsNLtsod1PAZWK3ajE4smEBU2lZlk+mab7lJuLAj0ktMcpg45j 4D3mFqSDyCM/1n+xbK5Ure4I6J6i3kBp8yTA6g1eoNNofs69cb7jnSQ+pvZBL34iceiVBtFPLqWb8 VwSrn22etoZgBoxfqzMJsI1RxJIc+T0qgMlNlVuF/tqAnaQkDFgsGN+ThQoZ8tJoctSaRprO2sHQK EqQxW5vCrUg7ftsNUyt4iwzJCCSvlZLmafV+I6u7p+m/sa95YWuMK7So3tiDfCQzO5PBLvj8ch9r+ lYxwjwnVIRKYEaeRrumg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9N9J-0002Jl-0x; Mon, 08 Oct 2018 04:28:05 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9N8l-0001s5-4s for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 04:27:33 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 93DC263D172A0; Mon, 8 Oct 2018 12:27:15 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.399.0; Mon, 8 Oct 2018 12:27:06 +0800 From: Dongjiu Geng To: , , , , , , , , Subject: [PATCH v2 2/2] arm/arm64: KVM: enable 32 bits kvm vcpu events support Date: Mon, 8 Oct 2018 08:34:48 -0400 Message-ID: <1539002088-21215-3-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539002088-21215-1-git-send-email-gengdongjiu@huawei.com> References: <1539002088-21215-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181007_212731_395086_1EE90E3D X-CRM114-Status: GOOD ( 11.88 ) 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: gengdongjiu@huawei.com 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 The commit 539aee0edb9f ("KVM: arm64: Share the parts of get/set events useful to 32bit") shares the get/set events helper for arm64 and arm32, it is better also share the check for vcpu events capability to enable 32 bit kvm vcpu events support. User space will check whether KVM supports vcpu events through KVM_CAP_VCPU_EVENTS IOCTL. Cc: James Morse Signed-off-by: Dongjiu Geng --- For the 32 bits kvm migration, it needs to enable the vcpu events, this patch will enable it. The user space QEMU patch is here: https://patchwork.ozlabs.org/patch/975615/ --- arch/arm64/kvm/reset.c | 1 - virt/kvm/arm/arm.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index fd37c53..e50245e 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -82,7 +82,6 @@ int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext) break; case KVM_CAP_SET_GUEST_DEBUG: case KVM_CAP_VCPU_ATTRIBUTES: - case KVM_CAP_VCPU_EVENTS: r = 1; break; default: diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 40e79ea..64e5d97 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -212,6 +212,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_READONLY_MEM: case KVM_CAP_MP_STATE: case KVM_CAP_IMMEDIATE_EXIT: + case KVM_CAP_VCPU_EVENTS: r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: