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 B78BEC43217 for ; Tue, 7 Sep 2021 14:38:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A46A76113B for ; Tue, 7 Sep 2021 14:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244071AbhIGOjn (ORCPT ); Tue, 7 Sep 2021 10:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233978AbhIGOjm (ORCPT ); Tue, 7 Sep 2021 10:39:42 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B825DC061757 for ; Tue, 7 Sep 2021 07:38:36 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id g14so8332873pfm.1 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=U+bu1iTAiXICRiwxirA6jSxyLOFQKOUoQfNALzwffJVFKbKOUxqCc2uq1Mvq4yK1Ck RdyZkLPBhpHSaHcSCG/hKoGjQQZCxS/k26aZPtVMUBRqCai88IE5MZW8FBb0TD/9ehFF UfKUAPLdDCajyVbjzz66bnSoYlDy5M8nQLId9mMBGu9DhXJzoZn5sn51uMhHoSuZAuKY c349DeNODjlZcwJoF6yg8zlAMsmFhRWUGldcATNmXFgE+B5YPnYVZKkwIKPmQ7e93Y4k AM/X+3bJE3QDkY7GYUzRy+d9p2UHL7EQWvarJUDH6KKE9ZDan6Y/lXROn8tv1gyEf89I WkBg== X-Gm-Message-State: AOAM530RY5MOfb+HGi+VG7rH9U/tczp+4EnX0tWZYQPfcrqH9OgTSfLv fAqbxc1HPm6K6Kmc5swXN/VrFg== 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: kvm@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