From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC5DC433EF for ; Tue, 7 Sep 2021 14:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B16AF610E9 for ; Tue, 7 Sep 2021 14:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240383AbhIGOjn (ORCPT ); Tue, 7 Sep 2021 10:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbhIGOjm (ORCPT ); Tue, 7 Sep 2021 10:39:42 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E60C061575 for ; Tue, 7 Sep 2021 07:38:36 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id x19so8333989pfu.4 for ; Tue, 07 Sep 2021 07:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=dDM249O1jyYEP+sPZcNiaaYYByaEMpzFEK/dirlDIZo1llr4qtiA9AwONG4gfWFxuh GI+LHZeQL/xeGEQ7Yfkgt3/vvEePqhDwrmKdVjtWDvjOavLauOARfD2emyCkCFDIZ3e5 RZJODDFiVIiw9T1gza4f7jn3IWawg1iNUGGJLjWdnuO+yJ9asXLrHQr2+tGWyM13pjym 1+byStjxJrGiqSwx/wJlrs7mmw75bxC4tAQmD1XUWS2Kmf6OB7eQm5ViyURea6XHmtW+ mck5xXQNXvsw8NgSA/A4XmTbdZUQ2dwVHhPiE7RfQH0O5+QpGIXptx+UdEU6zgDpgmg+ vWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=eNhl1Iuepc8WIEqFxj/jP5cNHABlkfPLiIiCRG8Amqs6MadrcWr8cECzPVAKvu7jcu 2UGI+pT+X2k9Sx/D74mW+edRLTda+/J5KiGtU42PaHl5/sKpd/UpA1DyGCTh99OFaoXF eWvn3XdpEKNRSIEcjikGedYrMt2gl82xnMBm2AUvVQ11B3nb0DYsJu5Zc/zwuFM2/0XI SJ+C7sm4zbUg2TkB7XHs9XNj6Tpt7r5Eq+FPyjVyJlwatW0WTHt1IcQzt9zVDG2v9UlS Y1pkeZWjZTrhfBmT7e5yL31wjf0NktcQyZFU6HW8LhhTVoiMaNu9UvLxqED+3yIa6jA/ 0mbA== X-Gm-Message-State: AOAM532v8WXpCoZww/p8qLUu8iuKXSwZuchqoXF1ucsUSgo7mPtODoES Sb0DjvbCKE3XNBdIKUzjy1sEEQ== X-Google-Smtp-Source: ABdhPJzl5tT+vIOlvAuqK2CqdOtw1QALWHjYejAcBedH1JDRDyFV2NrE6Q9L+J99MDm/UGDNVHbaHA== X-Received: by 2002:a63:c10b:: with SMTP id w11mr17484810pgf.228.1631025516087; Tue, 07 Sep 2021 07:38:36 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id j6sm13428682pgq.0.2021.09.07.07.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 07:38:35 -0700 (PDT) Date: Tue, 7 Sep 2021 14:38:31 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Mathieu Desnoyers , "Russell King, ARM Linux" , Catalin Marinas , Will Deacon , Guo Ren , Thomas Bogendoerfer , Michael Ellerman , Heiko Carstens , gor , Christian Borntraeger , Oleg Nesterov , rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Andy Lutomirski , paulmck , Boqun Feng , shuah , Benjamin Herrenschmidt , Paul Mackerras , linux-arm-kernel , linux-kernel , linux-csky , linux-mips , linuxppc-dev , linux-s390 , KVM list , linux-kselftest , Peter Foley , Shakeel Butt , Ben Gardon Subject: Re: [PATCH 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest Message-ID: References: <20210818001210.4073390-1-seanjc@google.com> <20210818001210.4073390-2-seanjc@google.com> <1673583543.19718.1629409152244.JavaMail.zimbra@efficios.com> <1872633041.20290.1629485463253.JavaMail.zimbra@efficios.com> <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On Mon, Sep 06, 2021, Paolo Bonzini wrote: > On 20/08/21 20:51, Mathieu Desnoyers wrote: > > > Ah, or is it the case that rseq_cs is non-NULL if and only if userspace is in an > > > rseq critical section, and because syscalls in critical sections are illegal, by > > > definition clearing rseq_cs is a nop unless userspace is misbehaving. > > Not quite, as I described above. But we want it to stay set so the CONFIG_DEBUG_RSEQ > > code executed when returning from ioctl to userspace will be able to validate that > > it is not nested within a rseq critical section. > > > > > If that's true, what about explicitly checking that at NOTIFY_RESUME? Or is it > > > not worth the extra code to detect an error that will likely be caught anyways? > > The error will indeed already be caught on return from ioctl to userspace, so I > > don't see any added value in duplicating this check. > > Sean, can you send a v2 (even for this patch only would be okay)? Made it all the way to v3 while you were out :-) https://lkml.kernel.org/r/20210901203030.1292304-1-seanjc@google.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C854C433F5 for ; Tue, 7 Sep 2021 14:39:27 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C500B61102 for ; Tue, 7 Sep 2021 14:39:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C500B61102 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4H3nwF0sg5z2ybL for ; Wed, 8 Sep 2021 00:39:25 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=dDM249O1; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::435; helo=mail-pf1-x435.google.com; envelope-from=seanjc@google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=dDM249O1; dkim-atps=neutral Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4H3nvR255Jz2xfn for ; Wed, 8 Sep 2021 00:38:40 +1000 (AEST) Received: by mail-pf1-x435.google.com with SMTP id y17so8304593pfl.13 for ; Tue, 07 Sep 2021 07:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=dDM249O1jyYEP+sPZcNiaaYYByaEMpzFEK/dirlDIZo1llr4qtiA9AwONG4gfWFxuh GI+LHZeQL/xeGEQ7Yfkgt3/vvEePqhDwrmKdVjtWDvjOavLauOARfD2emyCkCFDIZ3e5 RZJODDFiVIiw9T1gza4f7jn3IWawg1iNUGGJLjWdnuO+yJ9asXLrHQr2+tGWyM13pjym 1+byStjxJrGiqSwx/wJlrs7mmw75bxC4tAQmD1XUWS2Kmf6OB7eQm5ViyURea6XHmtW+ mck5xXQNXvsw8NgSA/A4XmTbdZUQ2dwVHhPiE7RfQH0O5+QpGIXptx+UdEU6zgDpgmg+ vWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=t+WkEE0IJt70aKWfeNH0/hQVktHQ7uLk278new1uToUo0xykFb/tRcq2tvAIoKy879 DeOpPbFTCabeF3OtLpNyjCTy/sIW17+L+QZdbheq6NJzD9cwLPEtoHHX4nvzZ8OcaEvX cZoQMxfsvyHH/pUnKbjC5LReOwRSs7Rt1NBoNMAdKcu9e0FnPd3uDlYCroey8hWIZF9M fHIaHds1DTFnhfgqBRcnq2eGFzfGxE35iRxM9WabltrqY+sIIXgHHam70bOavJTZpXKb BzxqZK9wtpNEyHgmoF3g6DuQKPHWdZZevm61za4UvcSyjufgDX8CLQiOO9T2NBl62jkb stoA== X-Gm-Message-State: AOAM531j6ZLaC2K88xWvkWbqhnGgH9DMEBFP1NWFwnkSeGqvt/gT2WVL XtGcCA2TyDPhCIsGzHD4OJDOwg== X-Google-Smtp-Source: ABdhPJzl5tT+vIOlvAuqK2CqdOtw1QALWHjYejAcBedH1JDRDyFV2NrE6Q9L+J99MDm/UGDNVHbaHA== X-Received: by 2002:a63:c10b:: with SMTP id w11mr17484810pgf.228.1631025516087; Tue, 07 Sep 2021 07:38:36 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id j6sm13428682pgq.0.2021.09.07.07.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 07:38:35 -0700 (PDT) Date: Tue, 7 Sep 2021 14:38:31 +0000 From: Sean Christopherson To: Paolo Bonzini Subject: Re: [PATCH 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest Message-ID: References: <20210818001210.4073390-1-seanjc@google.com> <20210818001210.4073390-2-seanjc@google.com> <1673583543.19718.1629409152244.JavaMail.zimbra@efficios.com> <1872633041.20290.1629485463253.JavaMail.zimbra@efficios.com> <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: KVM list , Peter Zijlstra , linux-kernel , Will Deacon , Guo Ren , linux-kselftest , Ben Gardon , shuah , linux-s390 , Shakeel Butt , gor , "Russell King, ARM Linux" , linux-csky , Christian Borntraeger , Ingo Molnar , Catalin Marinas , linux-mips , Boqun Feng , paulmck , Heiko Carstens , rostedt , Mathieu Desnoyers , Andy Lutomirski , Thomas Gleixner , Peter Foley , linux-arm-kernel , Thomas Bogendoerfer , Oleg Nesterov , Paul Mackerras , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Sep 06, 2021, Paolo Bonzini wrote: > On 20/08/21 20:51, Mathieu Desnoyers wrote: > > > Ah, or is it the case that rseq_cs is non-NULL if and only if userspace is in an > > > rseq critical section, and because syscalls in critical sections are illegal, by > > > definition clearing rseq_cs is a nop unless userspace is misbehaving. > > Not quite, as I described above. But we want it to stay set so the CONFIG_DEBUG_RSEQ > > code executed when returning from ioctl to userspace will be able to validate that > > it is not nested within a rseq critical section. > > > > > If that's true, what about explicitly checking that at NOTIFY_RESUME? Or is it > > > not worth the extra code to detect an error that will likely be caught anyways? > > The error will indeed already be caught on return from ioctl to userspace, so I > > don't see any added value in duplicating this check. > > Sean, can you send a v2 (even for this patch only would be okay)? Made it all the way to v3 while you were out :-) https://lkml.kernel.org/r/20210901203030.1292304-1-seanjc@google.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D13CC433F5 for ; Tue, 7 Sep 2021 14:40:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3FD8610FE for ; Tue, 7 Sep 2021 14:40:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3FD8610FE Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aDdebOE6pfizjucSYVZ058a2gdr4tfgXaFeGe2tsqtQ=; b=SxoNNngTpm5Khw GtoBPP4m6nsdOHIJhrCk6w7zs5N0kMa8zksLc0Chz+XUqfw+ZuiLQJFGhn+h9JBRKRlJLn564gEBg a+GS2WOUd7zZ7tfqOUQoy/R3eWIJ9y3WVFCIP2Lky+B/QjOOMakzuRveA7Ub+w57sVg4mzlMEIKGK +Mer5Rg/yEBtByyYGLbE1VBtt0x5wkw7dgazAGHvMaDcrN+aEE+yvhRoUmU9AwUcmrMmBlSng7MaY zf+dTxEhFoQGGLVOhjI403kTE+fZrumg8Hl/Tlq1xHT2z/w/z9PlRkqvsl4cGHin1jRJe6zbzpn7o /ePLjkH4CGxGzK8dMm0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNcFK-003tgB-Mz; Tue, 07 Sep 2021 14:38:46 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNcFG-003teW-SU for linux-arm-kernel@lists.infradead.org; Tue, 07 Sep 2021 14:38:44 +0000 Received: by mail-pf1-x432.google.com with SMTP id e16so8331206pfc.6 for ; Tue, 07 Sep 2021 07:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=dDM249O1jyYEP+sPZcNiaaYYByaEMpzFEK/dirlDIZo1llr4qtiA9AwONG4gfWFxuh GI+LHZeQL/xeGEQ7Yfkgt3/vvEePqhDwrmKdVjtWDvjOavLauOARfD2emyCkCFDIZ3e5 RZJODDFiVIiw9T1gza4f7jn3IWawg1iNUGGJLjWdnuO+yJ9asXLrHQr2+tGWyM13pjym 1+byStjxJrGiqSwx/wJlrs7mmw75bxC4tAQmD1XUWS2Kmf6OB7eQm5ViyURea6XHmtW+ mck5xXQNXvsw8NgSA/A4XmTbdZUQ2dwVHhPiE7RfQH0O5+QpGIXptx+UdEU6zgDpgmg+ vWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qhhCof7Bxt7WkPbfZU7ElxFgFbYJKUpmBYIoqT3FQG0=; b=PxH8ht/IJOY5zpiDvS5VzZVVaM8v/wUcIeYhlg/hZWza1a6UiiN4q1jQsgxlllklVo /YgljyD0XjvnKpwy1PkfauostZejtooB3srLepeL5mze/wCPobdfblN4QvDsQPZJ4Oo2 uU0iC90MEl9teRX0qiF0Jvv0Cu6uhvKrbEIdjpbQxNq6zPNsOkOIHC9FB4yGXU6TNXJA 3t8XG22l7vDv0cWmNGUTOeB2IaVP1oPFGpr45MXtP1EBP0rbYpUPJYFuq/0+a15FYIfr B7ZOmXk2MnbjH+vh+GNKYg4TTO8uL9DHNFd0R+NSii79MaST+ORbspL+rvOvDh6cJsex pjPQ== X-Gm-Message-State: AOAM533QB0ujwdcEHA1bNxEXOII3p0k+frOTIA/uD/jZHjVsuE10fIXy W3bVc0x9ypVeU9jpZQ1cGaAUDg== X-Google-Smtp-Source: ABdhPJzl5tT+vIOlvAuqK2CqdOtw1QALWHjYejAcBedH1JDRDyFV2NrE6Q9L+J99MDm/UGDNVHbaHA== X-Received: by 2002:a63:c10b:: with SMTP id w11mr17484810pgf.228.1631025516087; Tue, 07 Sep 2021 07:38:36 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id j6sm13428682pgq.0.2021.09.07.07.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 07:38:35 -0700 (PDT) Date: Tue, 7 Sep 2021 14:38:31 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Mathieu Desnoyers , "Russell King, ARM Linux" , Catalin Marinas , Will Deacon , Guo Ren , Thomas Bogendoerfer , Michael Ellerman , Heiko Carstens , gor , Christian Borntraeger , Oleg Nesterov , rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Andy Lutomirski , paulmck , Boqun Feng , shuah , Benjamin Herrenschmidt , Paul Mackerras , linux-arm-kernel , linux-kernel , linux-csky , linux-mips , linuxppc-dev , linux-s390 , KVM list , linux-kselftest , Peter Foley , Shakeel Butt , Ben Gardon Subject: Re: [PATCH 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest Message-ID: References: <20210818001210.4073390-1-seanjc@google.com> <20210818001210.4073390-2-seanjc@google.com> <1673583543.19718.1629409152244.JavaMail.zimbra@efficios.com> <1872633041.20290.1629485463253.JavaMail.zimbra@efficios.com> <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <425456d3-4772-2a1b-9cf3-a5b750b95c2e@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210907_073842_972963_E77E88EE X-CRM114-Status: GOOD ( 21.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 06, 2021, Paolo Bonzini wrote: > On 20/08/21 20:51, Mathieu Desnoyers wrote: > > > Ah, or is it the case that rseq_cs is non-NULL if and only if userspace is in an > > > rseq critical section, and because syscalls in critical sections are illegal, by > > > definition clearing rseq_cs is a nop unless userspace is misbehaving. > > Not quite, as I described above. But we want it to stay set so the CONFIG_DEBUG_RSEQ > > code executed when returning from ioctl to userspace will be able to validate that > > it is not nested within a rseq critical section. > > > > > If that's true, what about explicitly checking that at NOTIFY_RESUME? Or is it > > > not worth the extra code to detect an error that will likely be caught anyways? > > The error will indeed already be caught on return from ioctl to userspace, so I > > don't see any added value in duplicating this check. > > Sean, can you send a v2 (even for this patch only would be okay)? Made it all the way to v3 while you were out :-) https://lkml.kernel.org/r/20210901203030.1292304-1-seanjc@google.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel