From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 999361B0416; Tue, 20 May 2025 12:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747745110; cv=none; b=td1hc7RWQYTye3fv/a+SOeQFcnTDbQMVsTHEvB+4XorLZSxNuLu13q56kNHrtrEZo2GJl3A7F/DLZ/9HRwn10T23oMn7Bq9mRCiaMFPbeVWU3v4Cy4VCCt2935NkLjq6kN4xOZvapQxOyKbK0V7KnsAochLNUKLdkfXrIAv5IeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747745110; c=relaxed/simple; bh=NzdOdgoQ23Hz5lBHiviB4k5++/DN2bgjc3n42aDFjM0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YJAIUY67OgxohZdkS3j53qXtn9CWV2lf0qZQJvgJ7wTJF/0jbVJrZpi4E5Svp3M+YQh9DjGDsEUzkfgSQHUnaU9o2J+VSt7tKdX0y8HHN2n7W5VmXtcfOn/6tL+gsc97u3qBfp27+iG27N/7rvgYdZSm/KpJ2ljUAUoeVA3P6pc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 5BE211516; Tue, 20 May 2025 05:44:53 -0700 (PDT) Received: from [10.1.36.74] (Suzukis-MBP.cambridge.arm.com [10.1.36.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7D77A3F5A1; Tue, 20 May 2025 05:45:03 -0700 (PDT) Message-ID: Date: Tue, 20 May 2025 13:45:02 +0100 Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 33/43] arm64: RME: Hide KVM_CAP_READONLY_MEM for realm guests Content-Language: en-GB To: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , 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 , "Aneesh Kumar K . V" References: <20250416134208.383984-1-steven.price@arm.com> <20250416134208.383984-34-steven.price@arm.com> From: Suzuki K Poulose In-Reply-To: <20250416134208.383984-34-steven.price@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/04/2025 14:41, Steven Price wrote: > For protected memory read only isn't supported by the RMM. While it may > be possible to support read only for unprotected memory, this isn't > supported at the present time. > > Note that this does mean that ROM (or flash) data cannot be emulated > correctly by the VMM as the stage 2 mappings are either always > read/write or are trapped as MMIO (so don't support operations where the > syndrome information doesn't allow emulation, e.g. load/store pair). > > This restriction can be lifted in the future by allowing the stage 2 minor nit: s/allowing the/allowing the unprotected/ > mappings to be made read only. > > Signed-off-by: Steven Price Reviewed-by: Suzuki K Poulose > --- > Changes since v7: > * Updated commit message to spell out the impact on ROM/flash > emulation. > --- > arch/arm64/kvm/arm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 8060e25afbd0..4780e3af1bb9 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -340,7 +340,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > case KVM_CAP_ONE_REG: > case KVM_CAP_ARM_PSCI: > case KVM_CAP_ARM_PSCI_0_2: > - case KVM_CAP_READONLY_MEM: > case KVM_CAP_MP_STATE: > case KVM_CAP_IMMEDIATE_EXIT: > case KVM_CAP_VCPU_EVENTS: > @@ -355,6 +354,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) > r = 1; > break; > case KVM_CAP_COUNTER_OFFSET: > + case KVM_CAP_READONLY_MEM: > case KVM_CAP_SET_GUEST_DEBUG: > r = !kvm_is_realm(kvm); > break;