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

Re: [PATCH 3/4] vpci: shrink critical section in vpci_{read/write}


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 2 Feb 2022 10:05:55 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=h/YBpmxmbKgzLPZLm2sFypR7msJ3r+ccScFC6rDGFVk=; b=mfJvDslpIlpn6gTcX6mL4bOEcVBAi7UF5Cl6zAH+mk8qY9mpUGy1mQKeMVqGL6WO5BNHonkmFh29QGrCXGK1/cbFtPJRcHJc9A38ooKQLDSKuO4qGqIX/Wo2zvWpndWatp9VkDbxbxqGEczo1KWiidY7B5YDeP1pW/gbjLX+6Y6NQ8zIkya9w/igP0YnIS3M3j0ETXaLZFomadcnSelsFqpicI/phoL8qJKoKQDUrWRPhgO5g3Y/qs5GqDz+P+hIRQA09MoIIaPqZJ1UYohwJoXxQ5HaYAwb0585tp7FcHozWuz8FHF0pDxISD3KEvbPBQp9vj1yxoiqlA7RCkjkKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKFHTS6vfvY6SuPCd+T3+45mJtftWtG3Bj2OsUx27uaCUPRm4mMv1wpbQX1Bd9jXdm5n9ZEr+iEDEww45HfneqRbqnskBl9hygKF7Gs7bjnFEpwJOB4049nyrnjEP912gw7TrayAfrKQ7CS84bxAbizXXav2vgQekSe9I7QopFGu+om5XaH82GQnqZ50SDYGBF9U5jiCkxn5EI4WJq1BCxTEpwDjIxVrginWJOKcKxcgdHzpPreyVQA4pozSeJ8DPqs83+IzebWp5gN9j/gxu+rST9iEmJ697D1fgAJBVkWa7re1RiumXxDBPab/yEVL7s9s0wvk8mD4wrB2g2yp1Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, julien@xxxxxxx, sstabellini@xxxxxxxxxx, oleksandr_tyshchenko@xxxxxxxx, volodymyr_babchuk@xxxxxxxx, george.dunlap@xxxxxxxxxx, paul@xxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
  • Delivery-date: Wed, 02 Feb 2022 09:06:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.02.2022 09:44, Roger Pau Monné wrote:
> On Tue, Feb 01, 2022 at 06:25:07PM +0200, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

Oleksandr, can you please clarify authorship here? The rule of thumb is
that From: matches ...

>> Shrink critical section in vpci_{read/write} as racing calls to
>> vpci_{read,write}_hw() shouldn't be a problem. Those are just wrappers
>> around pci_conf_{read,write} functions, and the required locking (in
>> case of using the IO ports) is already taken care in pci_conf_{read,write}.
>>
>> Please note, that we anyways split 64bit writes into two 32bit ones
>> without taking the lock for the whole duration of the access, so it is
>> possible to see a partially updated state as a result of a 64bit write:
>> the PCI(e) specification don't seem to specify whether the ECAM is allowed
>> to split memory transactions into multiple Configuration Requests and
>> whether those could then interleave with requests from a different CPU.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

... the first S-o-b, as these are expected to be in chronological
order.

> Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

I'll take your unconstrained ack to indicate that you're also fine
with this going in right away; see my reply to 0/4 as to the earlier
two patches. Please let me know (soonish) if I shouldn't make this
implication, but I shall wait with committing for clarification of
the question further up anyway.

> Would like to make sure whether Jan still have concerns about
> splitting accesses though.

I continue to be a little concerned, but as long as the decision is
taken consciously (and this is recorded in the description), which
clearly is the case now, I have no objections. In the end well
behaved OSes will suitably serialize accesses to config space anyway.

> Also since I'm the maintainer we need a Reviewed-by from someone else.

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

I'm not sure this is strictly needed though: I'd generally consider
a 2nd (later) S-o-b as valid stand-in for R-b, at least as long as
the 2nd author doesn't scope-restrict their tag.

One further remark though: The resulting asymmetry of the locking
(covering the "head" hw read but not the "tail" one) looks a little
odd, but I will admit that I don't see a good way to restore symmetry.

Jan




 


Rackspace

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