From: Song Liu <songliubraving@fb.com>
To: "kan.liang@linux.intel.com" <kan.liang@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"peterz@infradead.org" <peterz@infradead.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] perf/x86/intel/uncore: Add Node ID mask
Date: Tue, 29 Jan 2019 07:10:16 +0000 [thread overview]
Message-ID: <CDEC00B0-AF34-4F97-AABD-A7FE0E8B7E5F@fb.com> (raw)
In-Reply-To: <1548600794-33162-1-git-send-email-kan.liang@linux.intel.com>
> On Jan 27, 2019, at 6:53 AM, kan.liang@linux.intel.com wrote:
>
> From: Kan Liang <kan.liang@linux.intel.com>
>
> Some PCI uncore PMUs cannot be registered on a 8-socket system (HPE
> Superdome Flex).
>
> To understand which Socket the PCI uncore PMUs belong to, perf retrieves
> the local Node ID of the uncore device from CPUNODEID(0xC0) of the PCI
> configuration space, and the mapping between Socket ID and Node ID from
> GIDNIDMAP(0xD4). The Socket ID can be calculated accordingly.
> The local Node ID is only available at bit 2:0, but current code doesn't
> mask it. If a BIOS doesn't clear the rest of the bits, a wrong Node ID
> will be fetched.
>
> Filter the Node ID by adding a mask.
>
> Fixes: 7c94ee2e0917 ("perf/x86: Add Intel Nehalem and Sandy Bridge-EP uncore support")
> Reported-by: Song Liu <songliubraving@fb.com>
> Tested-by: Song Liu <songliubraving@fb.com>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Cc: stable@vger.kernel.org
Thanks Kan!
Acked-by: Song Liu <songliubraving@fb.com>
> ---
> arch/x86/events/intel/uncore_snbep.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
> index c07bee3..b10e043 100644
> --- a/arch/x86/events/intel/uncore_snbep.c
> +++ b/arch/x86/events/intel/uncore_snbep.c
> @@ -1222,6 +1222,8 @@ static struct pci_driver snbep_uncore_pci_driver = {
> .id_table = snbep_uncore_pci_ids,
> };
>
> +#define NODE_ID_MASK 0x7
> +
> /*
> * build pci bus to socket mapping
> */
> @@ -1243,7 +1245,7 @@ static int snbep_pci2phy_map_init(int devid, int nodeid_loc, int idmap_loc, bool
> err = pci_read_config_dword(ubox_dev, nodeid_loc, &config);
> if (err)
> break;
> - nodeid = config;
> + nodeid = config & NODE_ID_MASK;
> /* get the Node ID mapping */
> err = pci_read_config_dword(ubox_dev, idmap_loc, &config);
> if (err)
> --
> 2.7.4
>
next prev parent reply other threads:[~2019-01-29 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-27 14:53 kan.liang
2019-01-29 7:10 ` Song Liu [this message]
2019-02-04 8:48 ` [tip:perf/core] " tip-bot for Kan Liang
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=CDEC00B0-AF34-4F97-AABD-A7FE0E8B7E5F@fb.com \
--to=songliubraving@fb.com \
--cc=ak@linux.intel.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®