Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp942856pxf; Wed, 7 Apr 2021 15:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/wcy1scT4EzK28SxOjMUcBniSD5lVP57h3bTv6FwXSCmFOx/hqdoPNnoUnuX/kMPBWKIY X-Received: by 2002:a17:906:3609:: with SMTP id q9mr6562433ejb.119.1617835289620; Wed, 07 Apr 2021 15:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617835289; cv=none; d=google.com; s=arc-20160816; b=MLTiWTtNycVELmzymGpO5EU1aoHsA7Ti2ReIqNl4qp8waPMzHRKrELPLefkYHqdV0R gx0woAkwtSW9YsIHNKpFKBI97HYGGTAZX4KWTsc1LftFK09yTpS1HPWOqSOuSAXHUoJH XBkfeps1CwaxpuzXWUWDl3J0w4cLljWRX5DTJzQr9/JwlIqcmnqeVemUfK6J9jvwaLjC p3eLo+3ZGsWDYle7R+oKtEyiHk2RexyYUzGuvI16AncjdBE+iDRAus4MakkHCSrAH3dU Uwn4eefJOfhinQcMf4e+P2tXArcqtfZz5xSuFdbbXOCYjVL/cdIvoAtkWok00jdOgryu i35g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mSYkryVWY5Pr3drPpv2NaUgq5R5L6jkNcEwAJTVD9CE=; b=wsmraRTe7r6266rLQUFmHJvM2S+zOL4BccVJC9HWgsjpoB7ibBVRrGFczyON9On8Zo WoF5rhBg/ejunCOwDxwLKTsMgRA69ed96MFlHZKeuvw+Y8ke5N60QahNKW3VhQwO4uUd ZIW4eDENtvlrkX2cjaVrTkuA3KyurRomT7MNRY85dDHR6TkyEwpYJC8IL0HhHmg3sxpP grWJ/nv9cVNjPk/bgigxDVKlxmkcOhhiEomN1RCnZZW1CBu7p9hItTZCuESZOmWGqcGO vIsnGbDBmiLjoKR8i480kpGTTY17yVKW1oPz4htanVVxEiCfT6SN4MO1F8UAIMQHrVeP JMjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=oBpo3Lmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi22si20859886edb.191.2021.04.07.15.41.05; Wed, 07 Apr 2021 15:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=oBpo3Lmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245588AbhDGQpB (ORCPT + 99 others); Wed, 7 Apr 2021 12:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbhDGQo6 (ORCPT ); Wed, 7 Apr 2021 12:44:58 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32560C061756; Wed, 7 Apr 2021 09:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=mSYkryVWY5Pr3drPpv2NaUgq5R5L6jkNcEwAJTVD9CE=; b=oBpo3LmmrylkwRvCPEuDqy0siY w6Vblo1PfrEZIOt1E6+WTUXuQFJke1qgC5BHuVW41/nyqUA2PszrAAvgoZrPSOJTaa/k9jzkkvlxX Yt3hLk/VrDJpfN3knC60fZIz8ODcsUQqtf1/3mBMds2HhQsk5pmsA6domWSd49QLvLIQo92h7Zcsg /+vQyaO4JP158BN/RlvD3p9JXSkaii3fYllmW8zSRcyBjbkek9iH+7lUIXJ7mjzRLBlU6T1zOz5HK EZydhVSVQNaYd2Bd7oAxxSRGHldVKXzg+8/cXvmIhUYr26mJ85htTlJLEs3Dc9ZLizVRHQaTlhXKR VuFPI0VQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lUBIB-005V5Q-Qu; Wed, 07 Apr 2021 16:44:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B5C40300331; Wed, 7 Apr 2021 18:44:34 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9EEA423D3AF86; Wed, 7 Apr 2021 18:44:34 +0200 (CEST) Date: Wed, 7 Apr 2021 18:44:34 +0200 From: Peter Zijlstra To: Christoph =?iso-8859-1?Q?M=FCllner?= Cc: Christoph Hellwig , Guo Ren , linux-riscv , Linux Kernel Mailing List , linux-csky@vger.kernel.org, linux-arch , Guo Ren , Will Deacon , Ingo Molnar , Waiman Long , Arnd Bergmann , Anup Patel Subject: Re: [PATCH v4 3/4] locking/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32 Message-ID: References: <20210407094224.GA3393992@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 07, 2021 at 05:51:07PM +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 04:29:12PM +0200, Christoph M?llner wrote: > > Further, it is not the case that RISC-V has no guarantees at all. > > It just does not provide a forward progress guarantee for a > > synchronization implementation, > > that writes in an endless loop to a memory location while trying to > > complete an LL/SC > > loop on the same memory location at the same time. > > Userspace can DoS the kernel that way, see futex. The longer answer is that this means you cannot share locks (or any atomic really) across a trust boundary, which is of course exactly what futex does.