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

Re: [PATCH] vpci/msix: handle accesses adjacent to the MSI-X table


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Mar 2023 17:51:20 +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=E9bbwGVxemod56A7K+H+ymolx5Qk9ubg6kOAD9ibcZY=; b=J92okkjHe8oaGTw0lG7CpbNXdl392OIwZItkSoybjHNqTs1xt11vqMnAcKSJRapq1aSPip8X9pQVTRWUwnNX7u02UFVKYb9SV2i+q3p7olz3VAh5+UOHvIGZIzPAsPLJkMD3qO7TPTMVnd9Hmb1Morw6MAq/9DR5dIU6peU1fA3gXg//wjRVTaUs4J97HrlbRnsXd8C08GTGjDtfX81zabd8niSYj1iL1MQFrTbaAMksNKAer6ODLv32ZWd8V2JYK1S1F/dWaGNU7uiNqp6Yqj0sHphcyrfWT58Z3cj4uzfC/n8g+cYHh4r/MMbB7kZiOUnZOVlLlQsV+0+iM6sjWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aa+NG87FK0ZOTqlUbmvfwvgJ8f4KTZOY/Yyy8rOC34uBTAa7B1iRXAEoz/7sP8qylo/az5rCKgE8R7qrR6Hw0abuVLC0petqUvLMlh9MKz7WnyYZRXskuqUX18SGVgNPnZEWEl20n3tjpzryoIFZU8pPKJxX7AChj6lUY+/mpzKjTb1OwR9mr3yzNY0S0bQJK8Gw+eeudihOPQ9x1NwgSdaYNVLy0/zt37b4A7zR7nd/tNHvSzo5l9w1fT+3tcE6VudXPlZaCoo24KCmUiA7aZqe4ZpdUkTJUMUlWRSJpMgm34OnmlDTYOzh7Z4GsQd5ccyDdUtzed1h0PPOApcfHA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 14 Mar 2023 16:51:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.03.2023 17:34, Roger Pau Monné wrote:
> On Tue, Mar 14, 2023 at 04:46:19PM +0100, Jan Beulich wrote:
>> On 14.03.2023 14:54, Roger Pau Monné wrote:
>>> On Tue, Mar 14, 2023 at 12:56:33PM +0100, Jan Beulich wrote:
>>>> On 14.03.2023 11:13, Roger Pau Monne wrote:
>>>> I'm also concerned of misaligned accesses: While we can't keep the
>>>> guest from doing such on pages we don't intercept, depending on the kind
>>>> of anomalies such may cause the effects there may be contained to that
>>>> guest. When doing the accesses from the hypervisor, bad effects could
>>>> affect the entire system. (FTAOD I don't mean to constrain guests, but I
>>>> do think we need to consider splitting misaligned accesses.)
>>>
>>> I was also wondering about misaligned accesses.  Should be allow dom0
>>> any kind of access, while limiting domUs to aligned only?
>>
>> I guess the code would be simpler we we treated both equally. As said,
>> my goal is not to refuse misaligned accesses, but to break them up. To
>> keep things simple we might even use purely byte accesses (and then
>> perhaps simply REP MOVSB). Special casing Dom0 would only add code for
>> no real gain.
> 
> Hm, I would be worried about then breaking the requirement of some
> registers being accessed using a specific size, but again we are
> dealing with misaligned accesses to a region that shouldn't contain
> registers in the first place.

Well, you name it: We're talking about a specific-width access which
at the same is misaligned. That doesn't sound very likely, and imo
wants caring about the earliest when such a case actually arises.

> FWIW, the device I currently have that has registers in the same page
> as the MSIX and the PBA tables is fine with limiting such accesses to
> aligned only.
> 
> What is it that worries you about Xen relying unaligned accesses
> instead of just the domain itself doing it on any other BAR MMIO it
> has directly mapped into the p2m?  Any error generated by the device
> in such setup would likely have the same effect, regardless of whether
> the access is in Xen or domain context.

It's more that doing this in Xen doesn't feel well. If I should provide
a contrived scenario, I'd point at #MC potentially being raised for
such an access. If further we'd assume we had better machine check
handling, then dealing with #MC coming from a guest can be expected to
be more likely to keep the host alive than if the #MC was raised in Xen
(and e.g. - didn't check here - possibly with some lock held).

Jan



 


Rackspace

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