Received: by 10.213.65.68 with SMTP id h4csp926849imn; Wed, 14 Mar 2018 04:34:12 -0700 (PDT) X-Google-Smtp-Source: AG47ELvERtp+Dc3Z/Ozk6tvdUqQSYNEfN2OnRK+SYAFPyuTvHJyZ/NfiUGD6KxfkbI91QGGGoewq X-Received: by 10.99.142.201 with SMTP id k192mr3422226pge.278.1521027252162; Wed, 14 Mar 2018 04:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521027252; cv=none; d=google.com; s=arc-20160816; b=SCCOtR6YsHG87QC1JEFn0Ajm4fqCMN1rXBr4InEifjYB3SLixVfRlBymzQJYbNRa+Q ISRM6ifI1uKjatzV/QKtwnRX4wFlVzNt7zKICysgfhkQqiKTYQQICgwipv85mH8L8YoA PFqKE3mjdRZSMRWH1f9MygKCnI2HIwytKteD2yqrqruQ9w33Mysll7X7KU0V8cKl8CYC fyBVCkuiw+MVP7OG6hKK0aHF9KqmO+SAC9B883kfGb5HmP+p+knYADqRs7Ugy94IRwwJ OVtcMvQEN3Vb759TnT23KKNxWBpopO9j2TApkpm4OfdnNwEQoOjuOAOJ5sCgLmL0Yx0w 53sA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=XFTbaRgbUsSUx+CD60ACZ6j7ArZJguRCQW2QTrf8mHc=; b=Kj0pZOl6wqKpqqqCRpeYob7JWKJmjS5xJn+UeefK6ogRfxnMnRJI0Nhim/A738QrT6 3yEnm506PvITNnC1/QhcpaYLqd9IUE6X4eMdeiHbuxNtrHP2a6ZMkJykeF/SxhyfiWMP Gp6IFY+7SYvE7pn/pc0dt2k6lH2uMSucxVR8AnX1m7Qz3QNYetWLlbwIZneHMvtvqL1m P3XwmoMoJiob8lsjc4Qhv5QfXyictKgn27rpGTfT9GyZKDh2ssU98S/D9eysNH9ES0ph u/+CpHsO3gHTPr8cQTaWWmvMN+lxdfOywbDGw6BntBmdlttfq+yonBWWfLbZL7GqpaPQ ckKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YS9ZaEnh; dkim=pass header.i=@codeaurora.org header.s=default header.b=UDNWmpyb; 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 v11si1743918pgb.652.2018.03.14.04.33.56; Wed, 14 Mar 2018 04:34:12 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=YS9ZaEnh; dkim=pass header.i=@codeaurora.org header.s=default header.b=UDNWmpyb; 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 S1751420AbeCNLco (ORCPT + 99 others); Wed, 14 Mar 2018 07:32:44 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33686 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbeCNLcn (ORCPT ); Wed, 14 Mar 2018 07:32:43 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8F9406081A; Wed, 14 Mar 2018 11:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521027162; bh=aw/wBuhCIUD0lxeftVza6Bv8E3ma24zD15Yt5lXUgl8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YS9ZaEnhNqLntkevFaerijAwjS6wo5Z5Zyy+bgdB0G+GZONxgH4gHBOA4FIsktZJ+ Ih1b6DAXH2Rh6Nl+Di8Xd9d4iL3Ll0U+Lh+ZOpAJWCbBF40gGr4jiNS2X0ijoKPF/g YkIwDM5mGx65SgOHUnRBW/R9Mp71RDF3hBKSdDQA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.79.109] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cpandya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 838D860590; Wed, 14 Mar 2018 11:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521027161; bh=aw/wBuhCIUD0lxeftVza6Bv8E3ma24zD15Yt5lXUgl8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=UDNWmpybzCRpMb1P/lcF7UZUig02d6NSpDlGmaGuQyuprKsJ7GFiLKQde/4THEFFF GSJZg6WOkyzS+a2/Qlrg2OcEWERb262tHZtNvfqez/FHZELm1cZbxhRAXDy80ErfhC cD95Y+HW93/unJqIKPHG4yDndIC7+UAz5HCs3N94= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 838D860590 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cpandya@codeaurora.org Subject: Re: [PATCH v1 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings" To: Marc Zyngier , catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de Cc: mark.rutland@arm.com, ard.biesheuvel@linaro.org, james.morse@arm.com, kristina.martsenko@arm.com, takahiro.akashi@linaro.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org, toshi.kani@hpe.com References: <1521017305-28518-1-git-send-email-cpandya@codeaurora.org> <1521017305-28518-5-git-send-email-cpandya@codeaurora.org> From: Chintan Pandya Message-ID: Date: Wed, 14 Mar 2018 17:02:33 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/2018 4:16 PM, Marc Zyngier wrote: > On 14/03/18 08:48, Chintan Pandya wrote: >> This commit 15122ee2c515a ("arm64: Enforce BBM for huge >> IO/VMAP mappings") is a temporary work-around until the >> issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. >> >> Revert this change as we have fixes for the issue. >> >> Signed-off-by: Chintan Pandya >> --- >> arch/arm64/mm/mmu.c | 8 -------- >> 1 file changed, 8 deletions(-) >> >> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c >> index c0df264..19116c6 100644 >> --- a/arch/arm64/mm/mmu.c >> +++ b/arch/arm64/mm/mmu.c >> @@ -935,10 +935,6 @@ int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot) >> pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | >> pgprot_val(mk_sect_prot(prot))); >> >> - /* ioremap_page_range doesn't honour BBM */ >> - if (pud_present(READ_ONCE(*pudp))) >> - return 0; >> - >> BUG_ON(phys & ~PUD_MASK); >> if (pud_val(*pud) && !pud_huge(*pud)) >> free_page((unsigned long)__va(pud_val(*pud))); >> @@ -952,10 +948,6 @@ int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot) >> pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | >> pgprot_val(mk_sect_prot(prot))); >> >> - /* ioremap_page_range doesn't honour BBM */ >> - if (pmd_present(READ_ONCE(*pmdp))) >> - return 0; >> - >> BUG_ON(phys & ~PMD_MASK); >> if (pmd_val(*pmd) && !pmd_huge(*pmd)) >> free_page((unsigned long)__va(pmd_val(*pmd))); >> > > But you're still not doing a BBM, right? What prevents a speculative > access from using the (now freed) entry? The TLB invalidation you've > introduce just narrows the window where bad things can happen. Valid point. I will rework on these patches. Thanks Marc. > > My gut feeling is that this series introduces more bugs than it fixes... > If you're going to fix it, please fix it by correctly implementing BBM > for huge mappings. > > Or am I missing something terribly obvious? > > M. > Chintan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project