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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7309C433FE for ; Tue, 11 Oct 2022 17:21:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49DC06B0071; Tue, 11 Oct 2022 13:21:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 426126B0073; Tue, 11 Oct 2022 13:21:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A01A6B0074; Tue, 11 Oct 2022 13:21:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1300C6B0071 for ; Tue, 11 Oct 2022 13:21:30 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7C9BD160271 for ; Tue, 11 Oct 2022 17:21:29 +0000 (UTC) X-FDA: 80009335098.03.1B4B418 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf07.hostedemail.com (Postfix) with ESMTP id 0A84D4002D for ; Tue, 11 Oct 2022 17:21:28 +0000 (UTC) Received: by mail-ej1-f41.google.com with SMTP id b2so32924357eja.6 for ; Tue, 11 Oct 2022 10:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dDH/yqMBY6z65ZJG9YUJcRxt5TLwOS8GZpBny1UR+wU=; b=LaM8+qFG1my8Jgpzmgkwd2c1XQ3CJfP3M/S+A5zp45CCeJhA2l0XTf0twHAYpk8Zj4 kEp56yDKYvjnZtHEPfLlAAiS5Gy5wXhP/Xe+bGZ/tBtN/M+s3sdTXlDB9fEtyXbbUqbj Acy9wf3dQvzqraceTxSpOQIA4igavGsxfuXFkVk5ZSIIA/c9SaR/JXz0S7Qf4yH3uS// 9seOf7/JyiUSvNMuSvgrVUXfb+0KTR9VaFk5uQn4sSu/NfrwYR41ajMyvxz/OcBSsEsu 7u8sy7GVw9nuWNKDgeXz+nu7EcTTiIgfHD+5j11wS6GiFAGlqZWysHua12KhNwkiS2UL tRbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dDH/yqMBY6z65ZJG9YUJcRxt5TLwOS8GZpBny1UR+wU=; b=Yex7pbH4xZsVD/084gqYaGbDioOWAmp7p5zEClznIirgyE/OLkKzH/6Vc1ZUrMEBrb TCQbpW4RFcl0jwo27ZIUFphnjPiUh0kRSWwW146ZhKznx+GNl5cQgKQMO+iofdwlW3ao kxJmbJYtnbSTwBmC+vZxvXpejKdOEfmibatIm73O8rmk1lCQ1DghMs5Hu2L6IsbqOqAs 8bd9qlNLQL7Q0NM7vrPHjOmidp2F52lyVIjpB9lUTvRfx9Ma7e0RDG/t0WCkkduydUg3 rURKHc/Fcxr+Idy/zb3b5W+9alJYHuYGaqWBIRZciggDm0AiNlr5Lb/4fx5w9owVDvsl 8gug== X-Gm-Message-State: ACrzQf0y/lwlWXaeZ2Rs673Qg1dEjEojXDn8pHW9qLB6SPMjU5fzZM+S c+moXg0ipXfzkqY4L7d8Wzc1bQ== X-Google-Smtp-Source: AMsMyM7Ysdj7qDeAq5GSAX1M7OKEZKLjyhDmK7KAEeekQ2yxzv+UJ2NGaWADd65guNvdOYPICU0EbA== X-Received: by 2002:a17:906:db0a:b0:781:f24:a782 with SMTP id xj10-20020a170906db0a00b007810f24a782mr19551598ejb.399.1665508887606; Tue, 11 Oct 2022 10:21:27 -0700 (PDT) Received: from localhost (cst2-173-61.cust.vodafone.cz. [31.30.173.61]) by smtp.gmail.com with ESMTPSA id a14-20020a170906368e00b0078d46aa3b82sm44170ejc.21.2022.10.11.10.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 10:21:27 -0700 (PDT) Date: Tue, 11 Oct 2022 19:21:26 +0200 From: Andrew Jones To: Yury Norov Cc: Linus Torvalds , lkp@lists.01.org, lkp@intel.com, Linux Memory Management List , linux-kernel@vger.kernel.org Subject: Re: [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address] Message-ID: <20221011172126.24csegoozshpy34z@kamzik> References: <20221011170949.upxk3tcfcwnkytwm@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665508889; a=rsa-sha256; cv=none; b=HLjC8N/mLG5ET7t13y2NbKHuGYRYwjgXxrWVejk6ZWkaq9iSNChka9zF/42lh7TbV+Chys AlgkDklMwppFPudJgp4gygF5KTHo5L/xyPApKBhB+IQChs4tIRB0AX1MHMr49YtxBsRAw+ 4eQ4r3zyRxYFZZDLgU/pB+ArJphpne4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=LaM8+qFG; spf=pass (imf07.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=ajones@ventanamicro.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665508889; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=dDH/yqMBY6z65ZJG9YUJcRxt5TLwOS8GZpBny1UR+wU=; b=VyzfUgBZ/qINRyP4EIwiKPpBp19IXp77R0fvZAgxcuIoaxhRdIiedtpqbOPTw4iV9uXcgb K3i4Z7LVyNca51eWg9dharBjAaU2+lL3LHtFMwTkQVDN0NBPTy8n4uSsTBpcVT4h9GP9qI rpTCCMMaRsDNq9gcu6lc6aAaHvzBrhE= X-Stat-Signature: t8r1wiomd4racmi1n5j6jks578z45gsc X-Rspamd-Queue-Id: 0A84D4002D X-Rspam-User: X-Rspamd-Server: rspam08 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=LaM8+qFG; spf=pass (imf07.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=ajones@ventanamicro.com; dmarc=none X-HE-Tag: 1665508888-83050 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Oct 11, 2022 at 10:16:01AM -0700, Yury Norov wrote: > > Hi Yury, > > > > I just wanted to report that the warning fires when doing > > 'cat /proc/cpuinfo' on at least x86 and riscv. I don't think > > those are false positives. I'm guessing a patch should be > > something like the following diff. If you haven't already > > addressed this and I'm not off in left field, then I guess > > we should integrate it into your series. > > > > Thanks, > > drew > > Hi Andrew, > > Can you please send it as a patch with a description? Will do. I'll send two patches, one for each arch. > > > > > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > > index 4aa8cd749441..4c5dfa230d4b 100644 > > --- a/arch/riscv/kernel/cpu.c > > +++ b/arch/riscv/kernel/cpu.c > > @@ -166,9 +166,12 @@ static void print_mmu(struct seq_file *f) > > > > static void *c_start(struct seq_file *m, loff_t *pos) > > { > > - *pos = cpumask_next(*pos - 1, cpu_online_mask); > > - if ((*pos) < nr_cpu_ids) > > - return (void *)(uintptr_t)(1 + *pos); > > + if (*pos < nr_cpu_ids) { > > + *pos = cpumask_next(*pos - 1, cpu_online_mask); > > + if ((*pos) < nr_cpu_ids) > > Braces around *pos are not needed. The braces were preexisting, but I'll drop them while indenting. Thanks, drew > > > + return (void *)(uintptr_t)(1 + *pos); > > + } > > + > > return NULL; > > } > > > > diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c > > index 099b6f0d96bd..2ea614e78e28 100644 > > --- a/arch/x86/kernel/cpu/proc.c > > +++ b/arch/x86/kernel/cpu/proc.c > > @@ -153,9 +153,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) > > > > static void *c_start(struct seq_file *m, loff_t *pos) > > { > > - *pos = cpumask_next(*pos - 1, cpu_online_mask); > > - if ((*pos) < nr_cpu_ids) > > - return &cpu_data(*pos); > > + if (*pos < nr_cpu_ids) { > > + *pos = cpumask_next(*pos - 1, cpu_online_mask); > > + if ((*pos) < nr_cpu_ids) > > Here too. > > Thanks, > Yury > > > + return &cpu_data(*pos); > > + } > > + > > return NULL; > > } > > > > > > > > > I suspect that to avoid any automation noise, you should just rebase > > > > so that the fixes come first. Otherwise we'll end up wasting a lot of > > > > time on the noise. > > > > > > > > This is not that different from introducing new buil;d-time warnings: > > > > the things they point out need to be fixed before the warning can be > > > > integrated, or it causes bisection problems. > > > > > > OK, I'll reorder the patches. Thanks for your help. > > >