qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 18/26] kvm: Introduce support for memory_attributes


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 18/26] kvm: Introduce support for memory_attributes
Date: Mon, 25 Mar 2024 10:31:08 +0100
User-agent: Mozilla Thunderbird

On 22/3/24 19:11, Paolo Bonzini wrote:
From: Xiaoyao Li <xiaoyao.li@intel.com>

Introduce the helper functions to set the attributes of a range of
memory to private or shared.

This is necessary to notify KVM the private/shared attribute of each gpa
range. KVM needs the information to decide the GPA needs to be mapped at
hva-based shared memory or guest_memfd based private memory.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20240320083945.991426-11-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  include/sysemu/kvm.h |  4 ++++
  accel/kvm/kvm-all.c  | 31 +++++++++++++++++++++++++++++++
  2 files changed, 35 insertions(+)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 54f4d83a370..bda309d5ffa 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -536,4 +536,8 @@ void kvm_mark_guest_state_protected(void);
   * reported for the VM.
   */
  bool kvm_hwpoisoned_mem(void);
+
+int kvm_set_memory_attributes_private(hwaddr start, hwaddr size);
+int kvm_set_memory_attributes_shared(hwaddr start, hwaddr size);

uint64_t size? (kvm_memory_attributes::size is __u64).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]