linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Raymond <raymod2@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-serial <linux-serial@vger.kernel.org>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org,
	andriy.shevchenko@linux.intel.com, quic_saipraka@quicinc.com
Subject: Re: [PATCH v3] arch/x86: port I/O tracing on x86
Date: Fri, 6 Oct 2023 15:29:18 -0600	[thread overview]
Message-ID: <3d30d1b1-e4a2-7af3-20ef-11d2d97f65ad@gmail.com> (raw)
In-Reply-To: <20231004195001.76a57417@gandalf.local.home>

On 10/4/2023 5:50 PM, Steven Rostedt wrote:
>> I've copied Steven Rostedt who is the maintainer of tracefs to see if he
>> has any comment.  I just noticed arch/x86/boot/msr.h and I see that it
>> redefines rdmsr() and wrmsr() and omits the tracepoints.  A comment there
>> explains:
>>
>> /*
>>  * The kernel proper already defines rdmsr()/wrmsr(), but they are not for the
>>  * boot kernel since they rely on tracepoint/exception handling infrastructure
>>  * that's not available here.
>>  */
>>
>> We could do something similar for inb()/outb() and redefine them in
>> arch/x86/boot/io.h instead of including <asm/shared/io.h> there.
> 
> That would be a saner approach.
> 
> -- Steve

I tried this but it is problematic because there are include chains that
define inb()/outb() without including arch/x86/boot/io.h at all.  For example:

  arch/x86/boot/compressed/misc.c ->
  arch/x86/boot/compressed/misc.h ->
  include/linux/acpi.h ->
  include/acpi/acpi_io.h ->
  include/linux/io.h ->
  arch/x86/include/asm/io.h ->
  arch/x86/include/asm/shared/io.h

What we need is to disable tracepoints altogether in arch/x86/boot/* so I
added -DDISABLE_TRACEPOINTS to the relevant Makefiles and I added a check for
that symbol in tracepoint-defs.h.  I will submit a v4 version of my patch
with these changes shortly.

This resolves the problem with <asm/msr.h> as well.  After applying the v4
patch I was able to call rdmsr()/wrmsr() from arch/x86/boot/misc.c.
Theoretically we can now remove arch/x86/boot/msr.h but I had trouble with
that due to compiler warnings and errors.  The include files in arch/x86/boot
are a mess.  Maybe this can be cleaned up in another patch.

  reply	other threads:[~2023-10-06 21:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 19:15 [PATCH v3] arch/x86: port I/O tracing on x86 Dan Raymond
2023-10-03 12:50 ` Greg KH
2023-10-04 22:54   ` Dan Raymond
2023-10-04 23:50     ` Steven Rostedt
2023-10-06 21:29       ` Dan Raymond [this message]
2023-10-06 21:32       ` [PATCH v4] " Dan Raymond
2023-10-07  6:53         ` kernel test robot
2023-10-07 17:56         ` [PATCH v5] " Dan Raymond
2023-10-11 20:22           ` Dan Raymond
2023-10-11 20:41             ` Greg KH
2023-10-21 16:00           ` Greg KH
2023-10-21 20:15             ` Steven Rostedt
2023-10-23 21:29               ` Dan Raymond
2023-10-23 21:51                 ` Steven Rostedt
2023-10-23 20:28             ` Dan Raymond
2023-10-24  9:32               ` Greg KH

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=3d30d1b1-e4a2-7af3-20ef-11d2d97f65ad@gmail.com \
    --to=raymod2@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quic_saipraka@quicinc.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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 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 NNTP newsgroup(s).