public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Markus Metzger via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb, btrace: fix family and model computation
Date: Fri, 21 Oct 2022 09:30:07 -0600	[thread overview]
Message-ID: <87h6zxchz4.fsf@tromey.com> (raw)
In-Reply-To: <20221021121308.294059-1-markus.t.metzger@intel.com> (Markus Metzger via Gdb-patches's message of "Fri, 21 Oct 2022 14:13:08 +0200")

>>>>> "Markus" == Markus Metzger via Gdb-patches <gdb-patches@sourceware.org> writes:

Markus> In gdb/nat/linux-btrace.c:btrace_this_cpu() we initialize the cpu
Markus> structure given to the libipt btrace decoder.

Markus> We only consider the extended model field for family 0x6 and forget about
Markus> family 0xf and we don't consider the extended family field.  Fix it.

You should probably just self-approve this.

Markus>  	      cpu.family = (cpuid >> 8) & 0xf;
Markus> -	      cpu.model = (cpuid >> 4) & 0xf;
Markus> +	      if (cpu.family == 0xf)
Markus> +		cpu.family += (cpuid >> 20) & 0xff;
 
Markus> -	      if (cpu.family == 0x6)
Markus> +	      cpu.model = (cpuid >> 4) & 0xf;
Markus> +	      if ((cpu.family == 0x6) || ((cpu.family & 0xf) == 0xf))
Markus>  		cpu.model += (cpuid >> 12) & 0xf0;

I wonder if these magic numbers have #defines anywhere we could use.

Tom

  reply	other threads:[~2022-10-21 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 12:13 Markus Metzger
2022-10-21 15:30 ` Tom Tromey [this message]
2022-10-24  8:19   ` Metzger, Markus T
2022-10-25 16:55     ` Tom Tromey
2022-10-28  6:46       ` Metzger, Markus T

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=87h6zxchz4.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).