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 76B0DC433F5 for ; Tue, 11 Oct 2022 17:16:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05BEA6B0071; Tue, 11 Oct 2022 13:16:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00C176B0073; Tue, 11 Oct 2022 13:16:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC8D36B0074; Tue, 11 Oct 2022 13:16:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C70D16B0071 for ; Tue, 11 Oct 2022 13:16:04 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 69D03C0995 for ; Tue, 11 Oct 2022 17:16:04 +0000 (UTC) X-FDA: 80009321448.09.551A384 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by imf30.hostedemail.com (Postfix) with ESMTP id CD4788001F for ; Tue, 11 Oct 2022 17:16:03 +0000 (UTC) Received: by mail-qt1-f174.google.com with SMTP id h15so4536007qtu.2 for ; Tue, 11 Oct 2022 10:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=I0TMmEU0awN4pXECmIXk1XAppujLcVlqRm9zJtAsubI=; b=o07802aJ1Zv1PhubgA0DI81pA5ci3gLQm8fcrMu5Q27g3sCWEXsfUOq9OPyG/gVlyD fL1q0fK/S9YAQNEi2x5wCGX2m7oERkJ22PXNL9wa4V8CeqeaYRGu1QNYER55BIk5xmiB 3KTz8ayhFl1itHt+wSVs6t9tbL8GCp17PwQtHUa1U51pDjECr6m5IQ/WL9P6JO93VEXv ml5ooYq5KERO+DArZlPawZMmArIgDoDUNgZvGJuSdQbHNZIRgNMQ6tw6TcmSawj28fl/ p/Ssi5QsWew18yMtvbubwh1+YkpxpiK78yezPbehchU4QB2QBnxBANWnBMVF+mUXRDXX HZBQ== 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=I0TMmEU0awN4pXECmIXk1XAppujLcVlqRm9zJtAsubI=; b=MR01nVTQx4vvAstVgfJgZAwBV7mpNvEygnlKn+AkFOh4eCxNFiEdaj+5CsnJf4Q4el DNozHsJxltZ2FRitYtdRTWQZ09E5sLVxgt5cw45034sO+o8nnUGjFJ7CWOFixUOxqoa4 dAKBK/niH75IGIviS39aTZiicoinxqmB4KHTzI4G0pL2HXK8QUPtQ1OLVZczhGSyBVnE icMdUwDJpFDhPLpoZf0lOsi9Lu7yHyR2F5ioJypWa+8p1w0oz03gQ9DuzfAF/x3trEQM +VFeHlday3Z4ewAnsTgDIJGAt5SgaP9hFRUuUfqtqsi1yGUabkfy6YfCBrM4sJ/WPql5 TLnw== X-Gm-Message-State: ACrzQf0aN5yqGYZPojQrw9t7DM9PfjDGJUlvgXTFCQ40Ed/Il0iQ90k1 YYEiHINZZOv1bLyheEMP9TE= X-Google-Smtp-Source: AMsMyM6vBd4nYGfZ8fJ7aQfhyEgTgP6ewEUQkLEpP322CDUmqma5O+qml1b5fmljK4pZmGak1S0LLA== X-Received: by 2002:a05:622a:58d:b0:394:9d68:edc2 with SMTP id c13-20020a05622a058d00b003949d68edc2mr20544718qtb.230.1665508562927; Tue, 11 Oct 2022 10:16:02 -0700 (PDT) Received: from localhost ([2601:4c1:c100:2270:6051:2739:340:f252]) by smtp.gmail.com with ESMTPSA id c24-20020a05620a269800b006b5cc25535fsm13484116qkp.99.2022.10.11.10.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 10:16:02 -0700 (PDT) Date: Tue, 11 Oct 2022 10:16:01 -0700 From: Yury Norov To: Andrew Jones 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: References: <20221011170949.upxk3tcfcwnkytwm@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221011170949.upxk3tcfcwnkytwm@kamzik> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665508563; 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=I0TMmEU0awN4pXECmIXk1XAppujLcVlqRm9zJtAsubI=; b=WZwu5TXwYsxCBdtfTqeOjXljakMQcIHy/TlUWktSKUqmwCLfou36qEOwqid8lhJgRo7Q8E RrqOoxNYMCHarCs+SChqGJiC3Co0Im3IAism+Se5MeIfWjaru7xJZx+nXVIQC4V/O++FNJ BvS25zKEtK3IcGfgQNBOpceJ+flw/LU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=o07802aJ; spf=pass (imf30.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.174 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665508563; a=rsa-sha256; cv=none; b=ZVtxUV7q5hLhmKmvs3AVk9HRQs+QEaDoDZoq2xbcP4vPe79YNpaRvBUMOXDizg4DGKD1TL E3Wwc7zzADtCVfDEZycb5hM9npMzukJAfWjI30oxgGnEn2fRdQwt3OTa62H6QJEQ//ZDxN Mcx8MdIGyNKIyLgWdKgKvty78LSzj84= X-Stat-Signature: przkqxu9595y6sm4ieg1pzqigyjekw1u X-Rspamd-Queue-Id: CD4788001F Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=o07802aJ; spf=pass (imf30.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.174 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1665508563-677493 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: > 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? > > 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. > + 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. > >