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

Re: [PATCH 2/3] x86/msi: remove return value from msi_set_mask_bit()


  • To: David Vrabel <dvrabel@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Nov 2022 11:14:01 +0100
  • 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=bDg6WjHBKLnweFvSdnfYqoVVNaj+eMRAPRBVESqmdOk=; b=iMAyvvW6mer/wBFU/qin7C4c9EshKsftI/j02fC/kpa4uIHjyVLe+Vna7W01KdN+Gsfk8K9/m0dSE1Md91+tptLkHEKh5ixx8ksscUgD95K/GkI+lqtrlKW+cpEv0kcZIYxCscl64PTgOE1M7o4hEsPjTkMvDLG9hEJNBvNN4wG2a9T2C0hgalct5SaX4nYa6GTyeSSecaAFeBLs6qefp+hl9haXjVWvHxWUXSfNBFnjrGrujTPT53SXCUr55iloSppuHL2pG/FtAsDa0H/SpfzGGZ/b9W6knOHdnSgj5gb6RDgizJIS3i/hmw6UkYONaTn3XEwEnlMhoqAYhiRg3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4rUQHgBuZLw/ICToqjKgatK9uiK1qk76bXO4bpGQnAIa/cm0RdIPvY9+sZew/Q38yGb+++V42byyH1/y38DOkwljYGUZRXarA+jI+p1xCSyvAnRfnC8GYxeEyj6aJ6kaTJxcXNJurRrFEotPYqjIPTTgay9z3O7cVf/kY2nYhUx7DCMGbGVzyr6XNGgWB4GlH6hL6BtIJFYZaLQ6FrSwXldh5FAdN3lbH+8H9zodee2H4Vd+7kV/5P6Zlo5oFY9hicpcTXZldheraQ6JEjj6k4yoCO0IvvXTP5JSFpiJvXXQ/NOALD1B644ABxHX8e+KODGwEfP/zv+igOkvw+k1A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, David Vrabel <dvrabel@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 14 Nov 2022 10:14:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.11.2022 15:41, David Vrabel wrote:
> On 11/11/2022 09:44, Jan Beulich wrote:
>>
>> The idea of the WARN() / BUG_ON() is to
>> - not leave failed unmasking unrecorded,
>> - not continue after failure to mask an entry.
> 
> Then lets make msi_set_mask_bit() unable to fail with something like 
> this (untested) patch. Would this be acceptable?
> 
> David

Hmm, that's quite a bit of code churn for something which, for now at
least, I'm not convinced needs changing. Yes, ...

>  From 837649a70d44455f4fd98e2eaa46dcf35a56d00a Mon Sep 17 00:00:00 2001
> From: David Vrabel <dvrabel@xxxxxxxxxxxx>
> Date: Fri, 11 Nov 2022 14:30:16 +0000
> Subject: [PATCH] x86: Always enable memory space decodes when using MSI-X
> 
> Instead of the numerous (racy) checks for memory space accesses being
> enabled before writing the the MSI-X table, force Memory Space Enable
> to be set in the Command register if MSI-X is used.

... there is some raciness there, but we assume a well-behaved Dom0
(and DomU don't have direct access to the decode enable bits), so the
checks are more to be on the safe side (the original change attempted
to merely deal with the specific pciback behavior, without impacting
other [odd/unexpected] things Dom0 may be doing, as long as what it's
doing isn't plain wrong/buggy).

> This allows the memory_decoded() function and the associated error
> paths to be removed (since it will always return true). In particular,
> msi_set_mask_bit() can no longer fail and its return value is removed.
> 
> Note that if the PCI device is a virtual function, the relevant
> command register is in the corresponding physical function.
> 
> Signed-off-by: David Vrabel <dvrabel@xxxxxxxxxxxx>

What I'm missing in the description is a discussion of the safety of
the change, in particular the taking away of the control of the
memory decode bit from Dom0 (over certain periods of time). Without
that I'm afraid I can't answer your question (and wouldn't want to
review the change in detail).

Jan



 


Rackspace

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