Received: by 10.213.65.68 with SMTP id h4csp646556imn; Tue, 27 Mar 2018 06:17:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx49uHOa1PJb5OqHmJkjfPzyyAdLMypEOPBqpvS1ZNUXmqWmqO0W5ktI4Dg8I8nCNIzvjS5+w X-Received: by 2002:a17:902:7e42:: with SMTP id a2-v6mr6336441pln.13.1522156668248; Tue, 27 Mar 2018 06:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522156668; cv=none; d=google.com; s=arc-20160816; b=yO1HpOAJbcSXR+d1r6zJK2V8+VlvusZXNHUaB8POx0CkzURYRSqHrku6Tw4uXazYOP ooZ/hVhO7bHEB1+ZSZlq0essvfCX0NMB8N+r+O/vLYXcWDsdMw3JiCyBT4bO59Qiu7tl FmPa8JyBMieVuo3+EnxZyrIxOxvgTATFmKRQ46wSzK4TK2isBfCMRPH6Fus47t6zrd/i 0r2/nq70j0CvFjna52CFLHVBomlTzR9/knFB+j62Uf7VTYz5ixMb4F3SPl7hAECt1tnU Tz/YqjDLBTE8jJzxamdDaGYU3dPxCtjhcMKj/lP8E/9aFcDXG01WdZz4/YX6AhUbh6m5 QhKQ== 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=zgZmHD4OxqcM/hNnZv7+dFM4mfrs9Ezre9xZx4JckZk=; b=W5t8P17H94rxqyvC+YUEog0/TXdSgopKUZDkrftQHvVdwmlcNN4UQzJUwUhsoFQvKw dKAZ1GHEITT1M0czEWQZB30I6eH+v8dykn31ABLDFpGqvl0dvSAk6KPYCwMc8D33L+Jk C9PSAI2MeEx3atM4GqV3UnfoLYPcvRjdKJAunNenTtv/44sh3IaA+oRTkTsd4PI1XQ78 6caB4xSHUrdXwQkUg113TDMj9RYmE9GfGwPME58IboZoyAwgVx01yrbnp5LYUsKK3lWE 2ZweMby2/LlKQGSUOekT28D4dhabgxJMAzakqiGwzPBJiON8IVTzG0VyK9hb0Enbhj3f UryA== 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 3-v6si1274615plo.475.2018.03.27.06.17.33; Tue, 27 Mar 2018 06:17:48 -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 S1752766AbeC0NQW (ORCPT + 99 others); Tue, 27 Mar 2018 09:16:22 -0400 Received: from foss.arm.com ([217.140.101.70]:55048 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbeC0NQT (ORCPT ); Tue, 27 Mar 2018 09:16:19 -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 B5FCE1435; Tue, 27 Mar 2018 06:16:18 -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 0C2183F24A; Tue, 27 Mar 2018 06:16:15 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, cdall@kernel.org, marc.zyngier@arm.com, punit.agrawal@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, ard.biesheuvel@linaro.org, peter.maydell@linaro.org, kristina.martsenko@arm.com, mark.rutland@arm.com, Suzuki K Poulose Subject: [PATCH v2 06/17] kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table Date: Tue, 27 Mar 2018 14:15:16 +0100 Message-Id: <1522156531-28348-7-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522156531-28348-1-git-send-email-suzuki.poulose@arm.com> References: <1522156531-28348-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 ec62d1c..16a19fb 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -375,7 +375,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