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=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, 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 46BAEC433DB for ; Thu, 21 Jan 2021 11:40:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 E75752222B for ; Thu, 21 Jan 2021 11:40:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E75752222B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DYe8g4VfmR4IO40hgAc94/lAJuiQIYV35wuFAcyLUfs=; b=3RPx0CozDLDvUqFhAlT1eJOtO EIly9g+2qT/uryVXcUiJUHpaAhnzPz8veyggmpnam+KwSzrhcprqn6lMNatV2gUPOQLGsev+z0MI4 BA4JBbHZmYy+d08TO++ocXbQtbsGAXsqkxwRveZYgoraPTbo3P2SDfjBDAjyRbDk5iNJ4uIYlKpzw mrYdZtCDHcZZOjMMJTDtiR7V1NyZfs60u1BPdST4IRpDWYQRn9QMo4nEUnydAgtPtSwN1CP23HhtM fXwAGg/ccJNJ54t4SVaJ2Oc8wrwCU7Ei08rm/4dJu/OQ/+3W3Q2+LOgFwuh7lUim/ACzgDNZ6ZcvP IpzsMpzcA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2YIr-0004l8-2r; Thu, 21 Jan 2021 11:39:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2YIo-0004kV-CL for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 11:39:03 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3FA652395A for ; Thu, 21 Jan 2021 11:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611229141; bh=8Mrped0dqosEfHBS5NkF/32JfKc48YzZz11ccq0r9/4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=o4bQmM5EWoyBQDGPngnEWX3GCCk+7yMzZj3tM9stml5iM0nDO6isCm8eoILCOuLKq aeiyFgMlnq+iF6ioPa7g1sdRa/DdTO5smxBr02N7xiTbmHA4IRZnuZ7FmqLeZlKeer 4ZRzKVu1q+IkLT9I0w2ZUiF1usVwXEAfvlEH9nB5IjFOQxIng4DY+17XI5eGCI91pB jtHgKSbfSzIqlAtvcXF9D/OGESrUe+Bj91Y/zXf7x0wCd2o1FpQTe9yTVuT2Qn9ryw B0L5lJagQ1lHqBpb4E4vFVLV0YkA9ftAdi0MGTZMpKvQSD3HyLZVuBdDlSIpCygXsZ AtuybR/XTGoug== Received: by mail-oo1-f41.google.com with SMTP id v19so408168ooj.7 for ; Thu, 21 Jan 2021 03:39:01 -0800 (PST) X-Gm-Message-State: AOAM532AoPcWSLImGZcYAhSY7eXigX2mHE4eKkQ18q9eU/bhvEqs602S b/ffVeZUDooxaHI1y+VFRJ7TooPkwnuTq++XGn8= X-Google-Smtp-Source: ABdhPJzOqMsrGPXVP1Jfm6P+8sPMW/UzyzkppZN9jSQuPFMKi2Q+z5HPdxIklLxttv9TSE5iIZNjyZ0hHgEoV56TlxA= X-Received: by 2002:a4a:9c01:: with SMTP id y1mr9152302ooj.15.1611229140456; Thu, 21 Jan 2021 03:39:00 -0800 (PST) MIME-Version: 1.0 References: <20210120132717.395873-1-mohamed.mediouni@caramail.com> <20210120132717.395873-4-mohamed.mediouni@caramail.com> <20210121112725.GA21750@willie-the-truck> In-Reply-To: <20210121112725.GA21750@willie-the-truck> From: Arnd Bergmann Date: Thu, 21 Jan 2021 12:38:44 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 3/7] arm64: mm: use nGnRnE instead of nGnRE on Apple processors To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_063902_563879_588798D1 X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Marc Zyngier , Hector Martin , "linux-kernel@vger.kernel.org" , Catalin Marinas , Mohamed Mediouni , Linux ARM , Stan Skowronek Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 21, 2021 at 12:32 PM Will Deacon wrote: > On Wed, Jan 20, 2021 at 02:27:13PM +0100, Mohamed Mediouni wrote: > > Use nGnRnE instead of nGnRE on Apple SoCs to workaround a serious hardware quirk. > > /* > > * Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and > > * changed during __cpu_setup to Normal Tagged if the system supports MTE. > > @@ -432,6 +451,13 @@ SYM_FUNC_START(__cpu_setup) > > * Memory region attributes > > */ > > mov_q x5, MAIR_EL1_SET > > +#ifdef CONFIG_ARCH_APPLE > > + mrs x0, MIDR_EL1 > > + lsr w0, w0, #24 > > + mov_q x1, MAIR_EL1_SET_APPLE > > + cmp x0, #0x61 // 0x61 = Implementer: Apple > > + csel x5, x1, x5, eq > > Why does this need to be done so early? It would be a lot cleaner if we > could detect this in a similar fashion to other errata and update the MAIR > appropriately. If that's not possible because of early IO mappings (which > ones?), then we could instead initialise to nGnRnE unconditionally, but > relax it to nGnRE if we detect that we _don't_ have the erratum. There is (at least) the custom SMP startup code that uses device mappings. If that's the only thing that needs the modified MAIR to be used early, I'd consider that one more reason against doing the custom cpu_operations for now. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel