All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	AndrewCooper <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	TimDeegan <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Daniel De Graaf" <dgdegra@tycho.nsa.gov>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v5 5/6] xen/x86: add PHYSDEVOP_msi_control
Date: Tue, 6 Aug 2019 11:46:01 +0200	[thread overview]
Message-ID: <20190806094601.GG1250@mail-itl> (raw)
In-Reply-To: <c16737dc-f5f1-45f7-e743-970016820aab@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 3742 bytes --]

On Tue, Aug 06, 2019 at 07:56:39AM +0000, Jan Beulich wrote:
> On 05.08.2019 15:44, Marek Marczykowski-Górecki  wrote:
> > On Fri, Jul 19, 2019 at 09:43:26AM +0000, Jan Beulich wrote:
> >> On 19.07.2019 11:02, Roger Pau Monné  wrote:
> >>> On Fri, Jul 19, 2019 at 08:04:45AM +0000, Jan Beulich wrote:
> >>>> On 18.07.2019 18:52, Roger Pau Monné  wrote:
> >>>>> On Thu, Jul 18, 2019 at 03:17:27PM +0000, Jan Beulich wrote:
> >>>>>> On 18.07.2019 15:46, Roger Pau Monné  wrote:
> >>>>>>> In fact I don't think INTx should be enabled when MSI(-X) is disabled,
> >>>>>>> QEMU already traps writes to the command register, and it will manage
> >>>>>>> INTx enabling/disabling by itself. I think the only check required is
> >>>>>>> that MSI(-X) cannot be enabled if INTx is also enabled. In the same
> >>>>>>> way both MSI caspabilities cannot be enabled simultaneously. The
> >>>>>>> function should not explicitly disable any of the other capabilities,
> >>>>>>> and just return -EBUSY if the caller attempts for example to enable
> >>>>>>> MSI while INTx or MSI-X is enabled.
> >>>>>>
> >>>>>> You do realize that pci_intx() only ever gets called for Xen
> >>>>>> internally used interrupts, i.e. mainly the serial console one?
> >>>>>
> >>>>> You will have to bear with me because I'm not sure I understand why
> >>>>> it does matter. Do you mean to point out that dom0 is the one in full
> >>>>> control of INTx, and thus Xen shouldn't care of whether INTx and
> >>>>> MSI(-X) are enabled at the same time?
> >>>>>
> >>>>> I still think that at least a warning should be printed if a caller
> >>>>> tries to enable MSI(-X) while INTx is also enabled, but unless there's
> >>>>> a reason to have both MSI(-X) and INTx enabled at the same time (maybe
> >>>>> a quirk for some hardware issue?) it shouldn't be allowed on this new
> >>>>> interface.
> >>>>
> >>>> I don't mind improvements to the current situation (i.e. such a
> >>>> warning may indeed make sense); I merely stated how things currently
> >>>> are. INTx treatment was completely left aside when MSI support was
> >>>> introduced into Xen.
> >>>
> >>> In order to give Marek a more concise reply, would you agree to return
> >>> -EBUSY (or some error code) and print a warning message if the caller
> >>> attempts to enable MSI(-X) while INTx is also enabled?
> >>
> >> As to returning an error - I think so, yes. I'm less sure about logging
> >> a message.
> > 
> > I'm trying to get it working and it isn't clear to me what should I
> > check for "INTx is also enabled". I assumed PCI_COMMAND_INTX_DISABLE
> > bit, but it looks like guest has no control over this bit, even in
> > permissive mode.  This means enabling MSI(-X) always fails because guest
> > has no way to set PCI_COMMAND_INTX_DISABLE bit before.
> 
> Well, the guest has no control, but in order to enable MSI{,-X} I'd
> have expected qemu or the Dom0 kernel to set this bit up front. 

qemu would do that, when running in dom0. But in PV stubdomain it talks
to pciback, which filters it out.

> If
> that's not the case, then of course neither checking nor logging a
> message is appropriate at this point in time. It may be worthwhile
> calling out this anomaly then in the description.

Ok, so I'll go back to setting PCI_COMMAND_INTX_DISABLE instead of just
verification.

Just to clarify: should I also clear PCI_COMMAND_INTX_DISABLE when
disabling MSI? Now I think yes, because nothing else would do that
otherwise, but I would like to double check.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-08-06  9:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  1:00 [Xen-devel] [PATCH v5 0/6] Fix PCI passthrough for HVM with stubdomain Marek Marczykowski-Górecki
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 1/6] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use Marek Marczykowski-Górecki
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 2/6] libxl: attach PCI device to qemu only after setting pciback/pcifront Marek Marczykowski-Górecki
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 3/6] libxl: don't try to manipulate json config for stubdomain Marek Marczykowski-Górecki
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 4/6] xen/x86: Allow stubdom access to irq created for msi Marek Marczykowski-Górecki
2019-07-17  9:54   ` Roger Pau Monné
2019-07-17 15:09     ` Marek Marczykowski-Górecki
2019-07-18  9:29       ` Roger Pau Monné
2019-07-18 15:12         ` Marek Marczykowski-Górecki
2019-07-18 16:55           ` Roger Pau Monné
2019-07-20 16:48   ` Julien Grall
2019-07-20 21:21     ` Marek Marczykowski-Górecki
2019-07-21 18:05       ` Julien Grall
2019-07-22  8:45         ` Roger Pau Monné
2019-07-22  9:06           ` Julien Grall
2019-07-22  9:16             ` Julien Grall
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 5/6] xen/x86: add PHYSDEVOP_msi_control Marek Marczykowski-Górecki
2019-07-17 10:18   ` Roger Pau Monné
2019-07-17 23:54     ` Marek Marczykowski-Górecki
2019-07-18 13:46       ` Roger Pau Monné
2019-07-18 15:17         ` Jan Beulich
2019-07-18 16:52           ` Roger Pau Monné
2019-07-19  8:04             ` Jan Beulich
2019-07-19  9:02               ` Roger Pau Monné
2019-07-19  9:43                 ` Jan Beulich
2019-08-05 13:44                   ` Marek Marczykowski-Górecki
2019-08-06  7:56                     ` Jan Beulich
2019-08-06  9:46                       ` Marek Marczykowski-Górecki [this message]
2019-08-06 10:33                         ` Jan Beulich
2019-08-06 10:53                           ` Marek Marczykowski-Górecki
2019-08-06 12:05                             ` Jan Beulich
2019-08-06 12:43                               ` Marek Marczykowski-Górecki
2019-08-06 13:19                                 ` Jan Beulich
2019-08-06 13:41                                 ` Roger Pau Monné
2019-07-19 10:40   ` Jan Beulich
2019-07-17  1:00 ` [Xen-devel] [PATCH v5 6/6] tools/libxc: add wrapper for PHYSDEVOP_msi_control Marek Marczykowski-Górecki
2019-07-17 10:21   ` Roger Pau Monné
2019-07-18  0:12     ` Marek Marczykowski-Górecki
2019-07-18 13:53       ` Roger Pau Monné

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=20190806094601.GG1250@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.