Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp355386rwi; Mon, 31 Oct 2022 02:12:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7k/j/3Zu8EwVa4hYFpcIXe2qRCo8RXR7etbVKKmiWmCB20JoQaJhdSo7vmll6+X4jPXnJj X-Received: by 2002:aa7:c792:0:b0:453:98b7:213c with SMTP id n18-20020aa7c792000000b0045398b7213cmr12426992eds.159.1667207572792; Mon, 31 Oct 2022 02:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667207572; cv=none; d=google.com; s=arc-20160816; b=YjuVl0G4ww4A17RRKvSMnESfeoeeJJEnAR44n3UIsxFYFj1hi37EkahDERrCQEuNK+ Nq5Rq73cFuaIvHdziABqoP75+DhzVYLKTIe/hy4QmkGNsdzbh9mwkSKm3dfm0TXqCjP4 dCO5CfQ/hiO1dYP8QpSaPPOISWzqQ/QIWsZRSr3AWr7fBavu8FcQguoQ8ER20QyMsrer +P04tkFiCd5nHv8EKWWNdv92A7fSus+rdKOgAzJ6SG+yKr6XSTuoh0fSu5J3zE+WxH/4 7+XxPRWAEndWunzJVaXV51N0ZtMOGG7YBpyZYu+q7mh26D3//BclEIxylHJ+WESVdO/E iLTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ev78IiojEqGZ8VOXUxmz9XVfROk+6cN5zzZ8OowFM8w=; b=cYp40sw7lIgbfQh9+jJmpCsJ5u2n4JnG+Py/FEVLbRDJx0nOvu2mYZ481HzfyQW+xc Yq0ORmMo6ps6UzCbl9o7qXHrQxXAJWKl/MuhOyQkgmKfOtQg6SXxVrMD7O2JIS/sxr5x VNr4kYv7tybdK7cj9c3nWNKDPeBpCrsqusFlA+42zsipFvAeK7JLFyZpernEoX3qr3Ta 2jt5fSU0X1C9cpU8U0TcC7Norx36XGt36VAGdhYXyNOAhZvPL6RgDVhGbDnKE3LNBHL7 /Y7QWcl5ef+KQ9t2aAv6teWqdRGHGHBs0a00ZE4Ck25pppSIfddPJ4uKLguimhLT/4dU x3VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="eI/C2tSl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a170906b10f00b00787bacce740si6192239ejy.537.2022.10.31.02.12.29; Mon, 31 Oct 2022 02:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="eI/C2tSl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230020AbiJaI7N (ORCPT + 99 others); Mon, 31 Oct 2022 04:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiJaI7I (ORCPT ); Mon, 31 Oct 2022 04:59:08 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BDE41D3; Mon, 31 Oct 2022 01:59:08 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7cf329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7cf:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B91D91EC0531; Mon, 31 Oct 2022 09:59:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1667206746; h=from:from: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; bh=ev78IiojEqGZ8VOXUxmz9XVfROk+6cN5zzZ8OowFM8w=; b=eI/C2tSlcg0AxMZOuPZM7vJKKoRmjE6inbkFlcyC7xyapkJ4fbL6uqhy9LxHWWR24ASGVE A/YY8Nzaqhc5keG/EfmGhgdQunAK7K3mp31A11nA8qzGhVzkP/b4DF6aS9rc2MXsmebhdy KGNWf+tkEEOxBllDztC3oUYW5H3eT+s= Date: Mon, 31 Oct 2022 09:58:57 +0100 From: Borislav Petkov To: Andrew Jones Cc: Yury Norov , x86@kernel.org, linux-riscv , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Dave Hansen , Palmer Dabbelt , Paul Walmsley , Albert Ou , Jonas Bonn , Stefan Kristiansson , Stafford Horne , openrisc@lists.librecores.org, Michael Ellerman , "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , linux-s390@vger.kernel.org Subject: Re: [PATCH v3 2/2] x86: Fix /proc/cpuinfo cpumask warning Message-ID: References: <20221014155845.1986223-1-ajones@ventanamicro.com> <20221014155845.1986223-3-ajones@ventanamicro.com> <20221028074828.b66uuqqfbrnjdtab@kamzik> <20221031080604.6xei6c4e3ckhsvmy@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221031080604.6xei6c4e3ckhsvmy@kamzik> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 09:06:04AM +0100, Andrew Jones wrote: > The valid cpumask range is [0, nr_cpu_ids) and cpumask_next() always > returns a CPU ID greater than its input, which results in its input > range being [-1, nr_cpu_ids - 1). Ensure showing CPU info avoids > triggering error conditions in cpumask_next() by stopping its loop What error conditions? What would happen if @n is outside of the valid range? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette