Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp768058img; Wed, 20 Mar 2019 10:25:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIOHZhDM4Zj/uavzCZLe4aiLuaPB+7Fs7yhoa0yWqortUJ0DSbVHCqPTbqpNAuysQDFPEr X-Received: by 2002:a63:145b:: with SMTP id 27mr8817779pgu.74.1553102738872; Wed, 20 Mar 2019 10:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553102738; cv=none; d=google.com; s=arc-20160816; b=ig/+dmPgQr7f7RkVi8hYFJZMMLTk7hSWXBClJdFCtkfT/dr5AyDF8rNA4PVoGMHksX fCyIcH0rriK0fsZtvEnhVOAQFT34J/t71kvVKKWlTEuHJgJZ+LWUpV9XzsJIAxJkLR5V S2b3pvA20NSc63cfwKtj5dIjW72AMvZ0/9F3IKRrqRaJzE1LJak54Id7iJNAk10cZyB+ G21AusOBqdIb/73JVd0UMid+cmOB1oRsONFBJ4OqEGCMudoiKnF3E3xCxfFiEpkI585A dnFigYPERMsPKFPmP0g+hgRhtaJcBGrUerzJLF9VoIn24iVA/a/TeliuaONSMH6plgZE I4Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=ZVJng0YdwnySHlLeM4TEyAJgqCKpEA49dXehnGoya0U=; b=p3QotIqJJdCHmWFVCCv/OGRX3/e7N8jMM22MRHkdGfMYK76Ma27iXaIrd9jfZTmLWi lg3fHGi6DYh3muLY3ZSY9F/kEjIAUjiF8kK8obgkMAO2lkfDY7hbxz/t5ALONmehBpWx EtaxE9l+YtaKkR79BnpZ3VuYQkfTNB7wEAw3jOaMPpjYQlMI5O+ZUm1y/RNelMwVLuVj zgqO3PriHWZ+0pqFm1BgFqV2ZS7/CfFRGX6UH0PQs912Ao8yQ0TV3B/nVsyRZsLFF/FY FJeBcA1H2x1hdiSU+ajAWbSkeOoZEiUgwO39P60HUBoe9KvW6P3pnNnwg2Yq5pYXwn4p k7eQ== 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 q8si2007081pgp.33.2019.03.20.10.25.22; Wed, 20 Mar 2019 10:25:38 -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 S1726839AbfCTRYZ (ORCPT + 99 others); Wed, 20 Mar 2019 13:24:25 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43364 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbfCTRYY (ORCPT ); Wed, 20 Mar 2019 13:24:24 -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 7E055A78; Wed, 20 Mar 2019 10:24:24 -0700 (PDT) Received: from why.wild-wind.fr.eu.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 90ABB3F614; Wed, 20 Mar 2019 10:24:21 -0700 (PDT) Date: Wed, 20 Mar 2019 17:24:17 +0000 From: Marc Zyngier To: Suzuki K Poulose Cc: , , , , , , , , , , , , , Subject: Re: [PATCH] kvm: arm: Fix handling of stage2 huge mappings Message-ID: <20190320172417.6e769373@why.wild-wind.fr.eu.org> In-Reply-To: References: <25971fd5-3774-3389-a82a-04707480c1e0@huawei.com> <1553004668-23296-1-git-send-email-suzuki.poulose@arm.com> <86d0mmynaz.wl-marc.zyngier@arm.com> <5e7e40b4-7983-4440-179a-6f107cee5994@arm.com> <20190320101126.11ff63af@why.wild-wind.fr.eu.org> <4daf0783-fc50-3346-0732-1e3f53c8ccbc@arm.com> <20190320103511.11d777b9@why.wild-wind.fr.eu.org> Organization: ARM Ltd X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Mar 2019 11:12:47 +0000 Suzuki K Poulose wrote: > Marc, > > On 20/03/2019 10:35, Marc Zyngier wrote: > > On Wed, 20 Mar 2019 10:23:39 +0000 > > Suzuki K Poulose wrote: > > > > Hi Suzuki, > > > >> Marc, > >> > >> On 20/03/2019 10:11, Marc Zyngier wrote: > >>> On Wed, 20 Mar 2019 09:44:38 +0000 > >>> Suzuki K Poulose wrote: > >>> >>>> Hi Marc, > >>>> > >>>> On 20/03/2019 08:15, Marc Zyngier wrote: > >>>>> Hi Suzuki, > >>>>> > >>>>> On Tue, 19 Mar 2019 14:11:08 +0000, > >>>>> Suzuki K Poulose wrote: > > ... > > >>>>>> + if (!pmd_thp_or_huge(old_pmd)) { > >>>>>> + unmap_stage2_range(kvm, addr & S2_PMD_MASK, S2_PMD_SIZE); > >>>>>> + goto retry; > >>>>> >> > >>>>>> + if (!stage2_pud_huge(kvm, old_pud)) { > >>>>>> + unmap_stage2_range(kvm, addr & S2_PUD_MASK, S2_PUD_SIZE); > >>>>> >> > >>>> We should really get rid of the S2_P{U/M}D_* definitions, as they are > >>>> always the same as the host. The only thing that changes is the PGD size > >>>> which varies according to the IPA and the concatenation. > >>>> >> > >> Also what do you think about using P{M,U}D_* instead of S2_P{M,U}D_* > >> above ? I could make that change with the respin. > > > > Given that this is a fix, I'd like it to be as small as obvious as > > possible, making it easier to backport. > > > > I'm happy to take another patch for 5.2 that will drop the whole S2_P* > > if we still think that this should be the case (though what I'd really > > like is to have architectural levels instead of these arbitrary > > definitions). > > I only meant the two new instances added above in the patch. Of course, I > could send something to fix the existing ones. I'd rather be consistent, and use the same names all over the code. Once we decide to change, we do it all in one go. Thanks, M. -- Without deviation from the norm, progress is not possible.