diff options
author | David Gibson <dwg@au1.ibm.com> | 2011-06-28 20:22:41 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:56 -0400 |
commit | 54738c097163c3f01e67ccc85462b78d4d4f495f (patch) | |
tree | cba8d389d50251856cbe967c16ba2193a30d6d12 /arch/powerpc/include/asm/kvm_host.h | |
parent | a8606e20e41a8149456bafdf76ad29d47672027c (diff) |
KVM: PPC: Accelerate H_PUT_TCE by implementing it in real mode
This improves I/O performance for guests using the PAPR
paravirtualization interface by making the H_PUT_TCE hcall faster, by
implementing it in real mode. H_PUT_TCE is used for updating virtual
IOMMU tables, and is used both for virtual I/O and for real I/O in the
PAPR interface.
Since this moves the IOMMU tables into the kernel, we define a new
KVM_CREATE_SPAPR_TCE ioctl to allow qemu to create the tables. The
ioctl returns a file descriptor which can be used to mmap the newly
created table. The qemu driver models use them in the same way as
userspace managed tables, but they can be updated directly by the
guest with a real-mode H_PUT_TCE implementation, reducing the number
of host/guest context switches during guest IO.
There are certain circumstances where it is useful for userland qemu
to write to the TCE table even if the kernel H_PUT_TCE path is used
most of the time. Specifically, allowing this will avoid awkwardness
when we need to reset the table. More importantly, we will in the
future need to write the table in order to restore its state after a
checkpoint resume or migration.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 6ebf1721680a..5616e39a7fa4 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -144,6 +144,14 @@ struct kvmppc_pginfo { | |||
144 | atomic_t refcnt; | 144 | atomic_t refcnt; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | struct kvmppc_spapr_tce_table { | ||
148 | struct list_head list; | ||
149 | struct kvm *kvm; | ||
150 | u64 liobn; | ||
151 | u32 window_size; | ||
152 | struct page *pages[0]; | ||
153 | }; | ||
154 | |||
147 | struct kvm_arch { | 155 | struct kvm_arch { |
148 | #ifdef CONFIG_KVM_BOOK3S_64_HV | 156 | #ifdef CONFIG_KVM_BOOK3S_64_HV |
149 | unsigned long hpt_virt; | 157 | unsigned long hpt_virt; |
@@ -157,6 +165,7 @@ struct kvm_arch { | |||
157 | unsigned long sdr1; | 165 | unsigned long sdr1; |
158 | unsigned long host_sdr1; | 166 | unsigned long host_sdr1; |
159 | int tlbie_lock; | 167 | int tlbie_lock; |
168 | struct list_head spapr_tce_tables; | ||
160 | unsigned short last_vcpu[NR_CPUS]; | 169 | unsigned short last_vcpu[NR_CPUS]; |
161 | #endif /* CONFIG_KVM_BOOK3S_64_HV */ | 170 | #endif /* CONFIG_KVM_BOOK3S_64_HV */ |
162 | }; | 171 | }; |