Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8561389ybi; Thu, 6 Jun 2019 14:47:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkQsWuRs0sSP8ZzfFrqYasWQl9LFq+c6gMQ5TwQogxhdOAEOo4fWstPUVByBDX54h4y5UA X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr52262879plb.240.1559857624760; Thu, 06 Jun 2019 14:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559857624; cv=none; d=google.com; s=arc-20160816; b=Z+nRYqEayl8cn13VgtjprUE5iBTZwfizMjOm328mqd1bU0yh/wpvAC6eHruSWqkNnL WaKcpK+Bcxw6+ySzqlQS0pwnMYNVNbZIgQSDfoqfwMIwPeQz/n18NCbnUulzDmWrMLV4 OynjGFhSUctJ4cGmJhdOOUH4tDyc2RdRW3jdIMFYlw5pXBiW5Ei38ggpypnfB1K+JQ9F OnQZWgL1nUN4+Nm6Eie7JYoPryiFUrUH13WXyx51F09BBQMk7xZuJs5XgVeQZrIavUTE CbFMBgeiv4ALoVzVWeMIJf/CFyUVU6wWWxj3K5ogfvKMuCU33RfSlnL7Fl0+vpozEU5T hIVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=rVoXJyyXjMOtsoWJB3P8hqoT05J4kvftp0fV2miKyp4=; b=QecjHABHo3wsElq4u4YlDTSzNnwAxrLmU2VinTQiMcOck5ch/+FeLwnycLwmKJtv3G SsUJB71zZsnX1WI92ex4XoVUJ3ZxKzfBJnDQVLvrVD01D6mk3zLPWnpW561SYvetqQgt HIWJKG6c5QgACjT4sSVwJzeehOlJXC0uj9vEt745j0VfHEKpyI8hEhUJ11VUAOGWOMnD KcVy/rH+YxcAr+7hiwJ79SgwdcvhPLptzPzFK4jHRZi6pC0KIxEz7IskwqNFQn/taaq4 AGCkyRp9U/stJ3dA0RKxbKuzV4LA3vI0Di2pSdcuaMMZKIyXu/snv/GwfCUQj61MedG0 lnOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si185299pgv.398.2019.06.06.14.46.47; Thu, 06 Jun 2019 14:47:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbfFFTcG (ORCPT + 99 others); Thu, 6 Jun 2019 15:32:06 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:45330 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFFTcG (ORCPT ); Thu, 6 Jun 2019 15:32:06 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45KbQB6Vflz1rGhn; Thu, 6 Jun 2019 21:32:02 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45KbQB5ZB2z1rBHD; Thu, 6 Jun 2019 21:32:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Get6cdg5GTJE; Thu, 6 Jun 2019 21:32:01 +0200 (CEST) X-Auth-Info: wsLBElmpFEcCcJ6QVDMufRpEZQC5tFsi61TyY8+ncdmH3bKTG/HRIv08aWCl0Q99 Received: from igel.home (ppp-46-244-173-53.dynamic.mnet-online.de [46.244.173.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 6 Jun 2019 21:32:01 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 1ABFB2C1E61; Thu, 6 Jun 2019 21:32:01 +0200 (CEST) From: Andreas Schwab To: Christoph Hellwig Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, Paul Walmsley , marco@decred.org, me@carlosedp.com, joel@sing.id.au, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RISC-V: Break load reservations during switch_to References: <20190605231735.26581-1-palmer@sifive.com> <20190606090518.GB1369@infradead.org> X-Yow: LOOK!! Sullen American teens wearing MADRAS shorts and ``Flock of Seagulls'' HAIRCUTS! Date: Thu, 06 Jun 2019 21:32:01 +0200 In-Reply-To: <20190606090518.GB1369@infradead.org> (Christoph Hellwig's message of "Thu, 6 Jun 2019 02:05:18 -0700") Message-ID: <87ftom4ij2.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Jun 06 2019, Christoph Hellwig wrote: > On Wed, Jun 05, 2019 at 04:17:35PM -0700, Palmer Dabbelt wrote: >> REG_S ra, TASK_THREAD_RA_RA(a3) >> + /* >> + * The Linux ABI allows programs to depend on load reservations being >> + * broken on context switches, but the ISA doesn't require that the >> + * hardware ever breaks a load reservation. The only way to break a >> + * load reservation is with a store conditional, so we emit one here. >> + * Since nothing ever takes a load reservation on TASK_THREAD_RA_RA we >> + * know this will always fail, but just to be on the safe side this >> + * writes the same value that was unconditionally written by the >> + * previous instruction. >> + */ >> +#if (TASK_THREAD_RA_RA != 0) > > I don't think this check works as intended. TASK_THREAD_RA_RA is a > parameterized macro, Is it? Just because it is used before an open paren doesn't mean that the macro takes a parameter. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."