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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 DB91FC433DF for ; Wed, 26 Aug 2020 17:47:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB80120737 for ; Wed, 26 Aug 2020 17:47:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GnYw3mSI"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IHc4jvpr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726940AbgHZRro (ORCPT ); Wed, 26 Aug 2020 13:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726838AbgHZRrm (ORCPT ); Wed, 26 Aug 2020 13:47:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C840C061574; Wed, 26 Aug 2020 10:47:42 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598464059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HX2HLBhi0wlAtyTIUgiN/1RIi5SlncWFJOMrq7y7hFY=; b=GnYw3mSIxtBphZBY5CJDgXoe4DxWv+jiAw2ZDTjRA6EFla8Z7Le2rllgfyJIwRFSVFC4Fi FuGUbb7E06pDhq8XeZBrRJDJWoz8jFqjhp8rvczAAU0V+N6MRcfK2DtLdZkD2H36RACoEq 2wtvL0P04c9Ha/Goxa96lPeHicM7oBK39M3UNGTLTQ+tlY6iscqgOpG6h5S5H9m8IVdPPa x/GOnu+in3B7de/4k2evOehYHhHgXewwG6bwCTjhHwyKI3NkYxmRZl0Z9UyTFb/ANM7lVl ci/Hn3VKGs7vx/3ddd4MZQL6d0dbJy7dh5So90cet8+ZR4uPcBgIqRcYTvJisg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598464059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HX2HLBhi0wlAtyTIUgiN/1RIi5SlncWFJOMrq7y7hFY=; b=IHc4jvprLTkzDK/iU1NAfc6TbfzG/pxd13owSiweS5f0L6e35whtCpEq4USngkoD265M8l bTnoDIr/gRAXXfCQ== To: Andy Lutomirski Cc: Alexander Graf , X86 ML , Andy Lutomirski , LKML , Andrew Cooper , "Paul E. McKenney" , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon , Tom Lendacky , Wei Liu , Michael Kelley , Jason Chen CJ , Zhao Yakui , "Peter Zijlstra \(Intel\)" , Avi Kivity , "Herrenschmidt\, Benjamin" , robketr@amazon.de, Amos Kong , Brian Gerst , stable Subject: Re: [PATCH] x86/irq: Preserve vector in orig_ax for APIC code In-Reply-To: References: <20200826115357.3049-1-graf@amazon.com> <87k0xlv5w5.fsf@nanos.tec.linutronix.de> Date: Wed, 26 Aug 2020 19:47:39 +0200 Message-ID: <87eentuwn8.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy, On Wed, Aug 26 2020 at 09:13, Andy Lutomirski wrote: > On Wed, Aug 26, 2020 at 7:27 AM Thomas Gleixner wrote: >> The below nasty hack cures it, but I hate it with a passion. I'll look >> deeper for a sane variant. >> > Fundamentally, the way we overload orig_ax is problematic. I have a > half-written series to improve it, but my series is broken. I think > it's fixable, though. > > First is this patch to use some __csh bits to indicate the entry type. > As far as I know, this patch is correct: > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/entry&id=dfff54208072a27909ae97ebce644c251a233ff2 Yes, that looks about right. > Then I wrote this incorrect patch: > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/entry&id=3a5087acb8a2cc1e88b1a55fa36c2f8bef370572 > > That one is wrong because the orig_ax wreckage seems to have leaked > into user ABI -- user programs think that orig_ax has certain > semantics on user-visible entries. Yes, orig_ax is pretty much user ABI for a very long time. > But I think that the problem in this thread could be fixed quite > nicely by the first patch, plus a new CS_ENTRY_IRQ and allocating > eight bits of __csh to store the vector. Then we could read out the > vector. That works. Alternatively I can just store the vector in the irq descriptor itself. That's trivial enough and can be done completely in C independent of the stuff above. Thanks, tglx