lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Oct 2023 15:29:18 -0600
From:   Dan Raymond <raymod2@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Greg KH <gregkh@...uxfoundation.org>, linux-kernel@...r.kernel.org,
        x86@...nel.org, linux-serial <linux-serial@...r.kernel.org>,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, peterz@...radead.org,
        andriy.shevchenko@...ux.intel.com, quic_saipraka@...cinc.com
Subject: Re: [PATCH v3] arch/x86: port I/O tracing on x86

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ