Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp384380rwb; Thu, 18 Aug 2022 05:43:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MW9VM4t8uQOMOC8f2rzarFSPM5U9ABFU71YIzzCPKO6jrY9oEVByTMSYg477vPdZOQKJY X-Received: by 2002:a17:902:ea03:b0:170:a235:b72b with SMTP id s3-20020a170902ea0300b00170a235b72bmr2747729plg.13.1660826618353; Thu, 18 Aug 2022 05:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660826618; cv=none; d=google.com; s=arc-20160816; b=MOv+3d4HTer16bfqnhFMHEEPga4c54pz7OCid7F9CiJiAEl1FQZTef8/Lz2hOaZOO1 AeJn167suhAdfKJvaLFbxCD3ffqsVtZ3CEPQUnztEob76IswZtiQrFL0TOEPoNUBFY0h K+nyfAW1ogjPS1TCj9cdiQXhgNaaLWWq0i49oSfY0bYCTfGZg4W/U0GYcn7TGh2Bi772 7zP5inNTExXq4q4c5r86VOEvJQ/ccWbQEW2hsJkpKjeh2luf2Q2nd+gV8dzglQ2/L2ZH PQFUdiEVGvi35nNStpOmybjefI8Yyhg/Wpiz2vmhpbj3vOzcxj+0xMPO0y3S9P9yfdBD RWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=N0KtEpoBu3th64oZcAZTDMjWHKbXWYEYW8YhIfYFUrs=; b=ldoYehQgmvUNtBHJVQTyZSTTRGb35BQLcmEy9oy/viG1w4GCg0fpoytj4QMfYuHgTd 6TjIN814lgD4iuvkG9cbD3O+seU+0s1VbUTygZedQlnL5dZX7D0xu4p/lKpI7aZcAqOr ESlbVDX6cnFrtSgOnfGi6CAbtjJQdiQ82nQuWKtPT052b0/qqi951NZ2kmmpc9UoV96V cjt1CAn4CwOgGNG5oSRz8MCkHsYpbIcukQppc3XoHKu8cHl+Fs2DIzNWM0Bbz2acn5xb wGdoa8FkYUOk9ODJriagyRKUenpDhAROBqQlRQI5axb10aOltT1S6xi+Q1ajkNiPyitl tjfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=M08rrkPu; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a63fa54000000b0041c1e063bb3si1403513pgk.369.2022.08.18.05.43.27; Thu, 18 Aug 2022 05:43:38 -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=@linux.microsoft.com header.s=default header.b=M08rrkPu; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244611AbiHRM33 (ORCPT + 99 others); Thu, 18 Aug 2022 08:29:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244528AbiHRM31 (ORCPT ); Thu, 18 Aug 2022 08:29:27 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E7248C472 for ; Thu, 18 Aug 2022 05:29:27 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1127) id DF7B0210924B; Thu, 18 Aug 2022 05:29:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DF7B0210924B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1660825765; bh=N0KtEpoBu3th64oZcAZTDMjWHKbXWYEYW8YhIfYFUrs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M08rrkPuCAid237xUFj2fYP6FZmsUPt/pBxVVKZy24w0fkEd3RFu9jQz3Yl072uoW yDTWQqqnwTwRuSvI+MVb6SMxS1KLFZhtd+hP0GfSyM9fJuws5sGfu6vl3itiRvO73S Oq7kHwstvTzamswUrWEgr1GuPGpvUo7JtH2l0IeM= Date: Thu, 18 Aug 2022 05:29:25 -0700 From: Saurabh Singh Sengar To: Borislav Petkov Cc: ssengar@microsoft.com, mikelley@microsoft.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, tim.c.chen@linux.intel.com, will@kernel.org, song.bao.hua@hisilicon.com, suravee.suthikulpanit@amd.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/cacheinfo: Don't use cpu_llc_shared_map for !CONFIG_SMP Message-ID: <20220818122925.GA8507@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1660148115-302-1-git-send-email-ssengar@linux.microsoft.com> <20220818045225.GA9054@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Thu, Aug 18, 2022 at 01:57:47PM +0200, Borislav Petkov wrote: > On Wed, Aug 17, 2022 at 09:52:25PM -0700, Saurabh Singh Sengar wrote: > > Shall I mention here "Non-SMP AMD processor" instead ? > > You should explain what that is. > > Is that a CONFIG_SMP=n kernel which you boot on a AMD CPU? Yes, thats correct. > > IOW, how do I reproduce the issue you're describing below, here locally? Boot latest linux kernel on AMD CPU, having CONGIG_SMP=n. Once booted execute lscpu (just lscpu without any argument ), this will cause segfault. Please make a note issue is observed with 2.34 version (default lscpu version with Ubuntu 20.04.4) of lscpu. Also, if for the above test we take linux kernel code before below commit, shared_cpu_map file gets created and lscpu just works fine. b81dce77ced ("cpumask: Fix invalid uniprocessor mask assumption") > > Send dmesg pls. > dmesg : We get only 2 lines of dmesg for this segfault. Step 1: dmesg -c Step 2: lscpu Step 3: dmesg below is the output of step 3. Dmesg: [ 6951.530138] lscpu[99034]: segfault at 0 ip 00005557bc9c35ba sp 00007ffced2681c8 error 4 in lscpu[5557bc9c0000+e000] [ 6951.530145] Code: 4d 39 c2 76 33 48 c1 e9 06 49 89 c8 4c 8d 2c cd 00 00 00 00 44 89 c9 4f 8b 04 c3 83 e1 3f 4d 0f a3 c8 73 14 4c 8b 02 4d 8b 00 <4f> 8b 04 28 49 d3 e8 41 83 e0 01 44 01 c3 48 89 c1 49 39 c4 74 38 > Also, what is the use case? > Explained above, putting here more precise steps: Step 1: Build linux kernel for AMD processor supporting L3 cache with CONFIG_SMP=n. Step 2: Boot this kernel. Step 3: Once in command prompt, enter lscpu If lspu is version 2.34 like the one I have (default with Ubuntu 20.04.4), segfault will be observed. > Why would you even build with SMP off? This is caught in our testing. > > Feel free to explain more verbosely what you're trying to accomplish. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette Please let me know if any thing is unclear or need more info reproducing the scenario. - Saurabh