Commit 95d386c2 authored by Suraj Jitindar Singh's avatar Suraj Jitindar Singh Committed by Paul Mackerras

KVM: PPC: Book3S HV: Allow passthrough of an emulated device to an L3 guest

Previously when a device was being emulated by an L1 guest for an L2
guest, that device couldn't then be passed through to an L3 guest. This
was because the L1 guest had no method for accessing L3 memory.

The hcall H_COPY_TOFROM_GUEST provides this access. Thus this setup for
passthrough can now be allowed.
Signed-off-by: default avatarSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
parent 6ff887b8
...@@ -37,11 +37,10 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid, ...@@ -37,11 +37,10 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid,
int old_pid, old_lpid; int old_pid, old_lpid;
bool is_load = !!to; bool is_load = !!to;
/* Can't access quadrants 1 or 2 in non-HV mode */ /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */
if (kvmhv_on_pseries()) { if (kvmhv_on_pseries())
/* TODO h-call */ return plpar_hcall_norets(H_COPY_TOFROM_GUEST, lpid, pid, eaddr,
return -EPERM; __pa(to), __pa(from), n);
}
quadrant = 1; quadrant = 1;
if (!pid) if (!pid)
......
...@@ -1284,11 +1284,6 @@ static long int __kvmhv_nested_page_fault(struct kvm_run *run, ...@@ -1284,11 +1284,6 @@ static long int __kvmhv_nested_page_fault(struct kvm_run *run,
} }
/* passthrough of emulated MMIO case */ /* passthrough of emulated MMIO case */
if (kvmhv_on_pseries()) {
pr_err("emulated MMIO passthrough?\n");
return -EINVAL;
}
return kvmppc_hv_emulate_mmio(run, vcpu, gpa, ea, writing); return kvmppc_hv_emulate_mmio(run, vcpu, gpa, ea, writing);
} }
if (memslot->flags & KVM_MEM_READONLY) { if (memslot->flags & KVM_MEM_READONLY) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment