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

Re: [PATCH v2] xen/arm64/atomic: Clear exclusive monitor on cmpxchg failure


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: ryoj <okamoto@xxxxxxxxxxxxx>
  • Date: Fri, 11 Sep 2026 17:42:28 +0900
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VPJ5QY+3kppKZ4cOZLPHOJhBzEo2t1v/O8J4BX58dRs=; b=fyg9RcfBf5oFQAluszgqDmPUsn+h4MrZrewHUTtqgstpZ+8F8bu5pg1TBfFwQcx3EctHcKHZ+BLf5dM2ERbZgGNURBrAbebjUr70X/GuiRKhoFVYeqOLHxKKHdJGxchUpztHUdaEGYDyGEoQW4IxTmBy8ThuGioI+OmWv/NRUpEhCuFp0zKpXSBD4Q/1t9AtbfslJ1GbuR+77Pmeuqa7+38yBKlKNbv9vUz09LHLaHHxrU6bZdLKkkXiqdCxBS1n0cb6rADBi8X7GW4cUJhVVBADQywQY1DAkmlzJAXJbF4iU2wjJzsMbDVrmMx/An1Ig9W9OAbcpmfgxDGq06XzaA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YolJ/IqbHOHj6kUFJYbEhQq+UDnlOhn/HozNapF+i7PyWP3Brpr03VZMCF7Q/WnozE7VPvBhtlhgE0474z1tDm9f2h641o9UUDHzf0ddZ4UQBBV8TxQW4C983IgdOhm6qmbj/oDRH7hy+vTcVXGIj9Thob/7x9VDSqx3Hzg8I8vvO1N1KfonDGIOXdeFk/MWqOGally3UusHvZzOTPIeDWFz+hBDDpWH1Ly1hSHKNPZAJ8QJK4AfLFdF75R4KhujjHIs5Ruyb4xRE1VoVBuhk/DPIqPS8i1ddpbVNsUK2vBvmwBjAM7DQtr/XzuP8XN5cBkn6Qk+yGqMVOPdf0FGdg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 11 Sep 2026 08:42:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/9/26 15:31, Jan Beulich wrote:
On 09.09.2026 08:12, Ryoji Okamoto wrote:
When the value comparison fails in atomic_cmpxchg, the code branches
out without executing stxr, leaving the exclusive monitor in the
exclusive state set by ldxr.

Add `clrex` to the failure path to explicitly clear the exclusive
monitor.

Fixes: d2654a556835 ("xen: arm64: atomics")
Signed-off-by: Ryoji Okamoto <okamoto@xxxxxxxxxxxxx>
---
v2: Use tabs for indentation instead of spaces

Well, ...

--- a/xen/arch/arm/include/asm/arm64/atomic.h
+++ b/xen/arch/arm/include/asm/arm64/atomic.h
@@ -118,7 +118,9 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int 
new)
  "        b.ne    2f\n"
  "        stxr    %w0, %w4, %2\n"
  "        cbnz    %w0, 1b\n"
-"2:"
+" b       3f\n"

... you now do here, but ...

+"2: clrex\n"

... still not here.

Jan

Hi Jan,

Thanks for the feedback on the indentation.
I'm withdrawing this patch, but I'll definitely keep this in mind for the next time.

Regards,

--
Ryoji



 


Rackspace

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