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]
Message-ID: <alpine.DEB.2.21.1809072012310.1402@nanos.tec.linutronix.de>
Date:   Fri, 7 Sep 2018 21:11:58 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Philipp Eppelt <philipp.eppelt@...nkonzept.com>
cc:     linux-kernel@...r.kernel.org
Subject: Re: x86/apic: MSI address malformed for "flat" driver

On Thu, 6 Sep 2018, Philipp Eppelt wrote:
> 
> The "flat" driver defines the MSI addressing scheme to be used as
> logical addressing in flat mode. The MSI msg address is composed
> accordingly, but sets MSI_ADDR_REDIRECTION_CPU which is a zero at bit[3].

Correct. That's what it means:

  * When RH is 0, the interrupt is directed to the processor listed in the
    Destination ID field.

So for DM:

  * If RH is 0, then the DM bit is ignored and the message is sent ahead
    independent of whether the physical or logical destination mode is
    used.

which is means that the delivery does not do any magic redirections,
because the Redirection Hint is off. If RH is set, then the delivery can
redirect according to the rules in the DM section. We are not using that
because we want targeted single CPU delivery.

The interpretation of the DID field is purely depending on the local APIC
itself by matching the APIC ID against the DID field. And the local APIC ID
of CPU0 is 1 << 0, i.e. 0x1 which matches the MSI message you see.

> Currently, irq_msi_compose_msg composes for the "flat" driver an address
> like 0xfee0'1004 for a 64-bit single-core system without IO-APIC and MSI
> remapping and no ACPI (a virtual system).

The DM field is irrelevant if RH is 0. If RH is one and DM is 1 then you
can do group stuff and other magic, but we don't use that for 'external'
interrupts.

Where it _is_ used though is in the IPI delivery so that IPIs to multiple
CPUs require only a single APIC write, while with physical mode it's
necessary to write a single message to each CPU.

Hope that helps.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ