From patchwork Fri Oct 10 02:34:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 5063301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 017849F295 for ; Fri, 10 Oct 2014 02:38:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23140201FB for ; Fri, 10 Oct 2014 02:38:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77C5B20253 for ; Fri, 10 Oct 2014 02:38:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcQ3B-0002jw-VW; Fri, 10 Oct 2014 02:35:25 +0000 Received: from mailout3.w2.samsung.com ([211.189.100.13] helo=usmailout3.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcQ2s-0001TV-PZ for linux-arm-kernel@lists.infradead.org; Fri, 10 Oct 2014 02:35:07 +0000 Received: from uscpsbgex4.samsung.com (u125.gpu85.samsung.co.kr [203.254.195.125]) by usmailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ND7003FUJ5XOO70@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 09 Oct 2014 22:34:45 -0400 (EDT) X-AuditID: cbfec37d-b7f676d000000907-43-543745c4e2e4 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex4.samsung.com (USCPEXMTA) with SMTP id F9.1D.02311.4C547345; Thu, 09 Oct 2014 22:34:44 -0400 (EDT) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp2.samsung.com (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTP id <0ND7003P8J5WCX60@usmmp2.samsung.com>; Thu, 09 Oct 2014 22:34:44 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.144.129.79) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 09 Oct 2014 19:34:44 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com Subject: [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Date: Thu, 09 Oct 2014 19:34:07 -0700 Message-id: <1412908447-28247-4-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1412908447-28247-1-git-send-email-m.smarduch@samsung.com> References: <1412908447-28247-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsVy+t9hP90jruYhBt/PWFu8X9bDaPHi9T9G iy8/rzNazJlaaPHx1HF2i02Pr7Fa/L3zj81i/7Z/rA4cHmvmrWH02LSqk83jzrU9bB7nN61h 9ti8pN7j/b6rbB6fN8kFsEdx2aSk5mSWpRbp2yVwZRw61chS8ES2Ynv/B8YGxrUSXYycHBIC JhI983ezQNhiEhfurWfrYuTiEBJYxigx/fUbRginl0mioeEBVOYio8T2A3/ZQVrYBHQl9t/b CGRzcIgI5Elcag4BqWEW6GOUuD/1NzNIjTBQfGJvO9gKFgFViXNnNzOC2LwCbhINq96zgfRK CChIzJlkAxLmFHCXmDL5HzNIWAio5OC7KIhqQYkfk++xgISZBSQknn9WAgkLAQ3cdvM5I8T9 ShLTDl9ln8AoNAtJxyyEjgWMTKsYxUqLkwuKk9JTK0z0ihNzi0vz0vWS83M3MUKionYH4/2v NocYBTgYlXh4L8iYhwixJpYVV+YeYpTgYFYS4dU3BQrxpiRWVqUW5ccXleakFh9iZOLglGpg 3DP37e8dL61U102f83fe7vnu7vVpfPZcxrqrLrKuy3JiaNP02utwOYjr2a5E/yuZZ1tecT7U y3L8enSF7uWzzQ3aKoIRi1f+afNrrVtTNTGo+ZeQ0casmyll/DvWvpBKYk982WWr8G2L6PMa jqgPXbK9TWJ8DwR2JfFbrUv6fofj6sSKuSIqSizFGYmGWsxFxYkAyEVWS2gCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141009_193507_003447_76A9C2F5 X-CRM114-Status: GOOD ( 11.97 ) X-Spam-Score: -5.0 (-----) Cc: gleb@kernel.org, pbonzini@redhat.com, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Mario Smarduch X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code. Signed-off-by: Mario Smarduch --- 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.