mirror of https://github.com/xemu-project/xemu.git
machine: allow early use of machine_require_guest_memfd
Ask the ConfidentialGuestSupport object whether to use guest_memfd for KVM-backend private memory. This bool can be set in instance_init (or user_complete) so that it is available when the machine is created. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
aa274c33c3
commit
dc0d28ca46
|
@ -1216,7 +1216,7 @@ bool machine_mem_merge(MachineState *machine)
|
||||||
|
|
||||||
bool machine_require_guest_memfd(MachineState *machine)
|
bool machine_require_guest_memfd(MachineState *machine)
|
||||||
{
|
{
|
||||||
return machine->require_guest_memfd;
|
return machine->cgs && machine->cgs->require_guest_memfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *cpu_slot_to_string(const CPUArchId *cpu)
|
static char *cpu_slot_to_string(const CPUArchId *cpu)
|
||||||
|
|
|
@ -31,6 +31,11 @@ OBJECT_DECLARE_TYPE(ConfidentialGuestSupport,
|
||||||
struct ConfidentialGuestSupport {
|
struct ConfidentialGuestSupport {
|
||||||
Object parent;
|
Object parent;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* True if the machine should use guest_memfd for RAM.
|
||||||
|
*/
|
||||||
|
bool require_guest_memfd;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ready: flag set by CGS initialization code once it's ready to
|
* ready: flag set by CGS initialization code once it's ready to
|
||||||
* start executing instructions in a potentially-secure
|
* start executing instructions in a potentially-secure
|
||||||
|
|
|
@ -375,7 +375,6 @@ struct MachineState {
|
||||||
char *dt_compatible;
|
char *dt_compatible;
|
||||||
bool dump_guest_core;
|
bool dump_guest_core;
|
||||||
bool mem_merge;
|
bool mem_merge;
|
||||||
bool require_guest_memfd;
|
|
||||||
bool usb;
|
bool usb;
|
||||||
bool usb_disabled;
|
bool usb_disabled;
|
||||||
char *firmware;
|
char *firmware;
|
||||||
|
|
Loading…
Reference in New Issue