|
@@ -33,6 +33,7 @@
|
|
#include <asm/tlbflush.h>
|
|
#include <asm/tlbflush.h>
|
|
#include <asm/cputhreads.h>
|
|
#include <asm/cputhreads.h>
|
|
#include <asm/irqflags.h>
|
|
#include <asm/irqflags.h>
|
|
|
|
+#include <asm/iommu.h>
|
|
#include "timing.h"
|
|
#include "timing.h"
|
|
#include "irq.h"
|
|
#include "irq.h"
|
|
#include "../mm/mmu_decl.h"
|
|
#include "../mm/mmu_decl.h"
|
|
@@ -519,6 +520,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
|
|
|
|
|
|
#ifdef CONFIG_PPC_BOOK3S_64
|
|
#ifdef CONFIG_PPC_BOOK3S_64
|
|
case KVM_CAP_SPAPR_TCE:
|
|
case KVM_CAP_SPAPR_TCE:
|
|
|
|
+ case KVM_CAP_SPAPR_TCE_64:
|
|
case KVM_CAP_PPC_ALLOC_HTAB:
|
|
case KVM_CAP_PPC_ALLOC_HTAB:
|
|
case KVM_CAP_PPC_RTAS:
|
|
case KVM_CAP_PPC_RTAS:
|
|
case KVM_CAP_PPC_FIXUP_HCALL:
|
|
case KVM_CAP_PPC_FIXUP_HCALL:
|
|
@@ -1344,13 +1346,34 @@ long kvm_arch_vm_ioctl(struct file *filp,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
#ifdef CONFIG_PPC_BOOK3S_64
|
|
#ifdef CONFIG_PPC_BOOK3S_64
|
|
|
|
+ case KVM_CREATE_SPAPR_TCE_64: {
|
|
|
|
+ struct kvm_create_spapr_tce_64 create_tce_64;
|
|
|
|
+
|
|
|
|
+ r = -EFAULT;
|
|
|
|
+ if (copy_from_user(&create_tce_64, argp, sizeof(create_tce_64)))
|
|
|
|
+ goto out;
|
|
|
|
+ if (create_tce_64.flags) {
|
|
|
|
+ r = -EINVAL;
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
+ r = kvm_vm_ioctl_create_spapr_tce(kvm, &create_tce_64);
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
case KVM_CREATE_SPAPR_TCE: {
|
|
case KVM_CREATE_SPAPR_TCE: {
|
|
struct kvm_create_spapr_tce create_tce;
|
|
struct kvm_create_spapr_tce create_tce;
|
|
|
|
+ struct kvm_create_spapr_tce_64 create_tce_64;
|
|
|
|
|
|
r = -EFAULT;
|
|
r = -EFAULT;
|
|
if (copy_from_user(&create_tce, argp, sizeof(create_tce)))
|
|
if (copy_from_user(&create_tce, argp, sizeof(create_tce)))
|
|
goto out;
|
|
goto out;
|
|
- r = kvm_vm_ioctl_create_spapr_tce(kvm, &create_tce);
|
|
|
|
|
|
+
|
|
|
|
+ create_tce_64.liobn = create_tce.liobn;
|
|
|
|
+ create_tce_64.page_shift = IOMMU_PAGE_SHIFT_4K;
|
|
|
|
+ create_tce_64.offset = 0;
|
|
|
|
+ create_tce_64.size = create_tce.window_size >>
|
|
|
|
+ IOMMU_PAGE_SHIFT_4K;
|
|
|
|
+ create_tce_64.flags = 0;
|
|
|
|
+ r = kvm_vm_ioctl_create_spapr_tce(kvm, &create_tce_64);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
case KVM_PPC_GET_SMMU_INFO: {
|
|
case KVM_PPC_GET_SMMU_INFO: {
|