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 8E833C433F5 for ; Tue, 11 Oct 2022 17:09:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D35A6B0071; Tue, 11 Oct 2022 13:09:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 280776B0073; Tue, 11 Oct 2022 13:09:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 148FE6B0074; Tue, 11 Oct 2022 13:09:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 034156B0071 for ; Tue, 11 Oct 2022 13:09:54 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BA308A0625 for ; Tue, 11 Oct 2022 17:09:53 +0000 (UTC) X-FDA: 80009305866.19.B686F30 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by imf03.hostedemail.com (Postfix) with ESMTP id 4BC092001C for ; Tue, 11 Oct 2022 17:09:52 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id y14so15712114ejd.9 for ; Tue, 11 Oct 2022 10:09:51 -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=ocUKjVgs7hkiBGPswf8jad/dUSoFrePCrz7xOrN9l9E=; b=VZcGRJ6u7FxdYhd5vqQjUP0icn2ivrEgwPFKHQrUyx50MyTtL8WXkE4VlPJYDMSSfI V1GwWNBIBZKjtASA+6n3G6r3r5maXR9IQZALhCbQ1ob9gMsZGLuvN/j+1qmoAAcbq4ps vYxCiGeMNIXw5AakxcIsuukVBA0ZwhB6bVGiS3G33riZD09adFQTDIaArU1ELkw4Ek6j p2uwko7VSsLdr3soOyhjTzILOXiCAAWWi9NQnjQvzLnEIWYvJSBaxeryghv+lCQIdrRH UDr0x8fxRwQTPAoeqTsZDh2tvPYtTH7LWNGcUMiowaZ9y8Y7nvFvaMtho16vUiH9jN1P zJbg== 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=ocUKjVgs7hkiBGPswf8jad/dUSoFrePCrz7xOrN9l9E=; b=YqOQLtV7MH2H/sL3RdIurU3l4V5jYjs1bdGXI7cu7GhsoROJrNy1PaBCoLt9pMWOP9 7eSPHAI9rIJ9rHYUmLWrmc8Fr4FZcDXC+4teHU+Qmfm/BMp8YcEv1boptfKmOCND6POs 7WmAD2VcO4XhaJ3UmIZvI5Ak2f7ssVCgigtuiC5inq5f1FTdRpkKz7QbL8UOdLXytRUl OJq5ZQUjhKSvda/O0sd7hBnelg4QTXyYX11Fdo7DN1kCPCM4u744S7aVtlNtZdn6ZZ/L +OSDPIrUIion1HI7oWECp6tiukTUj+me76dMekbaeEMNx1TfXNiphVxMebotjlgdNCKT 2Ajw== X-Gm-Message-State: ACrzQf1HhdOAGsb+oGjmtsSkFNI6m2KiPkCJ8XtNC4X3sATa10SFcGsK 1cL8hnBTianoHng6FpY1fnspFA== X-Google-Smtp-Source: AMsMyM4p9ffQMiaQ9KPg3sbrVvOcmF6cMCMngeBvzj16ErhZm+qKtjY+YLWcjZUtBBm6W/S920NGZg== X-Received: by 2002:a17:907:2722:b0:77f:c136:62eb with SMTP id d2-20020a170907272200b0077fc13662ebmr19053701ejl.522.1665508190903; Tue, 11 Oct 2022 10:09:50 -0700 (PDT) Received: from localhost (cst2-173-61.cust.vodafone.cz. [31.30.173.61]) by smtp.gmail.com with ESMTPSA id la10-20020a170907780a00b0078250005a79sm7163794ejc.163.2022.10.11.10.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 10:09:50 -0700 (PDT) Date: Tue, 11 Oct 2022 19:09:49 +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: <20221011170949.upxk3tcfcwnkytwm@kamzik> References: 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=1665508192; a=rsa-sha256; cv=none; b=KidRnIgo4h4yFVk7wursDI08pEY6UNzIYUu4OxjL6/LkUbd2P2f+mDSCr3HcuiJo+DlhPQ EZZBmYXJyvFlyBvT2nRuxE/L/4ArnYYh/Slox4oPqBxwK2rhr4RsnTkRYP9TKuyDzXev5O bX3V/xK+G6N3r+fT2sPXmmgb5tjJGGs= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=VZcGRJ6u; spf=pass (imf03.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.44 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=1665508192; 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=ocUKjVgs7hkiBGPswf8jad/dUSoFrePCrz7xOrN9l9E=; b=lwRjOSbqMyQDRCyxlwt2WHlKlkzhTHic9sJ5L55N/lZmC/o/0Lzv3bf2wGvjtmzR0oTJPl m7SOg2QhnQrVPDv73w7s/vhohPAuQ82K6dRIo8vEeoENiTcm0dVI35Hov2jJL+7oOznJHh dibGBm4MfShWVoCSv3M7IOffrmqWYo0= X-Stat-Signature: q947yy9ri8pcwuzsjrqppztai7ija9fq X-Rspamd-Queue-Id: 4BC092001C X-Rspam-User: X-Rspamd-Server: rspam08 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=VZcGRJ6u; spf=pass (imf03.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=ajones@ventanamicro.com; dmarc=none X-HE-Tag: 1665508192-548609 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 Sat, Oct 01, 2022 at 10:16:36AM -0700, Yury Norov wrote: > On Sat, Oct 01, 2022 at 09:20:53AM -0700, Linus Torvalds wrote: > > On Fri, Sep 30, 2022 at 6:51 PM Yury Norov wrote: > > > > > > The commit b9a7ecc71fe582e ("cpumask: fix checking valid cpu range") > > > fixes broken cpumask_check(), which for now doesn't warn user when it > > > should. After the fix, I observed many false-positive warnings which > > > were addressed in the following patches. > > > > Are all the false positives fixed? > > I build-tested on x86_64 and arm64. All fixed except for those > generated by cpumask_next_wrap(). And I'm not even sure they > are false positives. > > This is what I'm working on right now. Hope moving it in next > merge window. 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 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) + 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) + 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. >