aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2011-06-28 20:22:05 -0400
committerAvi Kivity <avi@redhat.com>2011-07-12 06:16:55 -0400
commita8606e20e41a8149456bafdf76ad29d47672027c (patch)
treeb50699b3e41fa234b32b01cf5b79ba7bc2ff1f14 /arch/powerpc/include/asm/kvm_host.h
parentde56a948b9182fbcf92cb8212f114de096c2d574 (diff)
KVM: PPC: Handle some PAPR hcalls in the kernel
This adds the infrastructure for handling PAPR hcalls in the kernel, either early in the guest exit path while we are still in real mode, or later once the MMU has been turned back on and we are in the full kernel context. The advantage of handling hcalls in real mode if possible is that we avoid two partition switches -- and this will become more important when we support SMT4 guests, since a partition switch means we have to pull all of the threads in the core out of the guest. The disadvantage is that we can only access the kernel linear mapping, not anything vmalloced or ioremapped, since the MMU is off. This also adds code to handle the following hcalls in real mode: H_ENTER Add an HPTE to the hashed page table H_REMOVE Remove an HPTE from the hashed page table H_READ Read HPTEs from the hashed page table H_PROTECT Change the protection bits in an HPTE H_BULK_REMOVE Remove up to 4 HPTEs from the hashed page table H_SET_DABR Set the data address breakpoint register Plus code to handle the following hcalls in the kernel: H_CEDE Idle the vcpu until an interrupt or H_PROD hcall arrives H_PROD Wake up a ceded vcpu H_REGISTER_VPA Register a virtual processor area (VPA) The code that runs in real mode has to be in the base kernel, not in the module, if KVM is compiled as a module. The real-mode code can only access the kernel linear mapping, not vmalloc or ioremap space. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_host.h')
-rw-r--r--arch/powerpc/include/asm/kvm_host.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 4a3f790d5fc4..6ebf1721680a 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -59,6 +59,10 @@ struct kvm;
59struct kvm_run; 59struct kvm_run;
60struct kvm_vcpu; 60struct kvm_vcpu;
61 61
62struct lppaca;
63struct slb_shadow;
64struct dtl;
65
62struct kvm_vm_stat { 66struct kvm_vm_stat {
63 u32 remote_tlb_flush; 67 u32 remote_tlb_flush;
64}; 68};
@@ -344,7 +348,14 @@ struct kvm_vcpu_arch {
344 u64 dec_expires; 348 u64 dec_expires;
345 unsigned long pending_exceptions; 349 unsigned long pending_exceptions;
346 u16 last_cpu; 350 u16 last_cpu;
351 u8 ceded;
352 u8 prodded;
347 u32 last_inst; 353 u32 last_inst;
354
355 struct lppaca *vpa;
356 struct slb_shadow *slb_shadow;
357 struct dtl *dtl;
358 struct dtl *dtl_end;
348 int trap; 359 int trap;
349 struct kvm_vcpu_arch_shared *shared; 360 struct kvm_vcpu_arch_shared *shared;
350 unsigned long magic_page_pa; /* phys addr to map the magic page to */ 361 unsigned long magic_page_pa; /* phys addr to map the magic page to */