* [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8
@ 2014-10-10 2:34 Mario Smarduch
2014-10-10 2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Mario Smarduch @ 2014-10-10 2:34 UTC (permalink / raw)
To: linux-arm-kernel
This patch series adds support for ARMv8 dirty page logging. It applies on top
of ARMv7 patch series. Similar ARMv8 to dirty page log read is moved to generic
layer and tlb flush has architecture specific flush.
Testing:
--------
- ARMv8 - Tested on Foundation Model.
- ARMv7 - retested on Exynos 5440 development board.
Components:
- Added mmio device to QEMU 'machvirt' with on board memory (1MB in this case),
Device memory is Posix shared memory segment visible to host. Enabled
dirty logging for that memslot.
- Added memslot migration thread to export dirty bit map to host.
- Implemented memory migration thread on host.
Operation:
o On Guest application mmaps() the region (via /dev/mem) and dirties pages.
o The host migration thread does a pre-copy of /dev/shm/aeshmem to a host
file, repeatedly requests QEMU for memory region dirty page log,
incrementally copies dirty pages from /dev/shm/aeshmem to host file.
o Guest application is stopped and both /dev/shm/aeshmem and host file are
checksummed to check for match to validate dirty page log applied
incremental updates, validating logging.
Will upload details to https://github.com/mjsmar/arm-migration-howto
- qemu binary, host mgiration thread, and other deliverables to reproduce
test environment.
Mario Smarduch (3):
ARMv8 headers changes for dirty page logging
Add HYP interface to flush State 1/2 TLB entires
Enable Dirty Page logging for ARMv8 move log read, tlb flush to
generic code
arch/arm/include/asm/kvm_host.h | 12 ------------
arch/arm/kvm/arm.c | 9 ---------
arch/arm/kvm/mmu.c | 17 +++++++++++------
arch/arm64/include/asm/kvm_asm.h | 1 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/kvm_mmu.h | 20 ++++++++++++++++++++
arch/arm64/include/asm/pgtable-hwdef.h | 1 +
arch/arm64/kvm/Kconfig | 2 +-
arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
9 files changed, 57 insertions(+), 28 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging
2014-10-10 2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
@ 2014-10-10 2:34 ` Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2014-10-10 2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
2014-10-10 2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
2 siblings, 1 reply; 14+ messages in thread
From: Mario Smarduch @ 2014-10-10 2:34 UTC (permalink / raw)
To: linux-arm-kernel
This patch introduces header updates for ARMv8 dirty page logging.
Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
---
arch/arm64/include/asm/kvm_asm.h | 1 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/kvm_mmu.h | 20 ++++++++++++++++++++
arch/arm64/include/asm/pgtable-hwdef.h | 1 +
4 files changed, 23 insertions(+)
diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
index 9fcd54b..bb1a870 100644
--- a/arch/arm64/include/asm/kvm_asm.h
+++ b/arch/arm64/include/asm/kvm_asm.h
@@ -101,6 +101,7 @@ extern char __kvm_hyp_code_end[];
extern void __kvm_flush_vm_context(void);
extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
+extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
#endif
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 92242ce..5714706 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -180,6 +180,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
u64 kvm_call_hyp(void *hypfn, ...);
+void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);
int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
int exception_index);
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 8e138c7..8b0ffe3 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -121,6 +121,26 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
pmd_val(*pmd) |= PMD_S2_RDWR;
}
+static inline void kvm_set_s2pte_readonly(pte_t *pte)
+{
+ pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
+}
+
+static inline bool kvm_s2pte_readonly(pte_t *pte)
+{
+ return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY;
+}
+
+static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
+{
+ pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
+}
+
+static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
+{
+ return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
+}
+
#define kvm_pgd_addr_end(addr, end) pgd_addr_end(addr, end)
#define kvm_pud_addr_end(addr, end) pud_addr_end(addr, end)
#define kvm_pmd_addr_end(addr, end) pmd_addr_end(addr, end)
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 955e8c5..21771f6 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -87,6 +87,7 @@
#define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[2:1] */
#define PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
+#define PMD_S2_RDONLY (_AT(pmdval_t, 1) << 6) /* HAP[2:1] */
#define PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires
2014-10-10 2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
2014-10-10 2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
@ 2014-10-10 2:34 ` Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2014-10-10 2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
2 siblings, 1 reply; 14+ messages in thread
From: Mario Smarduch @ 2014-10-10 2:34 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds HYP VM TLB FLush function.
Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
---
arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
index b0d1512..117a91c 100644
--- a/arch/arm64/kvm/hyp.S
+++ b/arch/arm64/kvm/hyp.S
@@ -645,6 +645,28 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
ret
ENDPROC(__kvm_tlb_flush_vmid_ipa)
+/**
+ * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
+ * @struc kvm *kvm - pointer to kvm structure
+ *
+ * Invalidates all Stage 1 and 2 TLB entries for current VMID.
+ */
+ENTRY(__kvm_tlb_flush_vmid)
+ dsb ishst
+
+ kern_hyp_va x0
+ ldr x2, [x0, #KVM_VTTBR]
+ msr vttbr_el2, x2
+ isb
+
+ tlbi vmalls12e1is
+ dsb ish
+ isb
+
+ msr vttbr_el2, xzr
+ ret
+ENDPROC(__kvm_tlb_flush_vmid)
+
ENTRY(__kvm_flush_vm_context)
dsb ishst
tlbi alle1is
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-10-10 2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
2014-10-10 2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
2014-10-10 2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
@ 2014-10-10 2:34 ` Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2 siblings, 1 reply; 14+ messages in thread
From: Mario Smarduch @ 2014-10-10 2:34 UTC (permalink / raw)
To: linux-arm-kernel
This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
---
arch/arm/include/asm/kvm_host.h | 12 ------------
arch/arm/kvm/arm.c | 9 ---------
arch/arm/kvm/mmu.c | 17 +++++++++++------
arch/arm64/kvm/Kconfig | 2 +-
4 files changed, 12 insertions(+), 28 deletions(-)
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 12311a5..59565f5 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
}
-/**
- * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
- * @kvm: pointer to kvm structure.
- *
- * Interface to HYP function to flush all VM TLB entries without address
- * parameter.
- */
-static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
-{
- kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
-}
-
static inline int kvm_arch_dev_ioctl_check_extension(long ext)
{
return 0;
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 0546fa3..6a6fd6b 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
const struct kvm_memory_slot *old,
enum kvm_mr_change change)
{
-#ifdef CONFIG_ARM
/*
* At this point memslot has been committed and there is an
* allocated dirty_bitmap[], dirty pages will be be tracked while the
@@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
*/
if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
kvm_mmu_wp_memory_region(kvm, mem->slot);
-#endif
}
void kvm_arch_flush_shadow_all(struct kvm *kvm)
@@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
}
}
-#ifdef CONFIG_ARM64
-int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
-{
- return -EINVAL;
-}
-#endif
-
static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
struct kvm_arm_device_addr *dev_addr)
{
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index df1a5a3..8c0f9f2 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
{
-#ifdef CONFIG_ARM
return !!memslot->dirty_bitmap;
-#else
- return false;
-#endif
+}
+
+/**
+ * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
+ * @kvm: pointer to kvm structure.
+ *
+ * Interface to HYP function to flush all VM TLB entries
+ */
+inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
+{
+ kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
}
static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
@@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
return false;
}
-#ifdef CONFIG_ARM
/**
* stage2_wp_ptes - write protect PMD range
* @pmd: pointer to pmd entry
@@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
stage2_wp_range(kvm, start, end);
}
-#endif
static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
struct kvm_memory_slot *memslot,
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
index 40a8d19..a1a35809 100644
--- a/arch/arm64/kvm/Kconfig
+++ b/arch/arm64/kvm/Kconfig
@@ -26,7 +26,7 @@ config KVM
select KVM_ARM_HOST
select KVM_ARM_VGIC
select KVM_ARM_TIMER
- select HAVE_KVM_ARCH_DIRTY_LOG
+ select HAVE_KVM_ARCH_TLB_FLUSH_ALL
---help---
Support hosting virtualized guest machines.
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging
2014-10-10 2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
@ 2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:49 ` Mario Smarduch
0 siblings, 1 reply; 14+ messages in thread
From: Christoffer Dall @ 2014-11-07 20:20 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Oct 09, 2014 at 07:34:05PM -0700, Mario Smarduch wrote:
> This patch introduces header updates for ARMv8 dirty page logging.
hm, header updates,
it introduces functions to write protect pages on arm64 and adds a
prototype for blah blah blah.
Perhaps you can be just slightly more explanatory in your commit
message.
>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm64/include/asm/kvm_asm.h | 1 +
> arch/arm64/include/asm/kvm_host.h | 1 +
> arch/arm64/include/asm/kvm_mmu.h | 20 ++++++++++++++++++++
> arch/arm64/include/asm/pgtable-hwdef.h | 1 +
> 4 files changed, 23 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
> index 9fcd54b..bb1a870 100644
> --- a/arch/arm64/include/asm/kvm_asm.h
> +++ b/arch/arm64/include/asm/kvm_asm.h
> @@ -101,6 +101,7 @@ extern char __kvm_hyp_code_end[];
>
> extern void __kvm_flush_vm_context(void);
> extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
> +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
>
> extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
> #endif
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 92242ce..5714706 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -180,6 +180,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
> struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
>
> u64 kvm_call_hyp(void *hypfn, ...);
> +void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);
>
> int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
> int exception_index);
> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
> index 8e138c7..8b0ffe3 100644
> --- a/arch/arm64/include/asm/kvm_mmu.h
> +++ b/arch/arm64/include/asm/kvm_mmu.h
> @@ -121,6 +121,26 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
> pmd_val(*pmd) |= PMD_S2_RDWR;
> }
>
> +static inline void kvm_set_s2pte_readonly(pte_t *pte)
> +{
> + pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
> +}
> +
> +static inline bool kvm_s2pte_readonly(pte_t *pte)
> +{
> + return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY;
> +}
> +
> +static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
> +{
> + pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
> +}
> +
> +static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
> +{
> + return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
> +}
> +
> #define kvm_pgd_addr_end(addr, end) pgd_addr_end(addr, end)
> #define kvm_pud_addr_end(addr, end) pud_addr_end(addr, end)
> #define kvm_pmd_addr_end(addr, end) pmd_addr_end(addr, end)
> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
> index 955e8c5..21771f6 100644
> --- a/arch/arm64/include/asm/pgtable-hwdef.h
> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
> @@ -87,6 +87,7 @@
> #define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[2:1] */
> #define PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
>
> +#define PMD_S2_RDONLY (_AT(pmdval_t, 1) << 6) /* HAP[2:1] */
> #define PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */
>
> /*
> --
> 1.9.1
>
I assume you'll provide a rebased version of these once you respin the
ARM series, but this looks overall fine to me.
-Christoffer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires
2014-10-10 2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
@ 2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:50 ` Mario Smarduch
0 siblings, 1 reply; 14+ messages in thread
From: Christoffer Dall @ 2014-11-07 20:20 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Oct 09, 2014 at 07:34:06PM -0700, Mario Smarduch wrote:
> This patch adds HYP VM TLB FLush function.
>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
> index b0d1512..117a91c 100644
> --- a/arch/arm64/kvm/hyp.S
> +++ b/arch/arm64/kvm/hyp.S
> @@ -645,6 +645,28 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
> ret
> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>
> +/**
> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
> + * @struc kvm *kvm - pointer to kvm structure
struct
> + *
> + * Invalidates all Stage 1 and 2 TLB entries for current VMID.
> + */
> +ENTRY(__kvm_tlb_flush_vmid)
> + dsb ishst
> +
> + kern_hyp_va x0
> + ldr x2, [x0, #KVM_VTTBR]
> + msr vttbr_el2, x2
> + isb
> +
> + tlbi vmalls12e1is
> + dsb ish
> + isb
> +
> + msr vttbr_el2, xzr
> + ret
> +ENDPROC(__kvm_tlb_flush_vmid)
> +
> ENTRY(__kvm_flush_vm_context)
> dsb ishst
> tlbi alle1is
> --
> 1.9.1
>
Looks good to me:
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-10-10 2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
@ 2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:51 ` Mario Smarduch
0 siblings, 1 reply; 14+ messages in thread
From: Christoffer Dall @ 2014-11-07 20:20 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm/include/asm/kvm_host.h | 12 ------------
> arch/arm/kvm/arm.c | 9 ---------
> arch/arm/kvm/mmu.c | 17 +++++++++++------
> arch/arm64/kvm/Kconfig | 2 +-
> 4 files changed, 12 insertions(+), 28 deletions(-)
>
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index 12311a5..59565f5 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
> }
>
> -/**
> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
> - * @kvm: pointer to kvm structure.
> - *
> - * Interface to HYP function to flush all VM TLB entries without address
> - * parameter.
> - */
> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> -{
> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> -}
> -
> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
> {
> return 0;
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 0546fa3..6a6fd6b 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> const struct kvm_memory_slot *old,
> enum kvm_mr_change change)
> {
> -#ifdef CONFIG_ARM
> /*
> * At this point memslot has been committed and there is an
> * allocated dirty_bitmap[], dirty pages will be be tracked while the
> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> */
> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
> kvm_mmu_wp_memory_region(kvm, mem->slot);
> -#endif
> }
>
> void kvm_arch_flush_shadow_all(struct kvm *kvm)
> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
> }
> }
>
> -#ifdef CONFIG_ARM64
> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
> -{
> - return -EINVAL;
> -}
> -#endif
> -
> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
> struct kvm_arm_device_addr *dev_addr)
> {
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index df1a5a3..8c0f9f2 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>
> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
> {
> -#ifdef CONFIG_ARM
> return !!memslot->dirty_bitmap;
> -#else
> - return false;
> -#endif
> +}
> +
> +/**
> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
> + * @kvm: pointer to kvm structure.
> + *
> + * Interface to HYP function to flush all VM TLB entries
> + */
> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> +{
> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> }
>
> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
> return false;
> }
>
> -#ifdef CONFIG_ARM
> /**
> * stage2_wp_ptes - write protect PMD range
> * @pmd: pointer to pmd entry
> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>
> stage2_wp_range(kvm, start, end);
> }
> -#endif
>
> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> struct kvm_memory_slot *memslot,
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 40a8d19..a1a35809 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -26,7 +26,7 @@ config KVM
> select KVM_ARM_HOST
> select KVM_ARM_VGIC
> select KVM_ARM_TIMER
> - select HAVE_KVM_ARCH_DIRTY_LOG
> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
> ---help---
> Support hosting virtualized guest machines.
>
> --
> 1.9.1
>
this patch needs to be rebased onto the newest version of your v7 patch,
but otherwise it looks roughly ok.
-Christoffer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging
2014-11-07 20:20 ` Christoffer Dall
@ 2014-11-07 20:49 ` Mario Smarduch
0 siblings, 0 replies; 14+ messages in thread
From: Mario Smarduch @ 2014-11-07 20:49 UTC (permalink / raw)
To: linux-arm-kernel
On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:05PM -0700, Mario Smarduch wrote:
>> This patch introduces header updates for ARMv8 dirty page logging.
>
> hm, header updates,
>
> it introduces functions to write protect pages on arm64 and adds a
> prototype for blah blah blah.
>
> Perhaps you can be just slightly more explanatory in your commit
> message.
Yep, my descriptions have been lacking :)
>
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>> arch/arm64/include/asm/kvm_asm.h | 1 +
>> arch/arm64/include/asm/kvm_host.h | 1 +
>> arch/arm64/include/asm/kvm_mmu.h | 20 ++++++++++++++++++++
>> arch/arm64/include/asm/pgtable-hwdef.h | 1 +
>> 4 files changed, 23 insertions(+)
>>
>> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
>> index 9fcd54b..bb1a870 100644
>> --- a/arch/arm64/include/asm/kvm_asm.h
>> +++ b/arch/arm64/include/asm/kvm_asm.h
>> @@ -101,6 +101,7 @@ extern char __kvm_hyp_code_end[];
>>
>> extern void __kvm_flush_vm_context(void);
>> extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
>> +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
>>
>> extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
>> #endif
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 92242ce..5714706 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -180,6 +180,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
>> struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
>>
>> u64 kvm_call_hyp(void *hypfn, ...);
>> +void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot);
>>
>> int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
>> int exception_index);
>> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
>> index 8e138c7..8b0ffe3 100644
>> --- a/arch/arm64/include/asm/kvm_mmu.h
>> +++ b/arch/arm64/include/asm/kvm_mmu.h
>> @@ -121,6 +121,26 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
>> pmd_val(*pmd) |= PMD_S2_RDWR;
>> }
>>
>> +static inline void kvm_set_s2pte_readonly(pte_t *pte)
>> +{
>> + pte_val(*pte) = (pte_val(*pte) & ~PTE_S2_RDWR) | PTE_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pte_readonly(pte_t *pte)
>> +{
>> + return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY;
>> +}
>> +
>> +static inline void kvm_set_s2pmd_readonly(pmd_t *pmd)
>> +{
>> + pmd_val(*pmd) = (pmd_val(*pmd) & ~PMD_S2_RDWR) | PMD_S2_RDONLY;
>> +}
>> +
>> +static inline bool kvm_s2pmd_readonly(pmd_t *pmd)
>> +{
>> + return (pmd_val(*pmd) & PMD_S2_RDWR) == PMD_S2_RDONLY;
>> +}
>> +
>> #define kvm_pgd_addr_end(addr, end) pgd_addr_end(addr, end)
>> #define kvm_pud_addr_end(addr, end) pud_addr_end(addr, end)
>> #define kvm_pmd_addr_end(addr, end) pmd_addr_end(addr, end)
>> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
>> index 955e8c5..21771f6 100644
>> --- a/arch/arm64/include/asm/pgtable-hwdef.h
>> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
>> @@ -87,6 +87,7 @@
>> #define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[2:1] */
>> #define PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
>>
>> +#define PMD_S2_RDONLY (_AT(pmdval_t, 1) << 6) /* HAP[2:1] */
>> #define PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */
>>
>> /*
>> --
>> 1.9.1
>>
> I assume you'll provide a rebased version of these once you respin the
> ARM series, but this looks overall fine to me.
Yes defintelly.
Thanks.
>
> -Christoffer
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires
2014-11-07 20:20 ` Christoffer Dall
@ 2014-11-07 20:50 ` Mario Smarduch
0 siblings, 0 replies; 14+ messages in thread
From: Mario Smarduch @ 2014-11-07 20:50 UTC (permalink / raw)
To: linux-arm-kernel
On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:06PM -0700, Mario Smarduch wrote:
>> This patch adds HYP VM TLB FLush function.
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>> arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
>> 1 file changed, 22 insertions(+)
>>
>> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
>> index b0d1512..117a91c 100644
>> --- a/arch/arm64/kvm/hyp.S
>> +++ b/arch/arm64/kvm/hyp.S
>> @@ -645,6 +645,28 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
>> ret
>> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>>
>> +/**
>> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
>> + * @struc kvm *kvm - pointer to kvm structure
>
> struct
Got it.
>
>> + *
>> + * Invalidates all Stage 1 and 2 TLB entries for current VMID.
>> + */
>> +ENTRY(__kvm_tlb_flush_vmid)
>> + dsb ishst
>> +
>> + kern_hyp_va x0
>> + ldr x2, [x0, #KVM_VTTBR]
>> + msr vttbr_el2, x2
>> + isb
>> +
>> + tlbi vmalls12e1is
>> + dsb ish
>> + isb
>> +
>> + msr vttbr_el2, xzr
>> + ret
>> +ENDPROC(__kvm_tlb_flush_vmid)
>> +
>> ENTRY(__kvm_flush_vm_context)
>> dsb ishst
>> tlbi alle1is
>> --
>> 1.9.1
>>
> Looks good to me:
>
> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-11-07 20:20 ` Christoffer Dall
@ 2014-11-07 20:51 ` Mario Smarduch
2014-11-19 14:39 ` Christoffer Dall
0 siblings, 1 reply; 14+ messages in thread
From: Mario Smarduch @ 2014-11-07 20:51 UTC (permalink / raw)
To: linux-arm-kernel
On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
>> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>> arch/arm/include/asm/kvm_host.h | 12 ------------
>> arch/arm/kvm/arm.c | 9 ---------
>> arch/arm/kvm/mmu.c | 17 +++++++++++------
>> arch/arm64/kvm/Kconfig | 2 +-
>> 4 files changed, 12 insertions(+), 28 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
>> index 12311a5..59565f5 100644
>> --- a/arch/arm/include/asm/kvm_host.h
>> +++ b/arch/arm/include/asm/kvm_host.h
>> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
>> }
>>
>> -/**
>> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
>> - * @kvm: pointer to kvm structure.
>> - *
>> - * Interface to HYP function to flush all VM TLB entries without address
>> - * parameter.
>> - */
>> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>> -{
>> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>> -}
>> -
>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>> {
>> return 0;
>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>> index 0546fa3..6a6fd6b 100644
>> --- a/arch/arm/kvm/arm.c
>> +++ b/arch/arm/kvm/arm.c
>> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>> const struct kvm_memory_slot *old,
>> enum kvm_mr_change change)
>> {
>> -#ifdef CONFIG_ARM
>> /*
>> * At this point memslot has been committed and there is an
>> * allocated dirty_bitmap[], dirty pages will be be tracked while the
>> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>> */
>> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
>> kvm_mmu_wp_memory_region(kvm, mem->slot);
>> -#endif
>> }
>>
>> void kvm_arch_flush_shadow_all(struct kvm *kvm)
>> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>> }
>> }
>>
>> -#ifdef CONFIG_ARM64
>> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
>> -{
>> - return -EINVAL;
>> -}
>> -#endif
>> -
>> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
>> struct kvm_arm_device_addr *dev_addr)
>> {
>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
>> index df1a5a3..8c0f9f2 100644
>> --- a/arch/arm/kvm/mmu.c
>> +++ b/arch/arm/kvm/mmu.c
>> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>>
>> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
>> {
>> -#ifdef CONFIG_ARM
>> return !!memslot->dirty_bitmap;
>> -#else
>> - return false;
>> -#endif
>> +}
>> +
>> +/**
>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
>> + * @kvm: pointer to kvm structure.
>> + *
>> + * Interface to HYP function to flush all VM TLB entries
>> + */
>> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>> +{
>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>> }
>>
>> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
>> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
>> return false;
>> }
>>
>> -#ifdef CONFIG_ARM
>> /**
>> * stage2_wp_ptes - write protect PMD range
>> * @pmd: pointer to pmd entry
>> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>>
>> stage2_wp_range(kvm, start, end);
>> }
>> -#endif
>>
>> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>> struct kvm_memory_slot *memslot,
>> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
>> index 40a8d19..a1a35809 100644
>> --- a/arch/arm64/kvm/Kconfig
>> +++ b/arch/arm64/kvm/Kconfig
>> @@ -26,7 +26,7 @@ config KVM
>> select KVM_ARM_HOST
>> select KVM_ARM_VGIC
>> select KVM_ARM_TIMER
>> - select HAVE_KVM_ARCH_DIRTY_LOG
>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>> ---help---
>> Support hosting virtualized guest machines.
>>
>> --
>> 1.9.1
>>
>
> this patch needs to be rebased onto the newest version of your v7 patch,
> but otherwise it looks roughly ok.
Ok,
Thanks.
>
> -Christoffer
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-11-07 20:51 ` Mario Smarduch
@ 2014-11-19 14:39 ` Christoffer Dall
2014-11-19 20:15 ` Mario Smarduch
0 siblings, 1 reply; 14+ messages in thread
From: Christoffer Dall @ 2014-11-19 14:39 UTC (permalink / raw)
To: linux-arm-kernel
Hi Mario,
On Fri, Nov 07, 2014 at 12:51:39PM -0800, Mario Smarduch wrote:
> On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> > On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
> >> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
> >>
> >> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> >> ---
> >> arch/arm/include/asm/kvm_host.h | 12 ------------
> >> arch/arm/kvm/arm.c | 9 ---------
> >> arch/arm/kvm/mmu.c | 17 +++++++++++------
> >> arch/arm64/kvm/Kconfig | 2 +-
> >> 4 files changed, 12 insertions(+), 28 deletions(-)
> >>
> >> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> >> index 12311a5..59565f5 100644
> >> --- a/arch/arm/include/asm/kvm_host.h
> >> +++ b/arch/arm/include/asm/kvm_host.h
> >> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
> >> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
> >> }
> >>
> >> -/**
> >> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
> >> - * @kvm: pointer to kvm structure.
> >> - *
> >> - * Interface to HYP function to flush all VM TLB entries without address
> >> - * parameter.
> >> - */
> >> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> >> -{
> >> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> >> -}
> >> -
> >> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
> >> {
> >> return 0;
> >> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> >> index 0546fa3..6a6fd6b 100644
> >> --- a/arch/arm/kvm/arm.c
> >> +++ b/arch/arm/kvm/arm.c
> >> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> >> const struct kvm_memory_slot *old,
> >> enum kvm_mr_change change)
> >> {
> >> -#ifdef CONFIG_ARM
> >> /*
> >> * At this point memslot has been committed and there is an
> >> * allocated dirty_bitmap[], dirty pages will be be tracked while the
> >> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> >> */
> >> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
> >> kvm_mmu_wp_memory_region(kvm, mem->slot);
> >> -#endif
> >> }
> >>
> >> void kvm_arch_flush_shadow_all(struct kvm *kvm)
> >> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
> >> }
> >> }
> >>
> >> -#ifdef CONFIG_ARM64
> >> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
> >> -{
> >> - return -EINVAL;
> >> -}
> >> -#endif
> >> -
> >> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
> >> struct kvm_arm_device_addr *dev_addr)
> >> {
> >> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> >> index df1a5a3..8c0f9f2 100644
> >> --- a/arch/arm/kvm/mmu.c
> >> +++ b/arch/arm/kvm/mmu.c
> >> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
> >>
> >> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
> >> {
> >> -#ifdef CONFIG_ARM
> >> return !!memslot->dirty_bitmap;
> >> -#else
> >> - return false;
> >> -#endif
> >> +}
> >> +
> >> +/**
> >> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
> >> + * @kvm: pointer to kvm structure.
> >> + *
> >> + * Interface to HYP function to flush all VM TLB entries
> >> + */
> >> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> >> +{
> >> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> >> }
> >>
> >> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> >> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
> >> return false;
> >> }
> >>
> >> -#ifdef CONFIG_ARM
> >> /**
> >> * stage2_wp_ptes - write protect PMD range
> >> * @pmd: pointer to pmd entry
> >> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
> >>
> >> stage2_wp_range(kvm, start, end);
> >> }
> >> -#endif
> >>
> >> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> >> struct kvm_memory_slot *memslot,
> >> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> >> index 40a8d19..a1a35809 100644
> >> --- a/arch/arm64/kvm/Kconfig
> >> +++ b/arch/arm64/kvm/Kconfig
> >> @@ -26,7 +26,7 @@ config KVM
> >> select KVM_ARM_HOST
> >> select KVM_ARM_VGIC
> >> select KVM_ARM_TIMER
> >> - select HAVE_KVM_ARCH_DIRTY_LOG
> >> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
> >> ---help---
> >> Support hosting virtualized guest machines.
> >>
> >> --
> >> 1.9.1
> >>
> >
> > this patch needs to be rebased onto the newest version of your v7 patch,
> > but otherwise it looks roughly ok.
>
Just discussed with Marc, that we'll try to merge the v7 patches asap,
but when you send out the rebased series for v8, you need to handle the
pud_huge case in the write-protect patch.
-Christoffer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-11-19 14:39 ` Christoffer Dall
@ 2014-11-19 20:15 ` Mario Smarduch
2014-11-21 10:09 ` Christoffer Dall
0 siblings, 1 reply; 14+ messages in thread
From: Mario Smarduch @ 2014-11-19 20:15 UTC (permalink / raw)
To: linux-arm-kernel
On 11/19/2014 06:39 AM, Christoffer Dall wrote:
> Hi Mario,
>
> On Fri, Nov 07, 2014 at 12:51:39PM -0800, Mario Smarduch wrote:
>> On 11/07/2014 12:20 PM, Christoffer Dall wrote:
>>> On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
>>>> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
>>>>
>>>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>>>> ---
>>>> arch/arm/include/asm/kvm_host.h | 12 ------------
>>>> arch/arm/kvm/arm.c | 9 ---------
>>>> arch/arm/kvm/mmu.c | 17 +++++++++++------
>>>> arch/arm64/kvm/Kconfig | 2 +-
>>>> 4 files changed, 12 insertions(+), 28 deletions(-)
>>>>
>>>> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
>>>> index 12311a5..59565f5 100644
>>>> --- a/arch/arm/include/asm/kvm_host.h
>>>> +++ b/arch/arm/include/asm/kvm_host.h
>>>> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
>>>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
>>>> }
>>>>
>>>> -/**
>>>> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
>>>> - * @kvm: pointer to kvm structure.
>>>> - *
>>>> - * Interface to HYP function to flush all VM TLB entries without address
>>>> - * parameter.
>>>> - */
>>>> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>>>> -{
>>>> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>>>> -}
>>>> -
>>>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>>>> {
>>>> return 0;
>>>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>>>> index 0546fa3..6a6fd6b 100644
>>>> --- a/arch/arm/kvm/arm.c
>>>> +++ b/arch/arm/kvm/arm.c
>>>> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>>>> const struct kvm_memory_slot *old,
>>>> enum kvm_mr_change change)
>>>> {
>>>> -#ifdef CONFIG_ARM
>>>> /*
>>>> * At this point memslot has been committed and there is an
>>>> * allocated dirty_bitmap[], dirty pages will be be tracked while the
>>>> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>>>> */
>>>> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
>>>> kvm_mmu_wp_memory_region(kvm, mem->slot);
>>>> -#endif
>>>> }
>>>>
>>>> void kvm_arch_flush_shadow_all(struct kvm *kvm)
>>>> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>>>> }
>>>> }
>>>>
>>>> -#ifdef CONFIG_ARM64
>>>> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
>>>> -{
>>>> - return -EINVAL;
>>>> -}
>>>> -#endif
>>>> -
>>>> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
>>>> struct kvm_arm_device_addr *dev_addr)
>>>> {
>>>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
>>>> index df1a5a3..8c0f9f2 100644
>>>> --- a/arch/arm/kvm/mmu.c
>>>> +++ b/arch/arm/kvm/mmu.c
>>>> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>>>>
>>>> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
>>>> {
>>>> -#ifdef CONFIG_ARM
>>>> return !!memslot->dirty_bitmap;
>>>> -#else
>>>> - return false;
>>>> -#endif
>>>> +}
>>>> +
>>>> +/**
>>>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
>>>> + * @kvm: pointer to kvm structure.
>>>> + *
>>>> + * Interface to HYP function to flush all VM TLB entries
>>>> + */
>>>> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>>>> +{
>>>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>>>> }
>>>>
>>>> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
>>>> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
>>>> return false;
>>>> }
>>>>
>>>> -#ifdef CONFIG_ARM
>>>> /**
>>>> * stage2_wp_ptes - write protect PMD range
>>>> * @pmd: pointer to pmd entry
>>>> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>>>>
>>>> stage2_wp_range(kvm, start, end);
>>>> }
>>>> -#endif
>>>>
>>>> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>>>> struct kvm_memory_slot *memslot,
>>>> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
>>>> index 40a8d19..a1a35809 100644
>>>> --- a/arch/arm64/kvm/Kconfig
>>>> +++ b/arch/arm64/kvm/Kconfig
>>>> @@ -26,7 +26,7 @@ config KVM
>>>> select KVM_ARM_HOST
>>>> select KVM_ARM_VGIC
>>>> select KVM_ARM_TIMER
>>>> - select HAVE_KVM_ARCH_DIRTY_LOG
>>>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>>>> ---help---
>>>> Support hosting virtualized guest machines.
>>>>
>>>> --
>>>> 1.9.1
>>>>
>>>
>>> this patch needs to be rebased onto the newest version of your v7 patch,
>>> but otherwise it looks roughly ok.
>>
> Just discussed with Marc, that we'll try to merge the v7 patches asap,
Hi Christoffer,
that's good to hear, hopefully v7 patches are not to far behind to merge.
> but when you send out the rebased series for v8, you need to handle the
> pud_huge case in the write-protect patch.
Making the addition should be straightforward, but testing I'm not
sure how at this time, 2MB is only huge page size supported
by the kernel on arm64 (plus many other platforms). Maybe something
rigged up using memreserve ... but I'm not sure.
The target for that would be subsequent (not next) merge window correct?
- Mario
>
> -Christoffer
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-11-19 20:15 ` Mario Smarduch
@ 2014-11-21 10:09 ` Christoffer Dall
2014-11-22 0:42 ` Mario Smarduch
0 siblings, 1 reply; 14+ messages in thread
From: Christoffer Dall @ 2014-11-21 10:09 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 19, 2014 at 12:15:55PM -0800, Mario Smarduch wrote:
> On 11/19/2014 06:39 AM, Christoffer Dall wrote:
> > Hi Mario,
> >
> > On Fri, Nov 07, 2014 at 12:51:39PM -0800, Mario Smarduch wrote:
> >> On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> >>> On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
> >>>> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
> >>>>
> >>>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> >>>> ---
> >>>> arch/arm/include/asm/kvm_host.h | 12 ------------
> >>>> arch/arm/kvm/arm.c | 9 ---------
> >>>> arch/arm/kvm/mmu.c | 17 +++++++++++------
> >>>> arch/arm64/kvm/Kconfig | 2 +-
> >>>> 4 files changed, 12 insertions(+), 28 deletions(-)
> >>>>
> >>>> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> >>>> index 12311a5..59565f5 100644
> >>>> --- a/arch/arm/include/asm/kvm_host.h
> >>>> +++ b/arch/arm/include/asm/kvm_host.h
> >>>> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
> >>>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
> >>>> }
> >>>>
> >>>> -/**
> >>>> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
> >>>> - * @kvm: pointer to kvm structure.
> >>>> - *
> >>>> - * Interface to HYP function to flush all VM TLB entries without address
> >>>> - * parameter.
> >>>> - */
> >>>> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> >>>> -{
> >>>> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> >>>> -}
> >>>> -
> >>>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
> >>>> {
> >>>> return 0;
> >>>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> >>>> index 0546fa3..6a6fd6b 100644
> >>>> --- a/arch/arm/kvm/arm.c
> >>>> +++ b/arch/arm/kvm/arm.c
> >>>> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> >>>> const struct kvm_memory_slot *old,
> >>>> enum kvm_mr_change change)
> >>>> {
> >>>> -#ifdef CONFIG_ARM
> >>>> /*
> >>>> * At this point memslot has been committed and there is an
> >>>> * allocated dirty_bitmap[], dirty pages will be be tracked while the
> >>>> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
> >>>> */
> >>>> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
> >>>> kvm_mmu_wp_memory_region(kvm, mem->slot);
> >>>> -#endif
> >>>> }
> >>>>
> >>>> void kvm_arch_flush_shadow_all(struct kvm *kvm)
> >>>> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
> >>>> }
> >>>> }
> >>>>
> >>>> -#ifdef CONFIG_ARM64
> >>>> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
> >>>> -{
> >>>> - return -EINVAL;
> >>>> -}
> >>>> -#endif
> >>>> -
> >>>> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
> >>>> struct kvm_arm_device_addr *dev_addr)
> >>>> {
> >>>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> >>>> index df1a5a3..8c0f9f2 100644
> >>>> --- a/arch/arm/kvm/mmu.c
> >>>> +++ b/arch/arm/kvm/mmu.c
> >>>> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
> >>>>
> >>>> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
> >>>> {
> >>>> -#ifdef CONFIG_ARM
> >>>> return !!memslot->dirty_bitmap;
> >>>> -#else
> >>>> - return false;
> >>>> -#endif
> >>>> +}
> >>>> +
> >>>> +/**
> >>>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
> >>>> + * @kvm: pointer to kvm structure.
> >>>> + *
> >>>> + * Interface to HYP function to flush all VM TLB entries
> >>>> + */
> >>>> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> >>>> +{
> >>>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> >>>> }
> >>>>
> >>>> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> >>>> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
> >>>> return false;
> >>>> }
> >>>>
> >>>> -#ifdef CONFIG_ARM
> >>>> /**
> >>>> * stage2_wp_ptes - write protect PMD range
> >>>> * @pmd: pointer to pmd entry
> >>>> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
> >>>>
> >>>> stage2_wp_range(kvm, start, end);
> >>>> }
> >>>> -#endif
> >>>>
> >>>> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> >>>> struct kvm_memory_slot *memslot,
> >>>> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> >>>> index 40a8d19..a1a35809 100644
> >>>> --- a/arch/arm64/kvm/Kconfig
> >>>> +++ b/arch/arm64/kvm/Kconfig
> >>>> @@ -26,7 +26,7 @@ config KVM
> >>>> select KVM_ARM_HOST
> >>>> select KVM_ARM_VGIC
> >>>> select KVM_ARM_TIMER
> >>>> - select HAVE_KVM_ARCH_DIRTY_LOG
> >>>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
> >>>> ---help---
> >>>> Support hosting virtualized guest machines.
> >>>>
> >>>> --
> >>>> 1.9.1
> >>>>
> >>>
> >>> this patch needs to be rebased onto the newest version of your v7 patch,
> >>> but otherwise it looks roughly ok.
> >>
> > Just discussed with Marc, that we'll try to merge the v7 patches asap,
>
> Hi Christoffer,
> that's good to hear, hopefully v7 patches are not to far behind to merge.
>
> > but when you send out the rebased series for v8, you need to handle the
> > pud_huge case in the write-protect patch.
>
> Making the addition should be straightforward, but testing I'm not
> sure how at this time, 2MB is only huge page size supported
> by the kernel on arm64 (plus many other platforms). Maybe something
> rigged up using memreserve ... but I'm not sure.
Let's start by making sure we're not regressing setups that we can
easily test and we'll review the code.
>
> The target for that would be subsequent (not next) merge window correct?
>
Probably, it's getting tight already.
-Christoffer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
2014-11-21 10:09 ` Christoffer Dall
@ 2014-11-22 0:42 ` Mario Smarduch
0 siblings, 0 replies; 14+ messages in thread
From: Mario Smarduch @ 2014-11-22 0:42 UTC (permalink / raw)
To: linux-arm-kernel
On 11/21/2014 02:09 AM, Christoffer Dall wrote:
> On Wed, Nov 19, 2014 at 12:15:55PM -0800, Mario Smarduch wrote:
>> On 11/19/2014 06:39 AM, Christoffer Dall wrote:
>>> Hi Mario,
>>>
>>> On Fri, Nov 07, 2014 at 12:51:39PM -0800, Mario Smarduch wrote:
>>>> On 11/07/2014 12:20 PM, Christoffer Dall wrote:
>>>>> On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
>>>>>> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
>>>>>>
>>>>>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>>>>>> ---
>>>>>> arch/arm/include/asm/kvm_host.h | 12 ------------
>>>>>> arch/arm/kvm/arm.c | 9 ---------
>>>>>> arch/arm/kvm/mmu.c | 17 +++++++++++------
>>>>>> arch/arm64/kvm/Kconfig | 2 +-
>>>>>> 4 files changed, 12 insertions(+), 28 deletions(-)
>>>>>>
>>>>>> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
>>>>>> index 12311a5..59565f5 100644
>>>>>> --- a/arch/arm/include/asm/kvm_host.h
>>>>>> +++ b/arch/arm/include/asm/kvm_host.h
>>>>>> @@ -220,18 +220,6 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
>>>>>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
>>>>>> }
>>>>>>
>>>>>> -/**
>>>>>> - * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
>>>>>> - * @kvm: pointer to kvm structure.
>>>>>> - *
>>>>>> - * Interface to HYP function to flush all VM TLB entries without address
>>>>>> - * parameter.
>>>>>> - */
>>>>>> -static inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>>>>>> -{
>>>>>> - kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>>>>>> -}
>>>>>> -
>>>>>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>>>>>> {
>>>>>> return 0;
>>>>>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>>>>>> index 0546fa3..6a6fd6b 100644
>>>>>> --- a/arch/arm/kvm/arm.c
>>>>>> +++ b/arch/arm/kvm/arm.c
>>>>>> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>>>>>> const struct kvm_memory_slot *old,
>>>>>> enum kvm_mr_change change)
>>>>>> {
>>>>>> -#ifdef CONFIG_ARM
>>>>>> /*
>>>>>> * At this point memslot has been committed and there is an
>>>>>> * allocated dirty_bitmap[], dirty pages will be be tracked while the
>>>>>> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>>>>>> */
>>>>>> if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
>>>>>> kvm_mmu_wp_memory_region(kvm, mem->slot);
>>>>>> -#endif
>>>>>> }
>>>>>>
>>>>>> void kvm_arch_flush_shadow_all(struct kvm *kvm)
>>>>>> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> -#ifdef CONFIG_ARM64
>>>>>> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
>>>>>> -{
>>>>>> - return -EINVAL;
>>>>>> -}
>>>>>> -#endif
>>>>>> -
>>>>>> static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
>>>>>> struct kvm_arm_device_addr *dev_addr)
>>>>>> {
>>>>>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
>>>>>> index df1a5a3..8c0f9f2 100644
>>>>>> --- a/arch/arm/kvm/mmu.c
>>>>>> +++ b/arch/arm/kvm/mmu.c
>>>>>> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>>>>>>
>>>>>> static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
>>>>>> {
>>>>>> -#ifdef CONFIG_ARM
>>>>>> return !!memslot->dirty_bitmap;
>>>>>> -#else
>>>>>> - return false;
>>>>>> -#endif
>>>>>> +}
>>>>>> +
>>>>>> +/**
>>>>>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
>>>>>> + * @kvm: pointer to kvm structure.
>>>>>> + *
>>>>>> + * Interface to HYP function to flush all VM TLB entries
>>>>>> + */
>>>>>> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
>>>>>> +{
>>>>>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>>>>>> }
>>>>>>
>>>>>> static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
>>>>>> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
>>>>>> return false;
>>>>>> }
>>>>>>
>>>>>> -#ifdef CONFIG_ARM
>>>>>> /**
>>>>>> * stage2_wp_ptes - write protect PMD range
>>>>>> * @pmd: pointer to pmd entry
>>>>>> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>>>>>>
>>>>>> stage2_wp_range(kvm, start, end);
>>>>>> }
>>>>>> -#endif
>>>>>>
>>>>>> static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>>>>>> struct kvm_memory_slot *memslot,
>>>>>> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
>>>>>> index 40a8d19..a1a35809 100644
>>>>>> --- a/arch/arm64/kvm/Kconfig
>>>>>> +++ b/arch/arm64/kvm/Kconfig
>>>>>> @@ -26,7 +26,7 @@ config KVM
>>>>>> select KVM_ARM_HOST
>>>>>> select KVM_ARM_VGIC
>>>>>> select KVM_ARM_TIMER
>>>>>> - select HAVE_KVM_ARCH_DIRTY_LOG
>>>>>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>>>>>> ---help---
>>>>>> Support hosting virtualized guest machines.
>>>>>>
>>>>>> --
>>>>>> 1.9.1
>>>>>>
>>>>>
>>>>> this patch needs to be rebased onto the newest version of your v7 patch,
>>>>> but otherwise it looks roughly ok.
>>>>
>>> Just discussed with Marc, that we'll try to merge the v7 patches asap,
>>
>> Hi Christoffer,
>> that's good to hear, hopefully v7 patches are not to far behind to merge.
>>
>>> but when you send out the rebased series for v8, you need to handle the
>>> pud_huge case in the write-protect patch.
>>
>> Making the addition should be straightforward, but testing I'm not
>> sure how at this time, 2MB is only huge page size supported
>> by the kernel on arm64 (plus many other platforms). Maybe something
>> rigged up using memreserve ... but I'm not sure.
>
> Let's start by making sure we're not regressing setups that we can
> easily test and we'll review the code.
Great will do.
>
>>
>> The target for that would be subsequent (not next) merge window correct?
>>
> Probably, it's getting tight already.
That works well for me too, I'll be back to opensource work Dec. 1st.
Thanks,
Mario
>
> -Christoffer
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-11-22 0:42 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-10 2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
2014-10-10 2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:49 ` Mario Smarduch
2014-10-10 2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:50 ` Mario Smarduch
2014-10-10 2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
2014-11-07 20:20 ` Christoffer Dall
2014-11-07 20:51 ` Mario Smarduch
2014-11-19 14:39 ` Christoffer Dall
2014-11-19 20:15 ` Mario Smarduch
2014-11-21 10:09 ` Christoffer Dall
2014-11-22 0:42 ` Mario Smarduch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).