qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>,
	peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, pbonzini@redhat.com,
	eblake@redhat.com, armbru@redhat.com, berrange@redhat.com,
	eduardo@habkost.net, alex.bennee@linaro.org
Subject: Re: [RFC PATCH 16/16] target/arm/kvm-rme: Disable readonly mappings
Date: Fri, 27 Jan 2023 14:54:44 -1000	[thread overview]
Message-ID: <1381246a-e2b7-2810-8a4a-c1a6d6e9c853@linaro.org> (raw)
In-Reply-To: <20230127150727.612594-17-jean-philippe@linaro.org>

On 1/27/23 05:07, Jean-Philippe Brucker wrote:
> KVM does not support creating read-only mappings for realms at the
> moment. Add an arch helper to detect whether read-only mappings are
> supported.
> 
> Device ROM and flash normally use read-only mappings. Device ROM seems
> limited to legacy use and does not need to be trusted by the guest, so
> trapping reads should be fine. Flash on the other hand, is used for the
> firmware and needs to be both executable and measured. It may be
> necessary to replace flash with RAM in order to run firmwares like edk2
> in realms.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>   include/sysemu/kvm.h | 2 ++
>   accel/kvm/kvm-all.c  | 8 +++++++-
>   target/arm/kvm-rme.c | 9 +++++++++
>   3 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index e9a97eda8c..8d467c76c6 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -581,5 +581,7 @@ bool kvm_arch_cpu_check_are_resettable(void);
>   
>   bool kvm_dirty_ring_enabled(void);
>   
> +bool kvm_arch_readonly_mem_allowed(KVMState *s);
> +
>   uint32_t kvm_dirty_ring_size(void);
>   #endif
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index f99b0becd8..56cdd2e9e9 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -2267,6 +2267,11 @@ bool kvm_dirty_ring_enabled(void)
>       return kvm_state->kvm_dirty_ring_size ? true : false;
>   }
>   
> +bool __attribute__((weak)) kvm_arch_readonly_mem_allowed(KVMState *s)
> +{
> +    return true;
> +}

Not a fan of the weak.  Just populate this like kvm_arch_cpu_check_are_resettable.


r~


      reply	other threads:[~2023-01-28  0:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 15:07 [RFC PATCH 00/16] arm: Run Arm CCA VMs with KVM Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 01/16] NOMERGE: Add KVM Arm RME definitions to Linux headers Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 02/16] target/arm: Add confidential guest support Jean-Philippe Brucker
2023-01-27 19:50   ` Richard Henderson
2023-01-28  0:03   ` Philippe Mathieu-Daudé
2023-01-27 15:07 ` [RFC PATCH 03/16] target/arm/kvm-rme: Initialize realm Jean-Philippe Brucker
2023-01-27 20:37   ` Richard Henderson
2023-02-08 12:07     ` Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 04/16] hw/arm/virt: Add support for Arm RME Jean-Philippe Brucker
2023-01-27 21:07   ` Richard Henderson
2023-02-08 12:08     ` Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 05/16] target/arm/kvm: Split kvm_arch_get/put_registers Jean-Philippe Brucker
2023-01-27 22:16   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 06/16] target/arm/kvm-rme: Initialize vCPU Jean-Philippe Brucker
2023-01-27 22:19   ` Richard Henderson
2023-01-27 22:37   ` Richard Henderson
2023-02-08 12:09     ` Jean-Philippe Brucker
2023-01-27 23:04   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 07/16] target/arm/kvm: Select RME VM type for the scratch VM Jean-Philippe Brucker
2023-01-27 22:39   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 08/16] target/arm/kvm-rme: Populate the realm with boot images Jean-Philippe Brucker
2023-01-27 23:54   ` Richard Henderson
2023-02-08 12:10     ` Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 09/16] hw/arm/boot: Populate realm memory " Jean-Philippe Brucker
2023-01-27 15:07 ` [RFC PATCH 10/16] target/arm/kvm-rme: Add measurement algorithm property Jean-Philippe Brucker
2023-01-28  0:04   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 11/16] target/arm/kvm-rme: Add Realm Personalization Value parameter Jean-Philippe Brucker
2023-01-28  0:07   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 12/16] target/arm/kvm-rme: Add Realm SVE vector length Jean-Philippe Brucker
2023-01-28  0:22   ` Richard Henderson
2023-01-28  0:31   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 13/16] target/arm/kvm-rme: Add breakpoints and watchpoints parameters Jean-Philippe Brucker
2023-01-28  0:33   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 14/16] target/arm/kvm-rme: Add PMU num counters parameters Jean-Philippe Brucker
2023-01-28  0:34   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 15/16] target/arm/kvm: Disable Realm reboot Jean-Philippe Brucker
2023-01-28  0:35   ` Richard Henderson
2023-01-27 15:07 ` [RFC PATCH 16/16] target/arm/kvm-rme: Disable readonly mappings Jean-Philippe Brucker
2023-01-28  0:54   ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381246a-e2b7-2810-8a4a-c1a6d6e9c853@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jean-philippe@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).