From patchwork Thu Apr 18 16:06:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 10907611 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 1F01C13B5 for ; Thu, 18 Apr 2019 16:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02F0828B56 for ; Thu, 18 Apr 2019 16:07:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA33128CAC; Thu, 18 Apr 2019 16:07: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 6C92D28B56 for ; Thu, 18 Apr 2019 16:07: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: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:In-Reply-To: References:List-Owner; bh=dwafIkgOwakSVDSqOXEb/ZVZxWuvjpkS8nY6pbzwQII=; b=H7l QHlG00JfZlExcGVM7wM+Vkx0LjOf/w3wQlC2gqKxEv9mFcxsCSJi+MNyt4fXp9ppYvvpCeSL60Gr+ CQI8/EllTZ6hFyZLRM5vidB/kPY/rT7wT2peAuQQrOo2nXb/pRgz3C8xEwQKZldkNC5op/rjAE/cH KKjCMEelisukAa9/bdSVf/IbZ1Q2r0zloM6PKK5OA2qC/fEsr+JvJFVAieXrrsmr2C5yjjtJvQbJn gYUUgX4/m/g6GJE+J9snl64lBxFm92ycBnkWCxZ+34du/N5C8hiuLQCdinFGuHGKc1bC8RpAsXcdK HmSodMkqBJFUwHis7RAWFwsX6WMGjZA==; 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 1hH9ZM-0005xu-39; Thu, 18 Apr 2019 16:07:24 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH9ZI-0005xb-FM for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 16:07:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 88F5015AB; Thu, 18 Apr 2019 09:07:17 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 73FBE3F5AF; Thu, 18 Apr 2019 09:07:15 -0700 (PDT) From: Dave Martin To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 00/14] KVM: arm64: SVE cleanups Date: Thu, 18 Apr 2019 17:06:57 +0100 Message-Id: <1555603631-8107-1-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_090720_525607_3095366D X-CRM114-Status: GOOD ( 10.17 ) 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: Peter Maydell , Okamoto Takayuki , Christoffer Dall , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Will Deacon , Andrew Jones , Zhang Lei , Julien Grall , =?utf-8?q?Alex_Benn=C3=A9e?= , linux-arm-kernel@lists.infradead.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 This series contains some cleanups applicable to the SVE KVM support patches merged into kvmarm/next. These arose from Andrew Jones' review. Apart from some minor changes to error codes and checking, these are mostly cosmetic / sytlistic changes only. The patches are based on git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next 5d8d4af24460 ("arm64: KVM: Fix system register enumeration") This series in git: git://linux-arm.org/linux-dm.git sve-kvm-fixes/v2/head http://linux-arm.org/git?p=linux-dm.git;a=shortlog;h=refs/heads/sve-kvm-fixes/v2/head Tested with qemu and kvmtool on ThunderX2, and with kvmtool on the Arm Fast model (to exercise SVE support). Some additional manual testing was done to exercise the updated error behaviours when accessing the SVE registers via ioctl. Dave Martin (14): arm64/sve: Clarify vq map semantics KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE KVM: arm: Make vcpu finalization stubs into inline functions KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs KVM: arm64/sve: Clean up UAPI register ID definitions KVM: arm64/sve: Miscellaneous tidyups in guest.c KVM: arm64/sve: Make register ioctl access errors more consistent KVM: arm64/sve: WARN when avoiding divide-by-zero in sve_reg_to_region() KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing KVM: arm64/sve: Explain validity checks in set_sve_vls() KVM: arm/arm64: Clean up vcpu finalization function parameter naming KVM: Clarify capability requirements for KVM_ARM_VCPU_FINALIZE KVM: Clarify KVM_{SET,GET}_ONE_REG error code documentation KVM: arm64: Clarify access behaviour for out-of-range SVE register slice IDs Documentation/virtual/kvm/api.txt | 24 ++++++----- arch/arm/include/asm/kvm_host.h | 13 ++++-- arch/arm64/include/asm/fpsimd.h | 4 -- arch/arm64/include/asm/kvm_host.h | 4 +- arch/arm64/include/uapi/asm/kvm.h | 32 ++++++++++---- arch/arm64/kernel/fpsimd.c | 7 ++- arch/arm64/kvm/guest.c | 91 +++++++++++++++++++++++---------------- arch/arm64/kvm/reset.c | 6 +-- arch/arm64/kvm/sys_regs.c | 4 +- virt/kvm/arm/arm.c | 2 +- 10 files changed, 116 insertions(+), 71 deletions(-) Reviewed-by: Alex Bennée