Received: by 10.223.164.202 with SMTP id h10csp510135wrb; Fri, 17 Nov 2017 04:22:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMa/1t0YEP6yleDdl8BTBbvrsiq067YQkL/ZmpLJI+6fl4VDou56Fl0botBcZwfV2AyULrHH X-Received: by 10.84.233.207 with SMTP id m15mr5002723pln.424.1510921359912; Fri, 17 Nov 2017 04:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510921359; cv=none; d=google.com; s=arc-20160816; b=k7zvmVikuj7bj8BIKUQTnrPbmLkqlo6DSo3jkzHEG9Fc1u14q+DweFekcMx52jROSZ EQvUx5XSN6OrLRZDVtV8pM+xQrg8nhk/36rcO6MDuzEYXULH7lhOBOvla1Z/ic9IlDLp RZvNHUE+6hCoKb9vdXAUJJ5qmcoxAxVv797bIPW00BtP7cHTB0w752HQCU1IJrB0F1Wf RUm/7iHLUoOInZwBV3DwCTl0CooQmNOaLD4FfikBUFIDh18Y7S7itw61eGQyaWYAvBrJ g2d628e4q90CNGjjrR+kBrZ4MJOgwcuatPxYizdOtvxSBP5AefyaKpGmNZtn5YFv7fjh +87g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=e5lisCkyFkI7xE4YQs+rfI5wZOhWfDBkAaOo2EqYZmc=; b=jhdY3FPbCjH1Am1Jz1pumLyrsrfEHV0iu6oRVTkvZ+72X/z9MmXyi2MLPFcvBGjN50 YEF/CXwVXEu0b2Q6dduknLelvBbmZ9TmKHv3Eq2VeCIQ/a14nQjWzbPZW5+GU3uT086n uJxdwsaCCitpva3EiKjkPlEO/u8RaQlMtJu4lCEZ2STcAmjtvL6/AE/NcUWYmoNzIWLp RKKMxs+3ojQMmKoHlLpkigm4E9pdIMGARvQ8EiCpzKZ5fPZc6JhLUQYAoHutA6c9a30p VNKlnYtQxG5sL+HbtQwNV334blOJQmey0mVZuxhRfBKM7Invo04qKeWZFir0WG5Feb/G UtIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fMbD83Lx; dkim=pass header.i=@codeaurora.org header.s=default header.b=fMbD83Lx; 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 n7si2663347pgd.755.2017.11.17.04.22.26; Fri, 17 Nov 2017 04:22:39 -0800 (PST) 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=fMbD83Lx; dkim=pass header.i=@codeaurora.org header.s=default header.b=fMbD83Lx; 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 S932344AbdKQCkF (ORCPT + 91 others); Thu, 16 Nov 2017 21:40:05 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:34738 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080AbdKQCj7 (ORCPT ); Thu, 16 Nov 2017 21:39:59 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D07CF6071C; Fri, 17 Nov 2017 02:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510886398; bh=B+7FrXmvjZmwG8cURQ3RC1LOfzBvu3a9yF+qLwZSjuw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fMbD83Lx/QmauMEGdgg5iM6oCKwOQbVFfDCkgZquHYJyEZUJfuy8IGkZLuxABTyXA tmYbX6mG6JO9kJ6ee2PmCDLBgY6EmnvGEON2fAcNx14ROTRiBhGaQ9NaFPtpQtaics z7RuFLEjI00njo84u9nFrsC39rh8Z0NF+hU2tmvc= 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 localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1E3D8601CF; Fri, 17 Nov 2017 02:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510886398; bh=B+7FrXmvjZmwG8cURQ3RC1LOfzBvu3a9yF+qLwZSjuw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fMbD83Lx/QmauMEGdgg5iM6oCKwOQbVFfDCkgZquHYJyEZUJfuy8IGkZLuxABTyXA tmYbX6mG6JO9kJ6ee2PmCDLBgY6EmnvGEON2fAcNx14ROTRiBhGaQ9NaFPtpQtaics z7RuFLEjI00njo84u9nFrsC39rh8Z0NF+hU2tmvc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1E3D8601CF 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=sboyd@codeaurora.org Date: Thu, 16 Nov 2017 18:39:57 -0800 From: Stephen Boyd To: Catalin Marinas Cc: Will Deacon , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: cpu_errata: Add Kryo to Falkor 1003 errata Message-ID: <20171117023957.GT11955@codeaurora.org> References: <20171108190029.19835-1-sboyd@codeaurora.org> <20171110172656.zvnpfjkky7rqumyf@armageddon.cambridge.arm.com> <20171115003522.GL11955@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171115003522.GL11955@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14, Stephen Boyd wrote: > On 11/10, Catalin Marinas wrote: > > On Wed, Nov 08, 2017 at 11:00:29AM -0800, Stephen Boyd wrote: > > > The Kryo CPUs are also affected by the Falkor 1003 errata, so > > > we need to do the same workaround on Kryo CPUs. The MIDR is > > > slightly more complicated here, where the PART number is not > > > always the same when looking at all the bits from 15 to 4. Drop > > > the lower 8 bits and just look at the top 4 to see if it's '2' > > > and then consider those as Kryo CPUs. This covers all the > > > combinations without having to list them all out. > > > > > > Signed-off-by: Stephen Boyd > > > --- > > > > > > We may need to introduce another Kconfig option to block software PAN > > > from being enabled when this errata is enabled (and then have software PAN > > > depend on this new config being false). > > > > It depends on whether you'd want to use SW PAN together with these CPUs. > > From a defconfig + single Image perspective, SW PAN is disabled but it > > would be nice to allow single Image with both E1003 and SW PAN configs > > enabled (though SW PAN wouldn't be used at run-time). > > > > As a quick hack, something like below but we may want to add a separate > > cap bit as a minor optimisation (not sure it makes a difference). > > Untested: > > Ok. The Falkor CPUs support HW PAN so your patch looks like it > should work. If we're running on a Kryo CPU we may not see the HW > PAN capability and then we would still return false here because > the errata is present. I'll fold it in and test it out. Almost works. The problem is that uaccess_ttbr0_{disable,enable} assembly macros need to be patched for NOPs if we have cap bits for ARM64_HAS_PAN or ARM64_WORKAROUND_QCOM_FALKOR_E1003. From what I can tell, we have only ever had one bit there so doing something like: ----8<---- diff --git a/arch/arm64/include/asm/asm-uaccess.h b/arch/arm64/include/asm/asm-uaccess.h index b3da6c886835..70644cde9e7c 100644 --- a/arch/arm64/include/asm/asm-uaccess.h +++ b/arch/arm64/include/asm/asm-uaccess.h @@ -26,13 +26,13 @@ .endm .macro uaccess_ttbr0_disable, tmp1 -alternative_if_not ARM64_HAS_PAN +alternative_if_not (ARM64_HAS_PAN | ARM64_WORKAROUND_QCOM_FALKOR_E1003) __uaccess_ttbr0_disable \tmp1 alternative_else_nop_endif .endm .macro uaccess_ttbr0_enable, tmp1, tmp2 -alternative_if_not ARM64_HAS_PAN +alternative_if_not (ARM64_HAS_PAN | ARM64_WORKAROUND_QCOM_FALKOR_E1003) save_and_disable_irq \tmp2 // avoid preemption __uaccess_ttbr0_enable \tmp1 restore_irq \tmp2 won't work just like that because it's not a bitmask, just a raw cap number. So I need to introduce another capability number that combines the presence of HW_PAN and this errata? Looks like it would be similar to ARM64_ALT_PAN_NOT_UAO. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project From 1584090302339206069@xxx Wed Nov 15 00:37:16 +0000 2017 X-GM-THRID: 1583525619010859747 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread