From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2NTj-0002B4-SL for qemu-devel@nongnu.org; Thu, 03 Nov 2016 15:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2NTf-0005Wh-RV for qemu-devel@nongnu.org; Thu, 03 Nov 2016 15:15:11 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2NTf-0005Vg-MG for qemu-devel@nongnu.org; Thu, 03 Nov 2016 15:15:07 -0400 Received: by mail-oi0-x243.google.com with SMTP id 128so8345758oih.3 for ; Thu, 03 Nov 2016 12:15:07 -0700 (PDT) Sender: Richard Henderson References: <1478182068-14082-1-git-send-email-laurent@vivier.eu> <06f03abb-3a18-12c3-b359-dcdc0aaeabfe@redhat.com> <32960507-f61e-e3a1-76f3-74a755adb7e3@vivier.eu> <3d88d6c0-6730-0db4-c109-a33b9165fb00@redhat.com> From: Richard Henderson Message-ID: <31e426f8-56a3-e4ea-ac55-36848cffeea9@twiddle.net> Date: Thu, 3 Nov 2016 13:15:03 -0600 MIME-Version: 1.0 In-Reply-To: <3d88d6c0-6730-0db4-c109-a33b9165fb00@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] target-sh4: add atomic tas List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Laurent Vivier , Aurelien Jarno , John Paul Adrian Glaubitz Cc: qemu-devel@nongnu.org On 11/03/2016 11:52 AM, Paolo Bonzini wrote: > UP kernel = no sane way to implement this in user-mode qemu? Probably no straight-forward way, no. > Another possibility is to treat the load as a LL and the store as a SC > (implemented in turn with cmpxchg+branch if it fails). cmpxchg spans > two basic blocks, so maybe one also needs to look at r0 and sp in > cpu_get_tb_cpu_state... Yeah, that's a possibility. With the store-conditional failure auto-branching back to the start of the sequence (r0+sp). > Anyhow this patch seems like a bugfix. Absolutely. r~