Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2036773ybg; Thu, 24 Oct 2019 03:56:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcd7EZ+p1WcDjq2aPPrS2O3kMPHWJQrrsBAbPU2Wmj/9tDfUDDfQ5SapaoBbseBn0qQ4RC X-Received: by 2002:a05:6402:154e:: with SMTP id p14mr746952edx.145.1571914614783; Thu, 24 Oct 2019 03:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571914614; cv=none; d=google.com; s=arc-20160816; b=lQDJ+n++A/jUGdqg9QDRQ6yj4W3mLiI0+ajPrRxoZqvQzzFunnP7bs5pLf8IKeUdil Gh6PNxEc0O4q+q+G6CcAsij+ar2p5Fz+FjuU0k6uD+/HwcHR9lkmg/IqL4B9JW0vxAbU sD6idq0EPIiYdmbo+5gyOTVwjoHRfjTznzHXsN5UtxqtKvNq4L5m0JOSDfeTtPKCfJb1 FIiHrmnFLHrbETVuCqGOxQ6pq/TsYVk702NWPYUrvBwfNekiPftH5XoSVHpYjLlC0rkS Xvn1kVC9Jju61XZhUfmGG1kOouPyiHlC7R/iqwPPt04SCIiSlgwXd6H2pf1GNCiPEAT0 DD7Q== 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=10Kzgf+JvRMXlFs0Bqffg1c0+dGhqro9/Or8v3E/lt8=; b=faQH1D9ta4hNnMXtAZdHHGLs/tFLpsw8IvTo1XsZrZTx1ZotFoC4sQFT9UipYKhr+n XgodcVYrLnYsn14qrt2YnAqgbpLK0O8/KAgEF6UUNrdy81qdHvrpjqlO6QGvqzr/BHlZ n0Hpc4dA8MVG8bI4RaA4Mogiv/e8iN4iHJon19C0ZPy9w6iEIkhr4HbqDCIsDt1H2UGi y+EZ5SZq8nvuBBe6kk/2pMcpKSM12dd+mka1r4on8mracB3Vpy7jm0yrhShQkcAj+V1H txo1/K34jWdjNZ+EIlN3b5ihpYmONar/ZbC4wPLD/7aIfqDy2GBdszPGcmWaBlsCWtH8 /vhQ== 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 f37si5830173ede.11.2019.10.24.03.56.30; Thu, 24 Oct 2019 03:56:54 -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 S2392801AbfJWXwk (ORCPT + 99 others); Wed, 23 Oct 2019 19:52:40 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51360 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389801AbfJWXwk (ORCPT ); Wed, 23 Oct 2019 19:52:40 -0400 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iNQQc-0002uz-NX; Thu, 24 Oct 2019 01:52:34 +0200 Date: Thu, 24 Oct 2019 01:52:33 +0200 (CEST) From: Thomas Gleixner To: Josh Poimboeuf cc: LKML , x86@kernel.org, Peter Zijlstra , Andy Lutomirski , Will Deacon , Paolo Bonzini , kvm@vger.kernel.org, linux-arch@vger.kernel.org, Mike Rapoport , Miroslav Benes Subject: Re: [patch V2 07/17] x86/entry/64: Remove redundant interrupt disable In-Reply-To: <20191023220618.qsmog2k5oaagj27v@treble> Message-ID: References: <20191023122705.198339581@linutronix.de> <20191023123118.296135499@linutronix.de> <20191023220618.qsmog2k5oaagj27v@treble> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Oct 2019, Josh Poimboeuf wrote: > On Wed, Oct 23, 2019 at 02:27:12PM +0200, Thomas Gleixner wrote: > > Now that the trap handlers return with interrupts disabled, the > > unconditional disabling of interrupts in the low level entry code can be > > removed along with the trace calls. > > > > Add debug checks where appropriate. > > This seems a little scary. Does anybody other than Andy actually run > with CONFIG_DEBUG_ENTRY? I do. > What happens if somebody accidentally leaves irqs enabled? How do we > know you found all the leaks? For the DO_ERROR() ones that's trivial: #define DO_ERROR(trapnr, signr, sicode, addr, str, name) \ dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \ { \ do_error_trap(regs, error_code, str, trapnr, signr, sicode, addr); \ + lockdep_assert_irqs_disabled(); \ } DO_ERROR(X86_TRAP_DE, SIGFPE, FPE_INTDIV, IP, "divide error", divide_error) Now for the rest we surely could do: dotraplinkage void do_bounds(struct pt_regs *regs, long error_code) { __do_bounds(regs, error_code); lockdep_assert_irqs_disabled(); } and move the existing body into a static function so independent of any (future) return path there the lockdep assert will be invoked. Thanks, tglx