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