Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp252957ybf; Wed, 26 Feb 2020 12:26:20 -0800 (PST) X-Google-Smtp-Source: APXvYqw38jT2EZhGEzEha2KcyQD2al2ORxLRA7coCbP81OWwWklWaK1zCWEdDnZHn91/3Z+XtcrS X-Received: by 2002:a9d:1706:: with SMTP id i6mr460651ota.151.1582748780361; Wed, 26 Feb 2020 12:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582748780; cv=none; d=google.com; s=arc-20160816; b=frG0JFPiFbGbidxsdp1eF3RHit7nIXyOFoiebu8Zx2bkWxUle/m3pAxGeSCPLaaD8G iYGkHgI0dZpwJEsHTlqzZxHx4mrk28onGnnXlsPmjGOYduIxuUUn+WMXx8JJjdAcNxKl RgtbUwBpJ4POT3XTgxD0LSQcYr8+NorRtL0bRJ+bfLKvvJtpY1oYLC6u4fpiuNzrBaIe 4ijZ7+m/k0FijnQ4D9EdWboXmGMlCRJEVpMKE3DRIAGRb1Qe2jd9qgzayHnG0Y6oPA2D bzHtzZ2Z5QcJsCNmM0fNDmLl1P/T/M9V+rHH/7s0A1frq54bpcdv6bJPM2MUE9IjNoyX JO9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=ydJ+yZEZtHpuVutJm8tPRqXuL1IdSUxaJFCLMkFFgz0=; b=YLW/D6ev3mxm9LCrF03Zr9CUtA3njHqreF9UyxYy93G5ymdsDIpUMFSk87w/vaXn8/ q11ycuu0ksfOKN/EOCNQ3/r2trWRkSWb8Ogf3B7rocV+nKsSiDJlNwJF+zYI7rK8YSae c6197/OLcwBYBVPo4z/HHKD2nL2l+/5tngTwjkax3N7CWrOMgUVehQIOEQI9arAJmhZ4 NW+G4GI55SUAv91Eid2w3vEB6eXcglZwg0ONF5RcwmYMmY7+3cgNYMs5VRgaewDgc44z JAKPANbEVO9DKT+UBtV4AoUSLEZuWk5MRDNPyxeDnJLL/xX8dtPLd5SyWquOTAZvMHrb YsOg== 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 a19si66243oia.142.2020.02.26.12.26.08; Wed, 26 Feb 2020 12:26:20 -0800 (PST) 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 S1727448AbgBZUZk convert rfc822-to-8bit (ORCPT + 99 others); Wed, 26 Feb 2020 15:25:40 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:59565 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727260AbgBZUZk (ORCPT ); Wed, 26 Feb 2020 15:25:40 -0500 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] 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 1j73FF-0005pG-O5; Wed, 26 Feb 2020 21:25:25 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 36C5A104099; Wed, 26 Feb 2020 21:25:25 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski , Peter Zijlstra Cc: LKML , X86 ML , Steven Rostedt , Brian Gerst , Juergen Gross , Paolo Bonzini , Arnd Bergmann Subject: Re: [patch 13/16] x86/entry: Move irqflags and context tracking to C for simple idtentries In-Reply-To: References: <20200226162811.GA18400@hirez.programming.kicks-ass.net> Date: Wed, 26 Feb 2020 21:25:25 +0100 Message-ID: <87blplp03u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT 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 Andy Lutomirski writes: >> On Feb 26, 2020, at 8:28 AM, Peter Zijlstra wrote: >> >> On Wed, Feb 26, 2020 at 07:11:39AM -0800, Andy Lutomirski wrote: >> >>> In some sense, this is a weakness of the magic macro approach. Some >>> of the entries just want to have code that runs before all the entry >>> fixups. This is an example of it. So are the cr2 reads. It can all >>> be made to work, but it's a bit gross. >> >> Right. In my current pile (new patche since last posting) I also have >> one that makes #DB save-clear/restore DR7. >> >> I got it early enough that only a watchpoint on the task stack can still >> screw us over, since I also included your patch that excludes >> cpu_entry_area. > > Hmm. It would be nice to prevent watchpoints on the task stack, but that would need some trickery. It could be done. > >> >> Pushing it earlier still would require calling into C from the entry >> stack, which I know is on your todo list, but we're not quite there yet. > > Indeed. > > This is my main objection to the DEFINE_IDTENTRY stuff. It’s *great* > for the easy cases, but it’s not so great for the nasty cases. Maybe > we should open code PF, MC, DB, etc. (And kill the kvm special case > for PF. I have a working patch for that and I can send it.) I'm fine with that. I like the obvious easy ones as it spares to duplicate all the same crap all over the place. Making the nasty ones have: #define DEFINE_IDTENTRY_$NASTY(exc_name) \ __visible void notrace exc_name(args....) would solve this and you can stick whatever you want into it and have the NOPROBE added manually. Hmm? Thanks, tglx