[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] PCI/MSI: Fix masking MSI/MSI-X on Xen PV


  • To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 25 Oct 2021 13:43:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7FpfaW3BRyX1N9WZkadSTTzAgNcRaEKnF+r1qoySrlE=; b=AvpUWnQsSfNnRvaU99jyGBhnEWgvCdjcEBmVI15zDXdTZkmkupEMBpCsF/TC5o7KYWEjlXo5uvpHlML73YTjD3780eVojgIArqb4D8mv1/0VfppofBjjmUSfyYckFf2Cx+sa+ReDZOiWhAxaqClaM9D40qXffA9DjSvm3vyd88CEz+m4L2dYJeTjzFeqPFgAUoKcpOmpYhBWQxh0AZ19RORtNb7cMDsfSfo+1O88hkBSYWZ8dA645/GdstaDcUPbI8i+eXJLvU+a+rZ5A0S8eLiqj0TKyAiIoBKwmz+jiCKNpAvxNiOGXrk7zW5SjpVpe2BLQtAr9VWDTESvnAE2lA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5HafTh1R15TvSoOC4LwpQIFMb0hbY8AowQa1iyOKLkMZp3GvtbjwZPxPJfbaXDDL8TUTksak7wq4l/ziJLlkXmAEu9ShWc8J/W9Oc8HWHGrMFAJf8q11NAKv5wQigSKEo2/cP9TzkQ4kqF+yYGljWSh0KJbbUpYGKszUYNc37o8tQZisvpYqDwbNbS2xJ98UK1dQVaaIkNNKhAGqAbKsCXJu+mBBHhGK/qd8kLm+bvt0d8nDUkfZRXRWl6N4IwFpnKWD8/wR0TgGlg46pefwD8MwYXqsc50TGv70Ihtl791gYPgQqhTD4ee7dJQZcH8Pyy8rHbjIzRFvDEMl3KrHg==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jason Andryuk <jandryuk@xxxxxxxxx>, <josef@xxxxxxxxxxx>, <boris.ostrovsky@xxxxxxxxxx>, <helgaas@xxxxxxxxxx>, <jgross@xxxxxxxx>, <linux-pci@xxxxxxxxxxxxxxx>, <maz@xxxxxxxxxx>, <tglx@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 25 Oct 2021 11:44:14 +0000
  • Ironport-data: A9a23:cH1aQq4ppVNFFZieuTRlsQxRtEvBchMFZxGqfqrLsTDasY5as4F+v jYeXjrTOq7ZMGCjc94ibo6z/EoP7ZSBnIRqSVFs+CgzHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuV3zyIQUBUjclkfJKlYAL/En03FVAMpBsJ00o5wrdh2NMw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zy Oxfv7ysQywTGbDzkb4yCTpyCzpcIvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgWpt3JAeTai2i 8wxVAZhNi3bOzx2BGwQN5Mag+CknyLcWmgNwL6SjfVuuDWCpOBr65DpMdzIapmSTsR9gEmVv CTF8n7/DxVcM8aQoRKH/WirnfTnhj7gVcQZE7jQ3v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VQf50IPPniN/H3uEFMkj6vs0srf1j8RPQhvF3nC3TnljsEG YShpGh6PdyqzSu60VBCcM1Zi
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Oct 25, 2021 at 08:44:52AM +0100, David Woodhouse wrote:
> On Sun, 2021-10-24 at 21:25 -0400, Jason Andryuk wrote:
> > commit fcacdfbef5a1 ("PCI/MSI: Provide a new set of mask and unmask
> > functions") introduce functions pci_msi_update_mask() and
> > pci_msix_write_vector_ctrl() that is missing checks for
> > pci_msi_ignore_mask that exists in commit 446a98b19fd6 ("PCI/MSI: Use
> > new mask/unmask functions").  The checks are in place at the high level
> > __pci_msi_mask_desc()/__pci_msi_unmask_desc(), but some functions call
> > directly to the helpers.
> > 
> > Push the pci_msi_ignore_mask check down to the functions that make
> > the actual writes.  This keeps the logic local to the writes that need
> > to be bypassed.
> > 
> > With Xen PV, the hypervisor is responsible for masking and unmasking the
> > interrupts, which pci_msi_ignore_mask is used to indicate.
> 
> This isn't just for Xen PV; Xen HVM guests let Xen unmask the MSI for
> them too.

It's kind of optional for HVM guests, as it depends on
XENFEAT_hvm_pirqs, which sadly gets unconditionally set for HVM
guests, thus dropping any benefits from having hardware assisted APIC
virtualization or posted interrupts support.

AFAICT pci_msi_ignore_mask is not (correctly) set for HVM guest when
MSI interrupts are routed over event channels.

Regards, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.