Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp497845imm; Fri, 5 Oct 2018 07:14:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV61pEjIrqpIz/USwVoWRstXXvpP6HOKmk7+FnqGoC73s9Uz2KwdEAhpmb78yXsBZPSpbzLwb X-Received: by 2002:a17:902:1121:: with SMTP id d30-v6mr11472665pla.250.1538748859181; Fri, 05 Oct 2018 07:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538748859; cv=none; d=google.com; s=arc-20160816; b=hQ8Z9/YdexKp4/gQ4bzdOpAANJdaOJOu7+gb/8NX/hPXUFRf6WsqxsBO0RfKgKRWcI WmoOmDIsLepBs2DhNoKsok2p0Lo22w61JqyEpVFOpW2x4aP+dCo7WpnDuByPpZqRvZ+1 0SBAI10tkGSIQGrQjPJjyKLkWX5X3OKdrNCVmMF4FdjvelCysDJdlo23c0ZAWMdPItgJ ZhHnzrA97OId1KcoNj76pozKFgvzN8vt+4wpHaQw5t7eGWMrgWL25qguDsesL8YSEB8I ioGcIEVIAtgZhQpMmxhhLKxAGFLZAIJ0YlO+Rej0AkdZCrMBxLGFAg5XWcgXzIHMykOW vOuQ== 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:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=wNDn9c5XkwC4Llal6KmqiuskgWLjTpaXVc4//jLWLXE=; b=V/zwGiTm8QBBl21fWm0VIt/NTrgJlTzpC44dd62LJQowjVByT6amIfTTJOwHWwnBLk p3dRsBUNw6dmBr8HgIo/ZOpLdUCenAr7EFoG9FxxirSzVu5RrUfsFYcGpfI9EgsRNWWZ 2JHkBGxfAmS9DWsnxkkiH+9Zjsq9o92VkPW6CW1zVkJK3EAxytqsjwtiDSpd+Cy6T4gp GivxHzILM9yrEQfYa0r3I8FRjf85lX8gHRgQup/jFOXid3RuD/lW7OvY8qsBqT95q4a0 B2R5pnla4ZeNOW8oD7GYBd0GmASTdmTqZN+UWPGPgysVB9Uth7sMTGpSk8ZaXMTDHqUf ht6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cO/+y81p"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i61-v6si8901654plb.193.2018.10.05.07.14.04; Fri, 05 Oct 2018 07:14:19 -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=@gmail.com header.s=20161025 header.b="cO/+y81p"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728766AbeJEVMr (ORCPT + 99 others); Fri, 5 Oct 2018 17:12:47 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:46362 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728139AbeJEVMr (ORCPT ); Fri, 5 Oct 2018 17:12:47 -0400 Received: by mail-ed1-f66.google.com with SMTP id g32-v6so11738597edg.13 for ; Fri, 05 Oct 2018 07:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wNDn9c5XkwC4Llal6KmqiuskgWLjTpaXVc4//jLWLXE=; b=cO/+y81pS/SLB3mqnwk25883z5AKoHkh18t4FeSuQCL0AhDOIr8k9yYBNT2fVa60A9 zPLj3tmHnuvyfHsL7OInghsUXnqagRUOn5HaF9RaZst2vOijze0u4jOnOi1Wiwtu6leR g4lm0SJ1u9qTW/DDHCH0jBRcukjrTXD2nP4Zyz6arL7ta71jcpYgWIy+hqwFX5/HIG9S e4bNU0rrCMo1YrNlHU0zExwGPjEdqrv9HJacRK/bZ2nKxvCLG2T0HM5Selx5n5umCZvX 60oNYujNSoM5uaS9oPRSvE+sfDJDKDIqwNwuD7yKTc535kWWnJHD5GaA6oliSK3A7SVN PUUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=wNDn9c5XkwC4Llal6KmqiuskgWLjTpaXVc4//jLWLXE=; b=umdamZ6HblKcTyncacAJ2TVierIjHZxpam/ZpScySVgJG0N2ckpyfJS8vWGp1xbkWo aIkWu5gtnpfwnU4v+m6x3pRj15AC9gTNxQ+XgYjOx5QieK/OESsBnmwZ0nvfGI049CUK f1nkAs6BmsiAF/M2wHfBZUnMnb6V265nLV/NbMMlgK6tTK+SRmrtU1e9gkkh78fzpiRP 4Qta77J21Fw0ZKKwmd3BWGZ36aJ0XrhB3BN+YY3uC4Vow0ZFRd995qix1ubc2WkXMsP5 y2fPjwKcv2V2mUx1NKyAyZ+/bab9QkdK4fWt+oDtJ2JO5vj99lfPUf1Ht3tbzPSCQv3g yMyg== X-Gm-Message-State: ABuFfoirJBKkGET1cdgoWh9Qqz3jthR96vjGkY1tkPthxK65aVCMAyhc 8j8Po8em29Kd5oUG2pbhSNkaQkXq X-Received: by 2002:a17:906:40cd:: with SMTP id a13-v6mr11693382ejk.14.1538748830838; Fri, 05 Oct 2018 07:13:50 -0700 (PDT) Received: from ziggy.stardust ([37.223.143.164]) by smtp.gmail.com with ESMTPSA id a27-v6sm2563928edc.46.2018.10.05.07.13.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 07:13:49 -0700 (PDT) Subject: Re: [PATCH] irqchip/gic-v3-its: Add early memory allocation errata To: Marc Zyngier , Matthias Brugger , matthias.bgg@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, tglx@linutronix.de, jason@lakedaemon.net, robert.richter@cavium.com Cc: suzuki.poulose@arm.com, shankerd@codeaurora.org, xiexiuqi@huawei.com, Dave.Martin@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180912095232.2110-1-matthias.bgg@kernel.org> <95733d12-ee1d-9874-16a7-c614cc0ce8cd@arm.com> <8ef6b381-e170-30de-ad0e-fae8ccf189e5@suse.com> <1d227152-2770-3e93-f78c-71e7a3b4fe76@arm.com> From: Matthias Brugger Openpgp: preference=signencrypt Autocrypt: addr=matthias.bgg@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFP1zgUBEAC21D6hk7//0kOmsUrE3eZ55kjc9DmFPKIz6l4NggqwQjBNRHIMh04BbCMY fL3eT7ZsYV5nur7zctmJ+vbszoOASXUpfq8M+S5hU2w7sBaVk5rpH9yW8CUWz2+ZpQXPJcFa OhLZuSKB1F5JcvLbETRjNzNU7B3TdS2+zkgQQdEyt7Ij2HXGLJ2w+yG2GuR9/iyCJRf10Okq gTh//XESJZ8S6KlOWbLXRE+yfkKDXQx2Jr1XuVvM3zPqH5FMg8reRVFsQ+vI0b+OlyekT/Xe 0Hwvqkev95GG6x7yseJwI+2ydDH6M5O7fPKFW5mzAdDE2g/K9B4e2tYK6/rA7Fq4cqiAw1+u EgO44+eFgv082xtBez5WNkGn18vtw0LW3ESmKh19u6kEGoi0WZwslCNaGFrS4M7OH+aOJeqK fx5dIv2CEbxc6xnHY7dwkcH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0uo9CzCSm3I++aYozF25xQoT+7zCx2cQi33jwvnJAK1o4VlNx36RfrxzBqc1uZGzJBCQu4 8UjmUSsTwWC3HpE/D9sM+xACs803lFUIZC5H62G059cCPAXKgsFpNMKmBAWweBkVJAisoQeX 50OP+/11ArV0cv+fOTfJj0/KwFXJaaYh3LUQNILLBNxkSrhCLl8dUg53IbHx4NfIAgqxLWGf XM8DY1aFdU79pac005PuhxCWkKTJz3gCmznnoat4GCnL5gy/m0Qk45l4PFqwWXVLo9AQg2Kp 3mlIFZ6fsEKIAN5hxlbNvNb9V2Zo5bFZjPWPFTxOteM0omUAS+QopwU0yPLLGJVf2iCmItHc UXI+r2JwH1CJjrHWeQEI2ucSKsNa8FllDmG/fQ== Message-ID: <93532c6a-0a84-4063-3f9f-171490985cbb@gmail.com> Date: Fri, 5 Oct 2018 16:13:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1d227152-2770-3e93-f78c-71e7a3b4fe76@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/10/2018 15:42, Marc Zyngier wrote: > On 05/10/18 13:33, Matthias Brugger wrote: >> >> >> On 05/10/2018 12:55, Marc Zyngier wrote: >>> Hi Matthias, >>> >>> On 04/10/18 23:11, Matthias Brugger wrote: >>>> Friendly reminder, if anyone has any comment on the patch :) >>>> >>>> On 9/12/18 11:52 AM, matthias.bgg@kernel.org wrote: >>>>> From: Matthias Brugger >>>>> >>>>> Some hardware does not implement two-level page tables so that >>>>> the amount of contigious memory needed by the baser is bigger >>>>> then the zone order. This is a known problem on Cavium Thunderx >>>>> with 4K page size. >>>>> >>>>> We fix this by adding an errata which allocates the memory early >>>>> in the boot cycle, using the memblock allocator. >>>>> >>>>> Signed-off-by: Matthias Brugger >>>>> --- >>>>>    arch/arm64/Kconfig               | 12 ++++++++ >>>>>    arch/arm64/include/asm/cpucaps.h |  3 +- >>>>>    arch/arm64/kernel/cpu_errata.c   | 33 +++++++++++++++++++++ >>>>>    drivers/irqchip/irq-gic-v3-its.c | 50 ++++++++++++++++++++------------ >>>>>    4 files changed, 79 insertions(+), 19 deletions(-) >>> >>> My only comment would be to state how much I dislike both the HW and the >>> patch... ;-) The idea that we have some erratum that depends on the page size >>> doesn't feel good at all. >>> >> >> Well ugly HW needs ugly patches ;-) >> >>>>> >>>>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig >>>>> index 1b1a0e95c751..dfd9fe08f0b2 100644 >>>>> --- a/arch/arm64/Kconfig >>>>> +++ b/arch/arm64/Kconfig >>>>> @@ -597,6 +597,18 @@ config QCOM_FALKOR_ERRATUM_E1041 >>>>>            If unsure, say Y. >>>>>    +config CAVIUM_ALLOC_ITS_TABLE_EARLY >>>>> +    bool "Cavium Thunderx: Allocate the its table early" >>>>> +    default y >>>>> +    depends on ARM64_4K_PAGES && FORCE_MAX_ZONEORDER < 13 >>> >>> Here's a though: Why don't we ensure that FORCE_MAX_ZONEORDER is such as we >>> could always allocate the same amount of memory, no matter what the page size >>> is? That, or bump FORCE_MAX_ZONEORDER to 13 if the kernel includes support >>> for TX1. >>> >> >> Bumping FORCE_MAX_ZONEORDER when TX1 is supported was proposed here: >> https://patchwork.kernel.org/patch/6322281/ >> >> To bring in some more history, the CMA approach ended with this discussion: >> https://patchwork.kernel.org/patch/9888041/ >> >>> Any of this of course requires buy-in from the arm64 maintainers, as this is >>> quite a departure from the way things work so far. >>> >> >> With my distribution head on, I would prefer a solution that does not change >> FORCE_MAX_ZONEORDER. That's how I came to the idea providing a third solution to >> the same problem :) > > Why is that a problem? What impact does this have on your favourite distro? > The impact is on changing FORCE_MAX_ZONEORDER on an already released kernel will break Kernel ABI and with that all external modules. I know that's nothing upstream cares too much about, but the distros do :)