Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp670820imm; Fri, 29 Jun 2018 04:34:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK/bGgd2ZLZWcuPvi1eyTEHxkGnAGbtSL0SoQ9eg5XuSSQHKvPZr1cdFXXLx2SO/ngh50zT X-Received: by 2002:a65:4b0f:: with SMTP id r15-v6mr12500199pgq.103.1530272076274; Fri, 29 Jun 2018 04:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530272076; cv=none; d=google.com; s=arc-20160816; b=qjYxr5Dz4nWwlGdWbnYgFQW5ddVXeU7Ud26n19TYeDpqQycNsel70mFq0RB1C6FX3g iLBRfJxphzyutCqGzaR8UpwakC1vKkTAYre6QgIsoKjlyH3Q2b6buiGAoq5IJtVOaJtO jIcMW2dnn5pXG3mPllWHoFAGa/5WLpO14/kAozgen8ID7QvH0miFbfJKunQ0Upm9F1kZ WK2z2Agzek0w3vOfmZcIz07t/pXXXJ7Sg7+CodY3+KYriT3vDs+OCjYD/b6MUdKzUQ34 5FqafecwAYUiG9zC1X1MkNxCe+yJJp4wposXJ+pO6r1JmPgnm/tnwjaGsdzLxMQA4prs PCrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OEzXXa9PkmMBgm/02Z/ktiFY0lFEGjbU9gCyBPv6Sm4=; b=ovqemqEs9/FXtItCWUSnrcbCEzpelEXwJgs8FpQoWlIOE5kGG98QcV5kkkJ1goNduU lmTh/rOBWdEKwSoIjadGkqs/FEyZlUpTRiC+DeBTQ4+o37PfJRxV0m+PO5CmOcD5F7Uu J09er63eER5/8CO2HrrTauj94HnKqsLIngjky6/1WIpPKYs7p4Ayh0/8RFtrYC6CVAG0 S9sVkfxZ2rBz6mgQ0ljBjeOwgawOzPriSsaqMthqO6Kc6XJWHOuTQDqtYdNslUni7/qr DLRZXapGfWxrfZLipc/EBeKlXDDU9h064fGS5MbWBmNlwkZ8XeoMuXQLRgeXMmAj93py xBGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si171400pgu.649.2018.06.29.04.34.22; Fri, 29 Jun 2018 04:34:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755356AbeF2LYk (ORCPT + 99 others); Fri, 29 Jun 2018 07:24:40 -0400 Received: from foss.arm.com ([217.140.101.70]:60086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755161AbeF2LQ1 (ORCPT ); Fri, 29 Jun 2018 07:16:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1026C15AD; Fri, 29 Jun 2018 04:16:27 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A3E423F266; Fri, 29 Jun 2018 04:16:24 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, marc.zyngier@arm.com, cdall@kernel.org, eric.auger@redhat.com, julien.grall@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, punit.agrawal@arm.com, qemu-devel@nongnu.org, Suzuki K Poulose Subject: [PATCH v3 05/20] kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table Date: Fri, 29 Jun 2018 12:15:25 +0100 Message-Id: <1530270944-11351-6-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530270944-11351-1-git-send-email-suzuki.poulose@arm.com> References: <1530270944-11351-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So far we have only supported 3 level page table with fixed IPA of 40bits. Fix stage2_flush_memslot() to accommodate for 4 level tables. Cc: Marc Zyngier Acked-by: Christoffer Dall Signed-off-by: Suzuki K Poulose --- virt/kvm/arm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 1d90d79..061e6b3 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -379,7 +379,8 @@ static void stage2_flush_memslot(struct kvm *kvm, pgd = kvm->arch.pgd + stage2_pgd_index(addr); do { next = stage2_pgd_addr_end(addr, end); - stage2_flush_puds(kvm, pgd, addr, next); + if (!stage2_pgd_none(*pgd)) + stage2_flush_puds(kvm, pgd, addr, next); } while (pgd++, addr = next, addr != end); } -- 2.7.4