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

Re: [PATCH 6/7] xen/evtch: use smp barriers for user event ring


  • To: Jürgen Groß <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 8 Feb 2021 10:31:33 +0000
  • 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-SenderADCheck; bh=DZUx01oQax/iYUlWe97Je4a/eksVcPW2+BdzIcW+Xfk=; b=nsMo0+jt8oun7j2KU4Q4gP8epCLmooXq6KOxoeQWr2hViGPYP1ytHQFTXqx1cxTiNwlsbX6VOxTviQBAoq0bKZbIcNKd0N4+Fc+6mF4MMJS7bh1NyrgSD2zQ2jR0D1FBonLx2rdYR8XRo0dgn1oZadZDY2mk/Z30ZSyCf1qjF281A9EkjpTwspEQXhhwdLfCUGgonfNR9VTfKjyM3iNCb8DmT5gejaRlDix/4vMyMNRFVHzShIIIMR3xAPjJGRVq+DTf7nt6U39orV8IebWB1E98KvIcLX5HiPaoaqP3flajhgorClzXQZP2wHGqxJx7rtsz9IdPS0qYOpNPHsL69A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmkdMkIzKGI5cnd8KEcS8MRFD6tVmQ5spXKjCA0Z22kAgr+NyhUOUByRqzaLTjKfxSBAvVfxZBrVXsUz7xMOIGRxVVDF673bSVezoGdfRgivq9Rkrwr9n2fpXuWSZKM3sJV20YKw0m+4ZyXis6cdb2aYoEY6tMIyF2VqYEIBz8BL816cVatXUZMNj/8gD5Lj60ldWwUpg7u8c2llgxrD9VL2yZUexm40MbVbzCUX62xu12dixRgoISNZXbBdo2u/JCFHXMvLYsVhLEoCBUbGLrxAfyMmnPm/5wfKvUee9YySWZ6PivDpDxnaG4s2wiOZdItsbjLFp+C88odvQIGpZg==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 08 Feb 2021 10:31:51 +0000
  • Ironport-sdr: 28c8XnO8/zFeeNVyIbqMLb8LB/GzluumD0GZLmwM2hAjdrV/NtEemG4LHXnWPEf8CoLA+XkbFY x0FxiF0JDvPP+FMCS1qI1SGQ2oXrxecmuVIL2li+jSWywE+YriYP1Yk3Iv6J7aQrih2uvuaXUo RP32mOwW1VYmCP/GyzkDnYtX5nt9UNEJIf87nLlySEh0NA3IdgcCOorEuGIkKyF9tabwJnZlOY M9uGG9crrA06ElzSLZoG9SeubTGfNW6L0h+VE6gdbvUu5j8v/EQtvzcjRGhOohsx3/W4YZasj7 PQo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08/02/2021 10:25, Jürgen Groß wrote:
> On 08.02.21 11:23, Andrew Cooper wrote:
>> On 08/02/2021 09:50, Jan Beulich wrote:
>>> On 08.02.2021 10:44, Andrew Cooper wrote:
>>>> On 06/02/2021 10:49, Juergen Gross wrote:
>>>>> The ring buffer for user events is used in the local system only, so
>>>>> smp barriers are fine for ensuring consistency.
>>>>>
>>>>> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>>>> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
>>>> These need to be virt_* to not break in UP builds (on non-x86).
>>> Initially I though so, too, but isn't the sole vCPU of such a
>>> VM getting re-scheduled to a different pCPU in the hypervisor
>>> an implied barrier anyway?
>>
>> Yes, but that isn't relevant to why UP builds break.
>>
>> smp_*() degrade to compiler barriers in UP builds, and while that's
>> mostly fine for x86 read/write, its not fine for ARM barriers.
>>
>> virt_*() exist specifically to be smp_*() which don't degrade to broken
>> in UP builds.
>
> But the barrier is really only necessary to serialize accesses within
> the guest against each other. There is no guest outside party involved.
>
> In case you are right this would mean that UP guests are all broken on
> Arm.

Oh - right.  This is a ring between the interrupt handler and a task. 
Not a ring between the guest and something else.

In which case smp_*() are correct.  Sorry for the noise.

~Andrew



 


Rackspace

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