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 C9455C52D7C for ; Thu, 22 Aug 2024 15:07:30 +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=Q8A+NGf+ZRw+nDDLuJ4Hm/bgVUQpECUYoqg7SJ1Nzqc=; b=fbrHPlswGJJt7K1oKfc97z5APc 8XKNE9PyFRXHU5puLuwa6HMi0nVSUSl3Tsq4z7a82KVn39hSwJZjaxOjxSjhIlu5fU1t2d6iyckr3 OhDzYL5D34vlYRBUdiGyOYmd03wUt7/gtncq1Si8ywkI70c7AWOjeODN6SK3X40MP3bAbd65i2oxg IAqLYNThtO9he9kbjHsfLn0PrsetoXDI+7to6KikG+ZhjVLTkDf8zBOfTNrKH1uuXcnVj74zai+8m oK+Sa6NDBafMVQ6gFEKBKS49KpxXyc5Lcd5byAnvUX2NFSdoqxlgxleLDdJSZSzpbnWkFAJtJwYZU ADikq0Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh9PD-0000000DHAf-1z0B; Thu, 22 Aug 2024 15:07:19 +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 1sh9Ns-0000000DGqk-0K7d for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 15:05:57 +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 8A9A1DA7; Thu, 22 Aug 2024 08:06:21 -0700 (PDT) Received: from [10.57.85.214] (unknown [10.57.85.214]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7774D3F58B; Thu, 22 Aug 2024 08:05:51 -0700 (PDT) Message-ID: <7bbd5f46-de70-4158-a790-d2aa90d32929@arm.com> Date: Thu, 22 Aug 2024 16:05:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 18/43] arm64: RME: Handle realm enter/exit To: "Aneesh Kumar K.V" , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun References: <20240821153844.60084-1-steven.price@arm.com> <20240821153844.60084-19-steven.price@arm.com> From: Steven Price Content-Language: en-GB In-Reply-To: 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-20240822_080556_203775_6E764ABF X-CRM114-Status: GOOD ( 13.23 ) 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 22/08/2024 04:58, Aneesh Kumar K.V wrote: > Steven Price writes: > >> + /* Exit to VMM to complete the change */ >> + kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false, >> + ripas == 1); >> + > > > s/1/RMI_RAM ? Ah, good spot - I must have missed that when I added the definitions. > May be we can make it an enum like rsi_ripas I guess that makes sense - I tend to avoid enums where the value is controlled by something external, but here it makes some sense. Thanks, Steve > modified arch/arm64/include/asm/rmi_smc.h > @@ -62,9 +62,11 @@ > #define RMI_ERROR_REC 3 > #define RMI_ERROR_RTT 4 > > -#define RMI_EMPTY 0 > -#define RMI_RAM 1 > -#define RMI_DESTROYED 2 > +enum rmi_ripas { > + RMI_EMPTY, > + RMI_RAM, > + RMI_DESTROYED, > +}; > > #define RMI_NO_MEASURE_CONTENT 0 > #define RMI_MEASURE_CONTENT 1 > modified arch/arm64/kvm/rme-exit.c > @@ -112,7 +112,7 @@ static int rec_exit_ripas_change(struct kvm_vcpu *vcpu) > > /* Exit to VMM to complete the change */ > kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false, > - ripas == 1); > + ripas == RMI_RAM); > > return 0; > }