From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6EE0EC2BD09 for ; Fri, 12 Jul 2024 08:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zsuaLMnCgJbxJioVS7pt0grxtsDZlvfFmIDk67s7KyI=; b=EfPn6up3z4nhB725hm27c/zIh/ Svi/fF59TCVC/ABBobbDojSFb72+bMMzk+14/RKeGAF6iIsaWFO45jmF/PVnkhGbUEbl/bxw/0C12 d+nhNBecdbF1OIXpq4JPRnJbieo9/1GOVRanwGpfagFstkN6HjXR4lUND+PqJWfOI7PjVTz+oO2L3 JUhQZ4X2joDAY2Z1gM2ULHDMmpjoyieS85RYXSt+1M5DjpvK1qvDILowKrEIs2A53gQ4p6Yl4dJqD HwvRdrtGrmmXO6FmoDmFIkI+xv9cz25nCMqdHwXcgFN/m3y+BBjTBd2fCI8+SRvUhtcAxTLZ5IV/J KrQLvcmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSC11-0000000GyVJ-0AnG; Fri, 12 Jul 2024 08:52:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSC0i-0000000GyOc-2zZD for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 08:52:14 +0000 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 668C31007; Fri, 12 Jul 2024 01:52:36 -0700 (PDT) Received: from [10.162.16.42] (a077893.blr.arm.com [10.162.16.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 72D8B3F641; Fri, 12 Jul 2024 01:52:08 -0700 (PDT) Message-ID: Date: Fri, 12 Jul 2024 14:22:05 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/12] KVM: arm64: make kvm_at() take an OP_AT_* To: Marc Zyngier , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Joey Gouly References: <20240625133508.259829-1-maz@kernel.org> <20240625133508.259829-6-maz@kernel.org> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20240625133508.259829-6-maz@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_015212_834896_4332272A X-CRM114-Status: GOOD ( 13.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/25/24 19:05, Marc Zyngier wrote: > From: Joey Gouly > > 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 > Signed-off-by: Marc Zyngier > --- > 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 a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index 2181a11b9d925..25f49f5fc4a63 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > > #define ARM_EXIT_WITH_SERROR_BIT 31 > #define ARM_EXCEPTION_CODE(x) ((x) & ~(1U << ARM_EXIT_WITH_SERROR_BIT)) > @@ -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 a/arch/arm64/kvm/hyp/include/hyp/fault.h b/arch/arm64/kvm/hyp/include/hyp/fault.h > index 9e13c1bc2ad54..487c06099d6fc 100644 > --- a/arch/arm64/kvm/hyp/include/hyp/fault.h > +++ b/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 */ LGTM, FWIW Reviewed-by: Anshuman Khandual