aboutsummaryrefslogtreecommitdiff
path: root/system/memory.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-04-23 17:35:57 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-04-23 17:35:57 -0700
commit13b1e9667737132440f4d500c31cb69320c6b15a (patch)
treec598a1b459bdb3fceabc97393178d34497f65e4a /system/memory.c
parent1a6f53953df65f31e922f8a1763dac9f10adc81b (diff)
parent7653b44534d3267fa63ebc9d7221eaa7b48bf5ae (diff)
downloadqemu-13b1e9667737132440f4d500c31cb69320c6b15a.zip
qemu-13b1e9667737132440f4d500c31cb69320c6b15a.tar.gz
qemu-13b1e9667737132440f4d500c31cb69320c6b15a.tar.bz2
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* cleanups for stubs * do not link pixman automatically into all targets * optimize computation of VGA dirty memory region * kvm: use configs/ definition to conditionalize debug support * hw: Add compat machines for 9.1 * target/i386: add guest-phys-bits cpu property * target/i386: Introduce Icelake-Server-v7 and SierraForest models * target/i386: Export RFDS bit to guests * q35: SMM ranges cleanups * target/i386: basic support for confidential guests * linux-headers: update headers * target/i386: SEV: use KVM_SEV_INIT2 if possible * kvm: Introduce support for memory_attributes * RAMBlock: Add support of KVM private guest memfd * Consolidate use of warn_report_once() * pythondeps.toml: warn about updates needed to docs/requirements.txt * target/i386: always write 32-bits for SGDT and SIDT # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmYn1UkUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroO1nwgAhRQhkYcdtFc649WJWTNvJCNzmek0 # Sg7trH2NKlwA75zG8Qv4TR3E71UrXoY9oItwYstc4Erz+tdf73WyaHMF3cEk1p82 # xx3LcBYhP7jGSjabxTkZsFU8+MM1raOjRN/tHvfcjYLaJOqJZplnkaVhMbNPsVuM # IPJ5bVQohxpmHKPbeFNpF4QJ9wGyZAYOfJOFCk09xQtHnA8CtFjS9to33QPAR/Se # OVZwRCigVjf0KNmCnHC8tJHoW8pG/cdQAr3qqd397XbM1vVELv9fiXiMoGF78UsY # trO4K2yg6N5Sly4Qv/++zZ0OZNkL3BREGp3wf4eTSvLXxqSGvfi8iLpFGA== # =lwSL # -----END PGP SIGNATURE----- # gpg: Signature made Tue 23 Apr 2024 08:35:37 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (63 commits) target/i386/translate.c: always write 32-bits for SGDT and SIDT pythondeps.toml: warn about updates needed to docs/requirements.txt accel/tcg/icount-common: Consolidate the use of warn_report_once() target/i386/cpu: Merge the warning and error messages for AMD HT check target/i386/cpu: Consolidate the use of warn_report_once() target/i386/host-cpu: Consolidate the use of warn_report_once() kvm/tdx: Ignore memory conversion to shared of unassigned region kvm/tdx: Don't complain when converting vMMIO region to shared kvm: handle KVM_EXIT_MEMORY_FAULT physmem: Introduce ram_block_discard_guest_memfd_range() RAMBlock: make guest_memfd require uncoordinated discard HostMem: Add mechanism to opt in kvm guest memfd via MachineState kvm/memory: Make memory type private by default if it has guest memfd backend kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot RAMBlock: Add support of KVM private guest memfd kvm: Introduce support for memory_attributes trace/kvm: Split address space and slot id in trace_kvm_set_user_memory() hw/i386/sev: Use legacy SEV VM types for older machine types i386/sev: Add 'legacy-vm-type' parameter for SEV guest objects target/i386: SEV: use KVM_SEV_INIT2 if possible ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'system/memory.c')
-rw-r--r--system/memory.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/memory.c b/system/memory.c
index a229a79..c756950 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -1850,6 +1850,11 @@ bool memory_region_is_protected(MemoryRegion *mr)
return mr->ram && (mr->ram_block->flags & RAM_PROTECTED);
}
+bool memory_region_has_guest_memfd(MemoryRegion *mr)
+{
+ return mr->ram_block && mr->ram_block->guest_memfd >= 0;
+}
+
uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
{
uint8_t mask = mr->dirty_log_mask;