public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ondrej Zary <linux@zary.sk>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers
Date: Thu, 16 Sep 2021 19:09:31 +0200	[thread overview]
Message-ID: <87pmt8a1mc.ffs@tglx> (raw)
In-Reply-To: <202109151423.43604.linux@zary.sk>

Ondrej,

On Wed, Sep 15 2021 at 14:23, Ondrej Zary wrote:
> after upgrading Debian from 10 (kernel 4.19.194) to 11 (kernel 5.10.46) on HP
> DL380 G4 servers, hpasmd segfaults. Booting the 4.19.194 kernel allows hpasmd
> to work.
>
> Noticed the iopl(3) call. Checked out a kernel before "x86/iopl: Remove legacy IOPL option"
> (a24ca9976843156eabbc5f2d798954b5674d1b61) and built with CONFIG_X86_IOPL_LEGACY.
> It works!.
>
> I even disassembled /opt/hp/hp-health/bin/IrqRouteTbl (it's only 5952 bytes
> and does not use any hp libs). There's no CLI, only a couple of INs and OUTs:
> ...
>  8048f75:       66 ba 84 00             mov    dx,0x84
>  8048f79:       66 b8 00 00             mov    ax,0x0
>  8048f7d:       ee                      out    dx,al
>  8048f7e:       66 ba 85 00             mov    dx,0x85
>  8048f82:       ee                      out    dx,al
>
> But I still don't know what's going on.

That's weird. Let me think about a way to debug that. I just ran a
trivial test program which issues iopl(3) and reads all ports from
0-65535. That works like a charm.

#include <stdio.h>
#include <sys/io.h>

int main(void)
{
	unsigned int i;
	int ret;

	ret = iopl(3);
	if (ret)
		return ret;

	for (i = 0; i < 65536; i++)
		printf("%5u: %02x\n", i, inb(i));

	return 0;
}

Which CPU is in that machine?

Can you please run that failing program with GDB and figure out which
instruction causes #GP and what the register content is.

Thanks,

        tglx

  reply	other threads:[~2021-09-16 18:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 12:23 IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers Ondrej Zary
2021-09-16 17:09 ` Thomas Gleixner [this message]
2021-09-16 20:27   ` Ondrej Zary
2021-09-16 21:05     ` Peter Zijlstra
2021-09-17  8:11       ` Ondrej Zary
2021-09-17  9:20         ` [PATCH] x86/iopl: Fake iopl(3) CLI/STI usage Peter Zijlstra
2021-09-17 10:29           ` Ondrej Zary
2021-09-17 11:54             ` Peter Zijlstra
2021-09-17 12:33               ` Thomas Gleixner
2021-09-17 12:54                 ` Ondrej Zary
2021-09-17 10:40           ` Thomas Gleixner
2021-09-17 22:23           ` Linus Torvalds
2021-09-17 22:24             ` Linus Torvalds
2021-09-18  7:05               ` Peter Zijlstra
2021-09-18  9:06                 ` Peter Zijlstra
2021-09-18 15:53                   ` Ondrej Zary
2021-09-18 16:35                   ` Linus Torvalds
2021-09-21  7:28                   ` [tip: x86/core] " tip-bot2 for Peter Zijlstra
2021-09-21 11:09                     ` Ondrej Zary
2021-09-21 12:00                       ` Peter Zijlstra
2021-09-21 17:31                         ` Ondrej Zary
2021-09-21 12:41                   ` tip-bot2 for Peter Zijlstra
2021-09-21 21:01                 ` [PATCH] " Andy Lutomirski
2021-09-16 21:25     ` IOPL emulation breaks hpasmd (hp-health) needed by HP DL380 G4 servers Thomas Gleixner

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=87pmt8a1mc.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@zary.sk \
    --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