mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
spapr/xive: add KVM support
This introduces a set of helpers when KVM is in use, which create the KVM XIVE device, initialize the interrupt sources at a KVM level and connect the interrupt presenters to the vCPU. They also handle the initialization of the TIMA and the source ESB memory regions of the controller. These have a different type under KVM. They are 'ram device' memory mappings, similarly to VFIO, exposed to the guest and the associated VMAs on the host are populated dynamically with the appropriate pages using a fault handler. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20190513084245.25755-3-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
75de59416d
commit
38afd772f8
10 changed files with 344 additions and 10 deletions
|
@ -75,6 +75,7 @@ static int cap_fixup_hcalls;
|
|||
static int cap_htm; /* Hardware transactional memory support */
|
||||
static int cap_mmu_radix;
|
||||
static int cap_mmu_hash_v3;
|
||||
static int cap_xive;
|
||||
static int cap_resize_hpt;
|
||||
static int cap_ppc_pvr_compat;
|
||||
static int cap_ppc_safe_cache;
|
||||
|
@ -146,6 +147,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
|
|||
cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM);
|
||||
cap_mmu_radix = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_RADIX);
|
||||
cap_mmu_hash_v3 = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_HASH_V3);
|
||||
cap_xive = kvm_vm_check_extension(s, KVM_CAP_PPC_IRQ_XIVE);
|
||||
cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT);
|
||||
kvmppc_get_cpu_characteristics(s);
|
||||
cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV);
|
||||
|
@ -2478,6 +2480,11 @@ static int parse_cap_ppc_count_cache_flush_assist(struct kvm_ppc_cpu_char c)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool kvmppc_has_cap_xive(void)
|
||||
{
|
||||
return cap_xive;
|
||||
}
|
||||
|
||||
static void kvmppc_get_cpu_characteristics(KVMState *s)
|
||||
{
|
||||
struct kvm_ppc_cpu_char c;
|
||||
|
|
|
@ -60,6 +60,7 @@ bool kvmppc_has_cap_fixup_hcalls(void);
|
|||
bool kvmppc_has_cap_htm(void);
|
||||
bool kvmppc_has_cap_mmu_radix(void);
|
||||
bool kvmppc_has_cap_mmu_hash_v3(void);
|
||||
bool kvmppc_has_cap_xive(void);
|
||||
int kvmppc_get_cap_safe_cache(void);
|
||||
int kvmppc_get_cap_safe_bounds_check(void);
|
||||
int kvmppc_get_cap_safe_indirect_branch(void);
|
||||
|
@ -316,6 +317,11 @@ static inline bool kvmppc_has_cap_mmu_hash_v3(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline bool kvmppc_has_cap_xive(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int kvmppc_get_cap_safe_cache(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue