aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2011-12-12 07:28:21 -0500
committerAvi Kivity <avi@redhat.com>2012-03-05 07:52:35 -0500
commitb2b2f16508de10bb1863bdd4ec1fa212111df5b4 (patch)
tree154d350360e1f619d357bf3ded4d2ac3cefeadb2 /arch/powerpc/include
parent8936dda4c2ed070ecebd786baf35b08584accf4a (diff)
KVM: PPC: Keep page physical addresses in per-slot arrays
This allocates an array for each memory slot that is added to store the physical addresses of the pages in the slot. This array is vmalloc'd and accessed in kvmppc_h_enter using real_vmalloc_addr(). This allows us to remove the ram_pginfo field from the kvm_arch struct, and removes the 64GB guest RAM limit that we had. We use the low-order bits of the array entries to store a flag indicating that we have done get_page on the corresponding page, and therefore need to call put_page when we are finished with the page. Currently this is set for all pages except those in our special RMO regions. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/kvm_host.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 629df2ed22f7..7a17ab5b9058 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -38,6 +38,7 @@
38#define KVM_MEMORY_SLOTS 32 38#define KVM_MEMORY_SLOTS 32
39/* memory slots that does not exposed to userspace */ 39/* memory slots that does not exposed to userspace */
40#define KVM_PRIVATE_MEM_SLOTS 4 40#define KVM_PRIVATE_MEM_SLOTS 4
41#define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
41 42
42#ifdef CONFIG_KVM_MMIO 43#ifdef CONFIG_KVM_MMIO
43#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 44#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -175,25 +176,27 @@ struct revmap_entry {
175 unsigned long guest_rpte; 176 unsigned long guest_rpte;
176}; 177};
177 178
179/* Low-order bits in kvm->arch.slot_phys[][] */
180#define KVMPPC_GOT_PAGE 0x80
181
178struct kvm_arch { 182struct kvm_arch {
179#ifdef CONFIG_KVM_BOOK3S_64_HV 183#ifdef CONFIG_KVM_BOOK3S_64_HV
180 unsigned long hpt_virt; 184 unsigned long hpt_virt;
181 struct revmap_entry *revmap; 185 struct revmap_entry *revmap;
182 unsigned long ram_npages;
183 unsigned long ram_psize; 186 unsigned long ram_psize;
184 unsigned long ram_porder; 187 unsigned long ram_porder;
185 struct kvmppc_pginfo *ram_pginfo;
186 unsigned int lpid; 188 unsigned int lpid;
187 unsigned int host_lpid; 189 unsigned int host_lpid;
188 unsigned long host_lpcr; 190 unsigned long host_lpcr;
189 unsigned long sdr1; 191 unsigned long sdr1;
190 unsigned long host_sdr1; 192 unsigned long host_sdr1;
191 int tlbie_lock; 193 int tlbie_lock;
192 int n_rma_pages;
193 unsigned long lpcr; 194 unsigned long lpcr;
194 unsigned long rmor; 195 unsigned long rmor;
195 struct kvmppc_rma_info *rma; 196 struct kvmppc_rma_info *rma;
196 struct list_head spapr_tce_tables; 197 struct list_head spapr_tce_tables;
198 unsigned long *slot_phys[KVM_MEM_SLOTS_NUM];
199 int slot_npages[KVM_MEM_SLOTS_NUM];
197 unsigned short last_vcpu[NR_CPUS]; 200 unsigned short last_vcpu[NR_CPUS];
198 struct kvmppc_vcore *vcores[KVM_MAX_VCORES]; 201 struct kvmppc_vcore *vcores[KVM_MAX_VCORES];
199#endif /* CONFIG_KVM_BOOK3S_64_HV */ 202#endif /* CONFIG_KVM_BOOK3S_64_HV */