All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
To: Borislav Petkov <bp@alien8.de>
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
Date: Thu, 18 Aug 2022 05:29:25 -0700	[thread overview]
Message-ID: <20220818122925.GA8507@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <Yv4pOz01nAkafiwd@zn.tnic>

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

  reply	other threads:[~2022-08-18 12:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 16:15 [PATCH] x86/cacheinfo: Don't use cpu_llc_shared_map for !CONFIG_SMP Saurabh Sengar
2022-08-12 14:56 ` Michael Kelley (LINUX)
2022-08-17 19:40 ` Borislav Petkov
2022-08-18  4:52   ` Saurabh Singh Sengar
2022-08-18 11:57     ` Borislav Petkov
2022-08-18 12:29       ` Saurabh Singh Sengar [this message]
2022-08-19 17:16         ` Borislav Petkov
2022-08-19 17:46           ` Saurabh Singh Sengar
2022-08-20  8:39             ` [PATCH] x86/cacheinfo: Add a cpu_llc_shared_mask() UP variant Borislav Petkov
2022-09-29  9:04 ` [tip: x86/urgent] " tip-bot2 for Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220818122925.GA8507@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=ssengar@linux.microsoft.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=ssengar@microsoft.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.