From patchwork Thu Aug 22 15:10:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13773678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73589C531DF for ; Thu, 22 Aug 2024 15:12:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 095DA80036; Thu, 22 Aug 2024 11:12:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 045608001E; Thu, 22 Aug 2024 11:12:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E016B80036; Thu, 22 Aug 2024 11:12:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C0AC08001E for ; Thu, 22 Aug 2024 11:12:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 692D34064D for ; Thu, 22 Aug 2024 15:12:01 +0000 (UTC) X-FDA: 82480221642.21.2E88DF5 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf03.hostedemail.com (Postfix) with ESMTP id 9B4232000C for ; Thu, 22 Aug 2024 15:11:59 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724339412; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LhhrQ4+z6yOEiKUoxQMrbV+q630Q9+dPEjR6MmHWyIE=; b=EZjlvYliDl3VXTEX78irKqKi7numQFJIAlz/DoIhW4FtbZRi7XKGdAIxn0SvIeYRBxqiZ6 k5+d9S3prBJaEoD4OhlWIRBx5MASfnLM6tYcYr22O+luGWSLFL/Z5cOolGufnZm7uN1Gj3 Uu6rRwvLgZfwEe9Sem3gcOHKBFioNRI= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724339412; a=rsa-sha256; cv=none; b=IIfeGM5D/rXsxGHshhc0ms8X4Ce6cPIsU+PC1WSrQIXuZkN00Grnhoo6noVbwfqEN0NJdV 2wUBYdY9FFLcO6H3fyS2Q3Z7U+pLiz4cH+nQgQ3sA+EYXiVVevgGTaz8IkJjMSrSwEnvR2 4LDudSeOIjClnrr/LHO78fdO7Yn4UIo= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E3E751650; Thu, 22 Aug 2024 08:12:24 -0700 (PDT) Received: from e124191.cambridge.arm.com (e124191.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C53D43F58B; Thu, 22 Aug 2024 08:11:54 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: nd@arm.com, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, joey.gouly@arm.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, maz@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, skhan@linuxfoundation.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org Subject: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_* Date: Thu, 22 Aug 2024 16:10:51 +0100 Message-Id: <20240822151113.1479789-9-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240822151113.1479789-1-joey.gouly@arm.com> References: <20240822151113.1479789-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9B4232000C X-Stat-Signature: 8ujp3uw18t8dewwpadeni6ndadxppn83 X-Rspam-User: X-HE-Tag: 1724339519-380954 X-HE-Meta: U2FsdGVkX18Dly3DRGLHgVR7XKVWUDztOTNcPglPPqcOedjpVp25ES9A80aVivGoRuWbtMzGeFz+JAYOCuL8h8v0uVNtkJW+XCUNidQSwFFx2SxYvG1MaqkNas8iRyVhQ/WN1oiH3L8h0EHgjlBPk2vYq2yAP9xgeGpC1l8ImQNlVxrr6wOcRZD9GwnEz8j2SqzwnPjcYIHlcYwxJYbPOhu33F9IF5ILsAx8gtLP6ALyPZrudo0WDA4Iy0BXkW1yRFvC2NTmGDDcRfvpb1tZuqsKACA8gxXPrpwa/54nmphe7mkgWUMZHBDGe2Hbh7bVHUq2BqgX8jiyd9rPjAYYcN4IfNqpnQXWG2QKPUOj2kSqXgBSz3s8SwoiMqgfGyT/JnlGcA9qvhooYh+sSRU785A377h5oVIlu3jVy/+OBlZ5WceTgxOSnL0EP5qjVN3LU2jMTQja8H5MNTxxVXcNh8YEWrjwXoLamLOx/bPmDVhV/GvmKWcfARpppsNGUsUXNq8sIm/pcrtwBPAKg0PWKWE6/BZnKGMnRBtFJThr6YKtAMyyQOgpWRd36z/y2ptbVfUaaCQ5X7TjftJsk/ofFR0tlOYfuJjWyVMNLOktx0EpjBiQ+3izkKDVJ/fbWaP1MQk8GTTNrtDpmGCW6TC0kEjcD8Ia0Jw+bLiB/BYD1M30p/zvRnccWNdOJn0BltUc26A7pk+0P3hFzey3VT+HewHiWDFEyvSVRlZDgPR7UIITVB2x1O2gOZztXneZtHGkOLkJ/yATdsmKVjdjdNKJUyZtIO7rVlv2ZB5XDbHfNR7HiVo4vsrwQU6TZ1bnrtMkx4G3lbPNR4gPEBvc6wjUzelm05l15cn5IcItWapR1OSnGbvjM1wAsRTVI7XkvuAzRbg3l3m9e67PnOSWvkwneMjM3OuCY7ZjJMLSBGgaA/2x1UiYHDb061gps3GOn/wFz/ERS/rwZoh68gOHO/P Nx/Vxu6A 4pisOAwNEDNEKMAnxvsPFJDR0m/6XU5YcB4iecgpeiDK6hs25uW+8lw1862QTdQPPPTUFQV+k9FyvHxHJJyi4W2F9wM/MuC3UVXV5OaptqIVHJI4rphsvZeWO8crnabM3cs94R6ZRpVbblkQQ7gimbYCaxTMeO4qYlZSjyP3TKmwh5lpml7+GxVYr573UsigNTOm0Ev6Xd3DTlvNn7XGC92VSmjHeAr6r9kq3ljGQVV9G2Zc6keUUNWDwqW8MnzeGn0Sh/Hvj/dnYO1A= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: To allow using newer instructions that current assemblers don't know about, replace the `at` instruction with the underlying SYS instruction. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Marc Zyngier Acked-by: Will Deacon --- arch/arm64/include/asm/kvm_asm.h | 3 ++- arch/arm64/kvm/hyp/include/hyp/fault.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git arch/arm64/include/asm/kvm_asm.h arch/arm64/include/asm/kvm_asm.h index 2181a11b9d92..38d7bfa3966a 100644 --- arch/arm64/include/asm/kvm_asm.h +++ arch/arm64/include/asm/kvm_asm.h @@ -9,6 +9,7 @@ #include #include +#include #include #define ARM_EXIT_WITH_SERROR_BIT 31 @@ -259,7 +260,7 @@ extern u64 __kvm_get_mdcr_el2(void); asm volatile( \ " mrs %1, spsr_el2\n" \ " mrs %2, elr_el2\n" \ - "1: at "at_op", %3\n" \ + "1: " __msr_s(at_op, "%3") "\n" \ " isb\n" \ " b 9f\n" \ "2: msr spsr_el2, %1\n" \ diff --git arch/arm64/kvm/hyp/include/hyp/fault.h arch/arm64/kvm/hyp/include/hyp/fault.h index 9e13c1bc2ad5..487c06099d6f 100644 --- arch/arm64/kvm/hyp/include/hyp/fault.h +++ arch/arm64/kvm/hyp/include/hyp/fault.h @@ -27,7 +27,7 @@ static inline bool __translate_far_to_hpfar(u64 far, u64 *hpfar) * saved the guest context yet, and we may return early... */ par = read_sysreg_par(); - if (!__kvm_at("s1e1r", far)) + if (!__kvm_at(OP_AT_S1E1R, far)) tmp = read_sysreg_par(); else tmp = SYS_PAR_EL1_F; /* back to the guest */