Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7479909ybi; Thu, 1 Aug 2019 08:48:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnUIIbesbl4LnBYQw7TCD967esefiRwEawvY1++Aw7eimQsEiNHwFOJXHspGsM2a6O+11U X-Received: by 2002:a17:90a:270f:: with SMTP id o15mr9496534pje.56.1564674495773; Thu, 01 Aug 2019 08:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564674495; cv=none; d=google.com; s=arc-20160816; b=R703VfsCeeI45ppaf+am73pqQTJ07S/5oEk2UqSJqGGdBjRl0ReldbbAHEbJTkY89z iccSRDPAk2HgAdU5ugh/Ch3887J2tjnRX6pgGJsTLFZw0fA/sovjVfmlznoedDMaJoDW n6tf7dy4Rfdacc3T2PwRQFSoSJJosVErgVQ4CGGNyvaUMI20+ftAooHwq3U0Bf5srKQ/ oWDidaXxsFU5HLWmWjDh7kmJB2lFcfE5tnJeRYCsh+lssBm9hrwy7SsO4QXjGpaJey0a l/CH7cH5/y2SQG7sf+s42xF8EicLG6NJGM0KQjb7Pd1SX8Td6CIP2rumfiMFhfQYKpMy 5I5A== 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:references :message-id:in-reply-to:subject:cc:to:from:date; bh=9cKCsKSmYi6hf7sFY0sVFzR9Fmqg4FoHHVGS2Jqs7ek=; b=Jjb6iKyw/V/J6SFTt9uS0doQhca1oqQYmVPND1Dc2lAe0T88ra6graDvMToV9sYkvW wi7VWG30gdBDBHB0Yea3StyiAMrLz6qM27BIsimx/cWq4hJee1sk2j5pOGjUuOyo9aiA ZWFtBS20DBFYKWoJW3ZmDBAaEM/+cdzWzmqCUI5y/EECz8ga+LgI24e8jJtC7Wi/2i7I ecb4Xm4ub2qmx4gh4dF81IlKycOv2SH0vfCglkT4m8FuIdEZJtIImNmsln44vyHDA8JK sas3eEvvz/uG7qLyxqp654Nq/Vccqjya1BcSjx0oLXcrcBwomxKRa9lNEXR1jY3o5vkr 8DPg== 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 x185si37464454pgb.161.2019.08.01.08.48.00; Thu, 01 Aug 2019 08:48:15 -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 S1731573AbfHAPK6 (ORCPT + 99 others); Thu, 1 Aug 2019 11:10:58 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:36395 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbfHAPK6 (ORCPT ); Thu, 1 Aug 2019 11:10:58 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1htCiy-0001mx-3A; Thu, 01 Aug 2019 17:10:36 +0200 Date: Thu, 1 Aug 2019 17:10:35 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: LKML , x86@kernel.org, Ingo Molnar , Sebastian Siewior , Anna-Maria Gleixner , Steven Rostedt , Julia Cartwright , Paul McKenney , Frederic Weisbecker , Oleg Nesterov , kvm@vger.kernel.org, Radim Krcmar , Paolo Bonzini , John Stultz , Andy Lutomirski , "Paul E. McKenney" Subject: Re: [patch 1/5] tracehook: Provide TIF_NOTIFY_RESUME handling for KVM In-Reply-To: <20190801144814.GC31398@hirez.programming.kicks-ass.net> Message-ID: References: <20190801143250.370326052@linutronix.de> <20190801143657.785902257@linutronix.de> <20190801144814.GC31398@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Aug 2019, Peter Zijlstra wrote: > On Thu, Aug 01, 2019 at 04:32:51PM +0200, Thomas Gleixner wrote: > > +#ifdef CONFIG_HAVE_ARCH_TRACEHOOK > > +/** > > + * tracehook_handle_notify_resume - Notify resume handling for virt > > + * > > + * Called with interrupts and preemption enabled from VMENTER/EXIT. > > + */ > > +void tracehook_handle_notify_resume(void) > > +{ > > + local_irq_disable(); > > + while (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) { > > + local_irq_enable(); > > + tracehook_notify_resume(NULL); > > + local_irq_disable(); > > + } > > + local_irq_enable(); > > I'm confused by the IRQ state swizzling here, what is it doing? Hmm, right. It's not really needed. Modeled it after the user space return code, but the KVM case is different because it evaluates the TIF bit again before entering the VM with interrupts disabled anyway. I'll remove the brainfart in V2. Thanks, tglx