Received: by 10.213.65.68 with SMTP id h4csp902664imn; Wed, 14 Mar 2018 03:48:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELsUmZkTgZmmjn396J8vEUMNIHK/30nExdqTF2qN8M5soHaaRz//FeK/YLTXWaCLIf9cYKuR X-Received: by 10.99.112.20 with SMTP id l20mr3382207pgc.412.1521024482846; Wed, 14 Mar 2018 03:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521024482; cv=none; d=google.com; s=arc-20160816; b=vqeL5jsQZQzz5ya7cQT5wL9LaS5sDwEQjHMBrMAe564aM026FTFmpNVV5PsQnqQN4N oVf07kWy7Pm2sZfT6oHtqdj/VfFlO+7B4D9+jOk7sdsDdLBS3WNJCJItFaxE20exSJBk s9q+seNP3JGkPhidn6FjKwcSUyRMR4zXq0/E/mJB+Kb3txoV1XP61ljnNiuhnnATTq+G aHoA/+XJNh3BYBXZnmbVj0z1vVrj77adANGIt7YuJtsU1YoogSuZl+dkXVtjuoTDRFpL LRbgGHk+//ok6/qpG5M2KaHuCPICB2SU3+egIgSWrZGcVvO9N9R+6OK6MQ4QbFu+IQr3 bOhw== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=e5fomi1be7cXJgdycEHCiYlZej4LoEVU1YDThCUkv9k=; b=EX8UHp2lAgOhRVLXvuG/eSONAUzI/QphdmakWqs2bgw3AOUrkTMxFIgATy9CQ74glx sUBYqhkmRPPU097l8JYuXXAP8UinZ0Yd9RpJm3nlGeqJv9X70IFbNKi/SCCb8g3BI6V3 0nmDx3BValnbjnduPU/COYIXBj4AP8S9RDUbTgVKHCFFu8ldYwrMvo0R+Ul9kwBvbBg7 zG7UwPJmy3tj2mZNU8wKrApYpbJ5Px+Af9o+X+bUJOlD4wotXg1PIG0FHiD6tbFIRQC/ gt4SZk2EcmJZMtRK7pv8SWu9M8Q52/iy7CBq9gSdJ6DkefIYMXgQmkL212qcI/QgNqbR 6O5g== 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 k26si1678858pgn.502.2018.03.14.03.47.36; Wed, 14 Mar 2018 03:48:02 -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 S1751682AbeCNKqL (ORCPT + 99 others); Wed, 14 Mar 2018 06:46:11 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50456 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbeCNKqK (ORCPT ); Wed, 14 Mar 2018 06:46:10 -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 EE68B15AB; Wed, 14 Mar 2018 03:46:09 -0700 (PDT) Received: from [10.1.207.62] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A1193F53D; Wed, 14 Mar 2018 03:46:05 -0700 (PDT) Subject: Re: [PATCH v1 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings" To: Chintan Pandya , 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: Marc Zyngier Organization: ARM Ltd Message-ID: Date: Wed, 14 Mar 2018 10:46:04 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521017305-28518-5-git-send-email-cpandya@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. -- Jazz is not dead. It just smells funny...