Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4625619ybi; Tue, 11 Jun 2019 09:38:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwld07aKJL2dXduOabgZvTwLXWBqVXplisz6/gKFy5v9YE6t+lBdX2R/z2kA4UFUdhSeK9Z X-Received: by 2002:a63:e60b:: with SMTP id g11mr1059731pgh.172.1560271124891; Tue, 11 Jun 2019 09:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560271124; cv=none; d=google.com; s=arc-20160816; b=TxjFx4UJtCbcx6U0D1lqNodRLiMKIvb3MKZggWGJdqlds8VvfmOZqYLJZK2y6H6RuS QGsaHfcwpUoocB4qfnFwun9jhU0WAzZaCYZM174mVEGZeZm5dtoXDZyOCZWlfrapiZQE /E6+7pGGLw3HeWBLnYYlMZU14XkoxIkBFOjxmSSdh1e5gkpeXXVVcpDQEyR/IA633qSZ OSsQMuiTi2fRVldotNDwYUw68HIX2TWSH8I0Cr5H5BpErhu0bfIyvX0e8fLXFr2erAHV m7XLljH6iLQi745g3YnnLMwy55HAqgUG7Y6xREcMliD71NjsGj85N7I7E4b+5it0LpQG zxjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Xk/nUeSwmjb6lEDGBh3mV3CTpCHSAUw0VWDygG78GcY=; b=VeL+VoikBccDKXx69EpqpF1R/VxdAfiTm2ZPlaENoZZyRnEAo+L/FdSfzL5zES1qNo SPwchulptZkjVjbFLDHcrqiejzGzAc7OprsyGOsD5erV3kuOurDd3UuqXYqsflcWEaBl p1+ZifnCpnbba+qZB9DZGar4ba6n8ERG1pQkDmr+R0r8Hj2PiFgRQmL84Z3YX9NcMq6r LMWKesrECrjyqKJfK1hB294IdkdSsiHBNA28DEnkl8BEmBIj/LHSwaXwNRbIC/VShVv5 3+zpaPafbDJjAyZ7iiJ4+gX+0k5JCMO0n0ojKiKUq8fhTfurkOiV6DPx/1PkKRBq4yCL gGuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ENnb5DPQ; 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 t7si2637052pfq.189.2019.06.11.09.38.29; Tue, 11 Jun 2019 09:38:44 -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=ENnb5DPQ; 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 S2404854AbfFKPTn (ORCPT + 99 others); Tue, 11 Jun 2019 11:19:43 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36364 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404842AbfFKPTm (ORCPT ); Tue, 11 Jun 2019 11:19:42 -0400 Received: by mail-qt1-f196.google.com with SMTP id p15so7576195qtl.3 for ; Tue, 11 Jun 2019 08:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xk/nUeSwmjb6lEDGBh3mV3CTpCHSAUw0VWDygG78GcY=; b=ENnb5DPQJReREn1b0ZGYhCbls9bU6aKjPnMMIT3IDI6TQL/5Z6ccXp8OUmJ9pntjhe BXopYGyAbHSZdSYdyck6ZmfLWsHijBIB8zEsuUgr7j6ZREBdo2RFm6qj1JyJt7TQQWaS c28gYKAPWXlG/Xh03mKf7GK7+C4oPDcFjTe+nDDgMBjbm780EQu33is/diUiQcIQ4HV9 BKtQmpq+LjUq0P9BJKzTscvaxSgHu7psnFXFqkDIn5q0fNdGTw7DB8axTTgzkYNCfIAq ORZGVpvcwfIilUxX8eO6TkXJk4heEc4JV0dBZ4+w695PDlNBRe5hzWnlu1BHu+oJqNni PbrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xk/nUeSwmjb6lEDGBh3mV3CTpCHSAUw0VWDygG78GcY=; b=H5EILjb9v+5DjrTlVz16B1NtubxzfkLpl+DBlRr0hRsJUgeAth4H9J48xzreqDQjHr 9tV4Qw0v/ryPi9A48r9NZKt2Ar69y4K+JVEhcCRxVUpHZ7g63pkdp2KWkfc2qL5zquPV D9AEkzYbkmTYyl9Oux1yhoAz/rgKeR0yr51IKdGBhu4EYV3s08D59D/jA8NNCkcl6RbW dxJ/pi9vH9Ud8eRoB0ZjBa0odoJC2groSQO5ywKqpTUQdnT4eUnyf0Qj3setz7De5sJ0 FT/8+1QkX5sZUditW0wVgMEq5EAWWUItrHXuGRqrF25LFJ5VSj9gOw/hy78KTxzbDbYi FkmQ== X-Gm-Message-State: APjAAAU5cy011NvVYhGwdArma1UpkzpLr2Xd0C6zJZ9+0NxNcHecxhkK QnTazxRvf79EH3gUf8vGyQ== X-Received: by 2002:ac8:2e5d:: with SMTP id s29mr56136444qta.70.1560266381319; Tue, 11 Jun 2019 08:19:41 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id z57sm6538533qta.62.2019.06.11.08.19.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 08:19:40 -0700 (PDT) From: Masayoshi Mizuma To: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org, Hidetoshi Seto , Zhang Lei Subject: [PATCH 2/2] arm64/mm: show TAINT_CPU_OUT_OF_SPEC warning if the cache size is over the spec. Date: Tue, 11 Jun 2019 11:17:31 -0400 Message-Id: <20190611151731.6135-3-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190611151731.6135-1-msys.mizuma@gmail.com> References: <20190611151731.6135-1-msys.mizuma@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masayoshi Mizuma Show the warning and taints as TAINT_CPU_OUT_OF_SPEC if the cache line size is greater than the maximum. Signed-off-by: Masayoshi Mizuma Reviewed-by: Hidetoshi Seto Tested-by: Zhang Lei --- arch/arm64/include/asm/cache.h | 2 ++ arch/arm64/mm/init.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h index 926434f413fa..636e277fefc9 100644 --- a/arch/arm64/include/asm/cache.h +++ b/arch/arm64/include/asm/cache.h @@ -91,6 +91,8 @@ static inline u32 cache_type_cwg(void) #define __read_mostly __attribute__((__section__(".data..read_mostly"))) +#define ARM64_MAX_CACHE_LINE_SIZE 2048 + static inline int cache_line_size(void) { u32 cwg = cache_type_cwg(); diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d2adffb81b5d..df621d90b19c 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -562,6 +562,11 @@ void __init mem_init(void) */ sysctl_overcommit_memory = OVERCOMMIT_ALWAYS; } + + WARN_TAINT(cache_line_size() > ARM64_MAX_CACHE_LINE_SIZE, + TAINT_CPU_OUT_OF_SPEC, + "CTR_EL0.CWG is greater than the spec (%d > %d)", + cache_line_size(), ARM64_MAX_CACHE_LINE_SIZE); } void free_initmem(void) -- 2.20.1