mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
spapr: Use maximum page size capability to simplify memory backend checking
The way we used to handle KVM allowable guest pagesizes for PAPR guests required some convoluted checking of memory attached to the guest. The allowable pagesizes advertised to the guest cpus depended on the memory which was attached at boot, but then we needed to ensure that any memory later hotplugged didn't change which pagesizes were allowed. Now that we have an explicit machine option to control the allowable maximum pagesize we can simplify this. We just check all memory backends against that declared pagesize. We check base and cold-plugged memory at reset time, and hotplugged memory at pre_plug() time. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
2309832afd
commit
123eec6552
5 changed files with 31 additions and 30 deletions
|
@ -500,26 +500,12 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
|
|||
cpu->hash64_opts->flags &= ~PPC_HASH64_1TSEG;
|
||||
}
|
||||
}
|
||||
|
||||
bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)
|
||||
{
|
||||
Object *mem_obj = object_resolve_path(obj_path, NULL);
|
||||
long pagesize = host_memory_backend_pagesize(MEMORY_BACKEND(mem_obj));
|
||||
|
||||
return pagesize >= max_cpu_page_size;
|
||||
}
|
||||
|
||||
#else /* defined (TARGET_PPC64) */
|
||||
|
||||
static inline void kvm_fixup_page_sizes(PowerPCCPU *cpu)
|
||||
{
|
||||
}
|
||||
|
||||
bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* !defined (TARGET_PPC64) */
|
||||
|
||||
unsigned long kvm_arch_vcpu_id(CPUState *cpu)
|
||||
|
|
|
@ -71,7 +71,6 @@ int kvmppc_resize_hpt_commit(PowerPCCPU *cpu, target_ulong flags, int shift);
|
|||
bool kvmppc_pvr_workaround_required(PowerPCCPU *cpu);
|
||||
|
||||
bool kvmppc_hpt_needs_host_contiguous_pages(void);
|
||||
bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -228,11 +227,6 @@ static inline bool kvmppc_hpt_needs_host_contiguous_pages(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool kvmppc_has_cap_spapr_vfio(void)
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue