提交 31037eca 编写于 作者: A Aneesh Kumar K.V 提交者: Alexander Graf

KVM: PPC: Book3S HV: Remove RMA-related variables from code

We don't support real-mode areas now that 970 support is removed.
Remove the remaining details of rma from the code.  Also rename
rma_setup_done to hpte_setup_done to better reflect the changes.
Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 e928e9cb
...@@ -228,9 +228,8 @@ struct kvm_arch { ...@@ -228,9 +228,8 @@ struct kvm_arch {
int tlbie_lock; int tlbie_lock;
unsigned long lpcr; unsigned long lpcr;
unsigned long rmor; unsigned long rmor;
struct kvm_rma_info *rma;
unsigned long vrma_slb_v; unsigned long vrma_slb_v;
int rma_setup_done; int hpte_setup_done;
u32 hpt_order; u32 hpt_order;
atomic_t vcpus_running; atomic_t vcpus_running;
u32 online_vcores; u32 online_vcores;
......
...@@ -116,12 +116,12 @@ long kvmppc_alloc_reset_hpt(struct kvm *kvm, u32 *htab_orderp) ...@@ -116,12 +116,12 @@ long kvmppc_alloc_reset_hpt(struct kvm *kvm, u32 *htab_orderp)
long order; long order;
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
if (kvm->arch.rma_setup_done) { if (kvm->arch.hpte_setup_done) {
kvm->arch.rma_setup_done = 0; kvm->arch.hpte_setup_done = 0;
/* order rma_setup_done vs. vcpus_running */ /* order hpte_setup_done vs. vcpus_running */
smp_mb(); smp_mb();
if (atomic_read(&kvm->arch.vcpus_running)) { if (atomic_read(&kvm->arch.vcpus_running)) {
kvm->arch.rma_setup_done = 1; kvm->arch.hpte_setup_done = 1;
goto out; goto out;
} }
} }
...@@ -1339,20 +1339,20 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, ...@@ -1339,20 +1339,20 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf,
unsigned long tmp[2]; unsigned long tmp[2];
ssize_t nb; ssize_t nb;
long int err, ret; long int err, ret;
int rma_setup; int hpte_setup;
if (!access_ok(VERIFY_READ, buf, count)) if (!access_ok(VERIFY_READ, buf, count))
return -EFAULT; return -EFAULT;
/* lock out vcpus from running while we're doing this */ /* lock out vcpus from running while we're doing this */
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
rma_setup = kvm->arch.rma_setup_done; hpte_setup = kvm->arch.hpte_setup_done;
if (rma_setup) { if (hpte_setup) {
kvm->arch.rma_setup_done = 0; /* temporarily */ kvm->arch.hpte_setup_done = 0; /* temporarily */
/* order rma_setup_done vs. vcpus_running */ /* order hpte_setup_done vs. vcpus_running */
smp_mb(); smp_mb();
if (atomic_read(&kvm->arch.vcpus_running)) { if (atomic_read(&kvm->arch.vcpus_running)) {
kvm->arch.rma_setup_done = 1; kvm->arch.hpte_setup_done = 1;
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
return -EBUSY; return -EBUSY;
} }
...@@ -1405,7 +1405,7 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, ...@@ -1405,7 +1405,7 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf,
"r=%lx\n", ret, i, v, r); "r=%lx\n", ret, i, v, r);
goto out; goto out;
} }
if (!rma_setup && is_vrma_hpte(v)) { if (!hpte_setup && is_vrma_hpte(v)) {
unsigned long psize = hpte_base_page_size(v, r); unsigned long psize = hpte_base_page_size(v, r);
unsigned long senc = slb_pgsize_encoding(psize); unsigned long senc = slb_pgsize_encoding(psize);
unsigned long lpcr; unsigned long lpcr;
...@@ -1414,7 +1414,7 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, ...@@ -1414,7 +1414,7 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf,
(VRMA_VSID << SLB_VSID_SHIFT_1T); (VRMA_VSID << SLB_VSID_SHIFT_1T);
lpcr = senc << (LPCR_VRMASD_SH - 4); lpcr = senc << (LPCR_VRMASD_SH - 4);
kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD); kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD);
rma_setup = 1; hpte_setup = 1;
} }
++i; ++i;
hptp += 2; hptp += 2;
...@@ -1430,9 +1430,9 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, ...@@ -1430,9 +1430,9 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf,
} }
out: out:
/* Order HPTE updates vs. rma_setup_done */ /* Order HPTE updates vs. hpte_setup_done */
smp_wmb(); smp_wmb();
kvm->arch.rma_setup_done = rma_setup; kvm->arch.hpte_setup_done = hpte_setup;
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
if (err) if (err)
......
...@@ -2044,11 +2044,11 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu) ...@@ -2044,11 +2044,11 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
} }
atomic_inc(&vcpu->kvm->arch.vcpus_running); atomic_inc(&vcpu->kvm->arch.vcpus_running);
/* Order vcpus_running vs. rma_setup_done, see kvmppc_alloc_reset_hpt */ /* Order vcpus_running vs. hpte_setup_done, see kvmppc_alloc_reset_hpt */
smp_mb(); smp_mb();
/* On the first time here, set up HTAB and VRMA */ /* On the first time here, set up HTAB and VRMA */
if (!vcpu->kvm->arch.rma_setup_done) { if (!vcpu->kvm->arch.hpte_setup_done) {
r = kvmppc_hv_setup_htab_rma(vcpu); r = kvmppc_hv_setup_htab_rma(vcpu);
if (r) if (r)
goto out; goto out;
...@@ -2250,7 +2250,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu) ...@@ -2250,7 +2250,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
int srcu_idx; int srcu_idx;
mutex_lock(&kvm->lock); mutex_lock(&kvm->lock);
if (kvm->arch.rma_setup_done) if (kvm->arch.hpte_setup_done)
goto out; /* another vcpu beat us to it */ goto out; /* another vcpu beat us to it */
/* Allocate hashed page table (if not done already) and reset it */ /* Allocate hashed page table (if not done already) and reset it */
...@@ -2301,9 +2301,9 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu) ...@@ -2301,9 +2301,9 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD); kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD);
/* Order updates to kvm->arch.lpcr etc. vs. rma_setup_done */ /* Order updates to kvm->arch.lpcr etc. vs. hpte_setup_done */
smp_wmb(); smp_wmb();
kvm->arch.rma_setup_done = 1; kvm->arch.hpte_setup_done = 1;
err = 0; err = 0;
out_srcu: out_srcu:
srcu_read_unlock(&kvm->srcu, srcu_idx); srcu_read_unlock(&kvm->srcu, srcu_idx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册