Received: by 10.223.176.5 with SMTP id f5csp1760193wra; Thu, 8 Feb 2018 03:03:50 -0800 (PST) X-Google-Smtp-Source: AH8x226YXVoPjg99vbovp3KK/WkzewVyrr8slH5s83eddEtGNGwqkLtO5yNQCGxd7Sq18qcEW/Dd X-Received: by 10.98.155.141 with SMTP id e13mr272034pfk.89.1518087830096; Thu, 08 Feb 2018 03:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518087830; cv=none; d=google.com; s=arc-20160816; b=tuvURcElvMkRbdK5W2T45LB5duZT9vJsJloUOreVGES3U6CGWtY8vUrrLpBbZZFJwc /Q6Lwx4U6vgkpBXpjTHz/CgX5cHsqFsW5JzIrYEpVWuSlxy9MRnDbXfDvQQyTJbjoqYy 7WSK5YdroL/c2kv+0o5XtvukX48VLYQxKhm4cM5zklVWRIjhBbwxsn3Tuo6kFrxud0UY +mipmUw2wW+XENIKAUBunRTFJ6iiSFl8AX9b9FYbxaalDtcHjvdAV8kJVIkhP8WNQJy0 6DirNWlmdoBe/NvB0VdWDp/EeTLiXPLQxtJRJqQY14jTicZN6cZnCsQqnbH/TjLc247G 1c/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Y5x33JHUv2wkoLDtmIkIzDtH3bhyh+E1ylTabfFBs5k=; b=Oez4zJ1gz7NFkuOVvGpHPcfIqdmwvbJc/dg76LCTDf65vV1BpEvdm9OUssgfmiqv04 eXrFAzyZpflC8hcIJJwnPffxQw9KBh5QDWVszrdF+yvpCc9XYTQ6DQm4UHS7DNo2W6/4 AEbrYzRjEnMuOlhFqDvPci7/fuxcFL0uSwXP2XC1N6taCseHEeHf22WFF9tAyaejBRSb G76yLBamJQa4/k3GyqgXu6z5foJyyQXIIy0Du8WKSNBJOpt8j8P2MD3M2hN26DLuhn94 jWvZmVs2MzWLSVmO0Ny82L7VI2I2PmQ5r10MZCxHrjy3+pyBUYL47TEPVJZq4Y/RgJgr eb2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HvkJvWro; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si1024541pfi.388.2018.02.08.03.03.36; Thu, 08 Feb 2018 03:03:50 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=HvkJvWro; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbeBHLAv (ORCPT + 99 others); Thu, 8 Feb 2018 06:00:51 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35441 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeBHLAu (ORCPT ); Thu, 8 Feb 2018 06:00:50 -0500 Received: by mail-wm0-f65.google.com with SMTP id r78so9129250wme.0 for ; Thu, 08 Feb 2018 03:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y5x33JHUv2wkoLDtmIkIzDtH3bhyh+E1ylTabfFBs5k=; b=HvkJvWromY2wLF8LonteBJ8oY4jz4IJSjy9uTpoXdqahCGFKLJVmijVlR40Hb2k9Ul 4pXRR1/m62Sgy3bNgUYw5pwETV45S4h8AFGk8nP3ajKogh9r6eS27wh9ecxZevPW5wV2 +9lVn6baKFz4zWcvfttmS4HtM32UDCFD4iFxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y5x33JHUv2wkoLDtmIkIzDtH3bhyh+E1ylTabfFBs5k=; b=X6aPCUSHW4q1a4NHrZQ7bbmEDDagzezrRlSOxZKMw8yIQ5mx8c1zyM879+oGRGEtRo oCRFuBxgn0+SEEOqMsNhxqXaa2773oJznv6I0jg6GFbEiESuE4wN32tGjJzfL1r+w+x0 W9puRhZyAYE4A0JSh0oxhE/JaHdzVVQxl5GTMVkq2uDJUuY3w7g4gwhuf+L6INatM28B L56T9rdgMzrxWoeVV13UjNu4FRYjDzLK4T0bh65DWvGQw8vqmc/IwdBbNozY4kAH/HYM lunjNfh+I6XQ/LXv88Tx4/I0D4Zk15hGOZM2Jfj+heAMAntx+LdB/2MHLrQdV5NEwUGb fpWQ== X-Gm-Message-State: APf1xPDAGXbDhEn7ip1DLB+VhVNsAUnu5uQymYe0FgsOqnGP1QasXl1l Ab5IawMVrZZqfix79I2oiF3cXcyFalI= X-Received: by 10.80.138.130 with SMTP id j2mr1024635edj.36.1518087648981; Thu, 08 Feb 2018 03:00:48 -0800 (PST) Received: from localhost (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id g7sm2414071edf.76.2018.02.08.03.00.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 03:00:48 -0800 (PST) Date: Thu, 8 Feb 2018 12:00:47 +0100 From: Christoffer Dall To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, kristina.martsenko@arm.com, peter.maydell@linaro.org, pbonzini@redhat.com, rkrcmar@redhat.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, mark.rutland@arm.com, catalin.marinas@arm.com, Christoffer Dall Subject: Re: [PATCH v1 06/16] kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table Message-ID: <20180208110047.GI29286@cbox> References: <20180109190414.4017-1-suzuki.poulose@arm.com> <20180109190414.4017-7-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109190414.4017-7-suzuki.poulose@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 09, 2018 at 07:04:01PM +0000, Suzuki K Poulose wrote: > 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. > Acked-by: Christoffer Dall > Cc: Marc Zyngier > Cc: 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 761787befd3b..e6548c85c495 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.13.6 >