Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4015381ybg; Fri, 25 Oct 2019 12:07:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVDBusQdS500Ei5usW4JZ+9aaowAaQclKwatLUk/aHi2qViMjO9hPXqlAJzzE3S4bWgFq2 X-Received: by 2002:a50:cbc2:: with SMTP id l2mr5821600edi.304.1572030450054; Fri, 25 Oct 2019 12:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572030450; cv=none; d=google.com; s=arc-20160816; b=Hb4Nkcu1X4hJ/5+t70fCqtD/XyQ9JyGWOEs1R1z7IcWp+MbAtsfq38k4kpnbG+7pnt PRn6EKzbAxZeD+3nmw/bLHWKuiYHuvEcEuK3gm/7uN0sStaEvCuaArrg8Pry/XJYSbxI orVR6jQY0MvD4k0QN7oBnugUgP3X7hs1Kxn0ZDFEJSvYFBspp+4snWsE815AWeveDlwJ o8I5lYNQ7lwG3rLxrWX10aX9I/vjyviUP95pMRW4k1XWLR60No+8lNyCbfIKNnyhrjDe qpNRqG01fMw/sLHS/gWY6GeOErzYD+1y5kVSMGEyvEgGyi4VSCPZJilDIxoMCrW5sgaF I1DA== 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=CCBYzRA3TQ/MO5fGj5J/eZY4Rv4mXze5U36tFtmrVE4=; b=0hlHY6Zfe2S26Rvf5/aHnPkmWqfsePiqBHLPW6Df/AJlmIGvFzVA9jSJ2addGihleu PjQjNUIGeRoKq7C/kIciEE49sv/Orsrjz9jJmpSGZv6YHb7HvSYptSprkhtO8wKtYlGv 7zkjgK/Uj1dyFm5Wag7nQ6ko5lA1j6v47aOdTrK+CEwOFbg8yJtCGNsspZVBT5cVWfJs thhH+zB5npIqsXLJDee91hzJobOiRCvuLmzExR3FX1D4pQsmxF7BSQvVj8516Klxgq8q RGFmpl2FZ3reidOTKMAb37T7aG+wFUTBtuaO+ewdLYgSAJkpboUgiYMiG4mtIl+/NGse RSXg== 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 c27si1763904ede.425.2019.10.25.12.07.04; Fri, 25 Oct 2019 12:07:30 -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 S1728834AbfJXVAD (ORCPT + 99 others); Thu, 24 Oct 2019 17:00:03 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:33958 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbfJXVAC (ORCPT ); Thu, 24 Oct 2019 17:00:02 -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 1iNkD7-0001Z3-Rp; Thu, 24 Oct 2019 22:59:58 +0200 Date: Thu, 24 Oct 2019 22:59:56 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: Josh Poimboeuf , LKML , X86 ML , Peter Zijlstra , Will Deacon , Paolo Bonzini , kvm list , linux-arch , Mike Rapoport , Miroslav Benes Subject: Re: [patch V2 07/17] x86/entry/64: Remove redundant interrupt disable In-Reply-To: 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 Thu, 24 Oct 2019, Thomas Gleixner wrote: > Whatever we decide it is, leaving it completely inconsistent is not a > solution at all. The options are: Actually there is also: 0) Always do unconditional trace_irqs_on(). But that does not allow to actually trace the real return flags state which might be useful to diagnose crap which results from user space CLI. > 1) Always do conditional tracing depending on the user_regs->eflags.IF > state. > > 2) #1 + warn once when syscalls and exceptions (except NMI/MCE) happen > and user_regs->eflags.IF is cleared. > > 3a) #2 + enforce signal handling to run with interrupts enabled. > > 3b) #2 + set regs->eflags.IF. So the state is always correct from the > kernel POV. Of course that changes existing behaviour, but its > changing undefined and inconsistent behaviour. > > 4) Let iopl(level) return -EPERM if level == 3. > > Yeah, I know it's not possible due to regressions (DPKD uses iopl(3)), > but TBH that'd be the sanest option of all. > > Of course the infinite wisdom of hardware designers tied IN, INS, OUT, > OUTS and CLI/STI together on IOPL so we cannot even distangle them in > any way. > > The only way out would be to actually use a full 8K sized I/O bitmap, > but that's a massive pain as it has to be copied on every context > switch. > > Really pretty options to chose from ... > > Thanks, > > tglx >