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

Re: [PATCH v2 3/3] x86/msi: clear initial MSI-X state on boot


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 28 Mar 2023 14:54:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=eIxMtcO8FGXRErZNwVX/JZutpjwl7UgT8b+v9lvMKxY=; b=nlbbg4O1qaACxVDadp35OouYl1AcMZ34OJv0JdsP0G1LTlzcV1m+tjILFL0AM8wr6ha5wBAKCL4MK5McaG/DxWJU2o6B4TL6+EdehAwTyXL3pjCAtlKH7qJRYi/6p1YDljKPd5ikZaRbKuWcRPZsbVUe7ZYRq/YWYfQQw6MPUhzr8UTg6q+8B+XDFKB2NEgP5ZU0xrdmBGxD0eYZleyEmHf/+ARw3gJ+ZZuSxZEBv3LZxF6a4YPOTJg1aocEg0T4eEsDnBJO95q1+oeEsW0ym83c0Bczt73wRZ7klhjK6xtwBHMIIJ3TdV2/OSltYD05mc3A+g7v9ca9hyRtAmvy2w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5ZtpSObE0Ig5cxQ7hO1YKC4+cds7fPuYmpWhJ1XvYD6kgkJvN0yCLexF1ahCh2jgvax5LDwQNeYaFO9Yy4qATBeurb73Qj+sSj3umW8G1a62oJxiLLopMsWptQsbTmDei92oPp1JbADT493znruyxt3DC8xmFbi0LcawkbjyxU9B/FO108O/wIt0vSNnPdUy79amG5RaHSrmtVAKy7dJkGuzuCf2rGu35vngeDfuQX6Nj467DtSXafChwOzQKFK7glQ2zZ88Clez3Mp6zjleTq7DOPry1kwjz6xhUNajctGG7FNKBxBMmjlLc0e8f5zvgVpqYPb61YF+k+lEsA8QQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jason Andryuk <jandryuk@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 28 Mar 2023 12:54:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.03.2023 03:49, Marek Marczykowski-Górecki wrote:
> Some firmware/devices are found to not reset MSI-X properly, leaving
> MASKALL set. Xen relies on initial state being both disabled.
> Especially, pci_reset_msix_state() assumes if MASKALL is set, it was Xen
> setting it due to msix->host_maskall or msix->guest_maskall. Clearing
> just MASKALL might be unsafe if ENABLE is set, so clear them both.

But pci_reset_msix_state() comes into play only when assigning a device
to a DomU. If the tool stack doing a reset doesn't properly clear the
bit, how would it be cleared the next time round (i.e. after the guest
stopped and then possibly was started again)? It feels like the issue
wants dealing with elsewhere, possibly in the tool stack.

> --- a/xen/drivers/passthrough/msi.c
> +++ b/xen/drivers/passthrough/msi.c
> @@ -48,6 +48,13 @@ int pdev_msi_init(struct pci_dev *pdev)
>          ctrl = pci_conf_read16(pdev->sbdf, msix_control_reg(pos));
>          msix->nr_entries = msix_table_size(ctrl);
>  
> +        /*
> +         * Clear both ENABLE and MASKALL, pci_reset_msix_state() relies on 
> this
> +         * initial state.
> +         */

Please can comments be accurate at least at the time of writing?
pci_reset_msix_state() doesn't care about ENABLE at all.

Jan



 


Rackspace

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