From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D68BC43381 for ; Wed, 20 Mar 2019 17:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 532CE21841 for ; Wed, 20 Mar 2019 17:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbfCTRYZ (ORCPT ); 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH] kvm: arm: Fix handling of stage2 huge mappings Date: Wed, 20 Mar 2019 17:24:17 +0000 Message-ID: <20190320172417.6e769373@why.wild-wind.fr.eu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, will.deacon@arm.com, catalin.marinas@arm.com, james.morse@arm.com, julien.thierry@arm.com, wanghaibin.wang@huawei.com, lious.lilei@hisilicon.com, lishuo1@hisilicon.com, zhengxiang9@huawei.com, yuzenghui@huawei.com, christoffer.dall@arm.com List-Id: kvmarm@lists.cs.columbia.edu 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D66DEC43381 for ; Wed, 20 Mar 2019 17:24:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5DF921841 for ; Wed, 20 Mar 2019 17:24:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qipeVtFX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5DF921841 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jCIAO9k/QmvvdkqLoAfmlE7H0ymWMP0v42hijmJh0A8=; b=qipeVtFXnu46rO mfVNrQx8CnDsx5UQWQDg+QrUp+d29gyxNLDT+jUzqiuIM1ngjxytoNcaeJWTYjiIfBQ1XrNrPYLjb RDX6FZgWybl2YYGq314rmVltcy9CAKVKV87mabR9/0exgF0Px/wzdnUJgb0+aPBaSnCaZMllNFkQ0 NJKc80JtrSai+s93nXNnYbFfl1OJBKIaoj/TleKBHD7IVTsVL2tyRBiP/3XBLlzATJ0kCSvVSUAuv /W89ei59toBB2rlrQfxupTkQ44nvjnXtwSdC68KYorBgaZofSuYdbdN19AVlsvBiiSecjbKVs65aP Vh3oC6eyNtnPcX//qqLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ex7-0002IR-4T; Wed, 20 Mar 2019 17:24:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ex0-0002H0-24 for linux-arm-kernel@lists.infradead.org; Wed, 20 Mar 2019 17:24:31 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_102426_111363_8DF6E4F7 X-CRM114-Status: GOOD ( 20.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, julien.thierry@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, zhengxiang9@huawei.com, james.morse@arm.com, lishuo1@hisilicon.com, yuzenghui@huawei.com, wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, lious.lilei@hisilicon.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel