public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Thomas Gleixner' <tglx@linutronix.de>,
	Alexander Graf <graf@amazon.com>, X86 ML <x86@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Alexandre Chartre <alexandre.chartre@oracle.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	"Will Deacon" <will@kernel.org>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Wei Liu <wei.liu@kernel.org>,
	Michael Kelley <mikelley@microsoft.com>,
	Jason Chen CJ <jason.cj.chen@intel.com>,
	Zhao Yakui <yakui.zhao@intel.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Avi Kivity <avi@scylladb.com>,
	"Herrenschmidt, Benjamin" <benh@amazon.com>,
	"robketr@amazon.de" <robketr@amazon.de>,
	"amos@scylladb.com" <amos@scylladb.com>,
	Brian Gerst <brgerst@gmail.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Alex bykov" <alex.bykov@scylladb.com>
Subject: RE: x86/irq: Unbreak interrupt affinity setting
Date: Thu, 27 Aug 2020 08:28:45 +0000	[thread overview]
Message-ID: <620d67af76554a558061c8df5e2cb038@AcuMS.aculab.com> (raw)
In-Reply-To: <87ft89kqmd.fsf@nanos.tec.linutronix.de>

From: Thomas Gleixner
> Sent: 26 August 2020 23:08
...
> > I suspect that it is much more 'racy' than that for PCI-X interrupts.
> > On the hardware side there is an interrupt disable bit, and address
> > and a value.
> > To raise an interrupt the hardware must write the value to the
> > address.
> 
> Really?

Yep, anyone with write access to the msi-x table can get the device
to write to any physical location (allowed by any IOMMU) instead of
raising an interrupt.

> > If the cpu needs to move an interrupt both the address and value
> > need changing, but the cpu wont write the address and value using
> > the same TLP, so the hardware could potentially write a value to
> > the wrong address.
> 
> Now I understand finally why msi_set_affinity() in x86 has to be so
> convoluted.

Updating the registers should be much the same on all architectures.
I probably should have looked at what msi_set_affinity() does before
deciding which order the fpga logic should read the four 32bit registers
in; but they are read in increasing order - so enable bit last.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-08-27  8:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 11:53 [PATCH] x86/irq: Preserve vector in orig_ax for APIC code Alexander Graf
2020-08-26 13:22 ` Josh Poimboeuf
2020-08-26 13:51   ` Alexander Graf
2020-08-26 14:27 ` Thomas Gleixner
2020-08-26 16:13   ` Andy Lutomirski
2020-08-26 17:47     ` Thomas Gleixner
2020-08-26 18:00       ` Andy Lutomirski
2020-08-26 18:22         ` Graf (AWS), Alexander
2020-08-26 16:33   ` Alexander Graf
2020-08-26 18:30     ` Thomas Gleixner
2020-08-26 18:53       ` Thomas Gleixner
2020-08-26 20:09         ` Alexander Graf
2020-08-26 20:21         ` x86/irq: Unbreak interrupt affinity setting Thomas Gleixner
2020-08-26 21:37           ` David Laight
2020-08-26 21:47             ` David Laight
2020-08-26 22:52               ` Alexander Graf
2020-08-27  8:31                 ` David Laight
2020-08-26 22:07             ` Thomas Gleixner
2020-08-27  8:28               ` David Laight [this message]
2020-08-27  7:32           ` [tip: x86/urgent] " tip-bot2 for 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=620d67af76554a558061c8df5e2cb038@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alex.bykov@scylladb.com \
    --cc=alexandre.chartre@oracle.com \
    --cc=amos@scylladb.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=avi@scylladb.com \
    --cc=benh@amazon.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=brgerst@gmail.com \
    --cc=frederic@kernel.org \
    --cc=graf@amazon.com \
    --cc=jason.cj.chen@intel.com \
    --cc=jgross@suse.com \
    --cc=joel@joelfernandes.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=robketr@amazon.de \
    --cc=rostedt@goodmis.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=wei.liu@kernel.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=yakui.zhao@intel.com \
    /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