Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp295910pxa; Wed, 26 Aug 2020 10:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrMY7R+nBRIH57HfIoGqfejQn9jD9W+VyFtkMgYwIpStrVqEwaibNdBltfmbIyo8Xuhok3 X-Received: by 2002:a05:6402:1295:: with SMTP id w21mr15351533edv.280.1598464135934; Wed, 26 Aug 2020 10:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598464135; cv=none; d=google.com; s=arc-20160816; b=w2WW8edlhPL+J10MLM25r1JMO1DtmNatQrxgAX4a3Kziz95vs+Ep9TC3ieXozQ30Bg WMs1xJUF9ThOOc2KawnkC0s5Zuh3BZeynP7UawEzKaFM1pl5b1yDXl1GxYX9KtVz7KHa P9Rwjskrsv+H7ooWRh4IFI/ZjudS7Yg70RyEnGAqbrm46kdbDJfksPI8y9Relle4Sier YuJlma5IjJCOWnEYvqNsPjPaksF9oceSSIAHBwNdcMWLQ2TBDjPNV93Izac7wsb6DD+Y 2HBxozqastgiXB9kNtAq62R+ehq52Csg1/K5ZN6B3NnHfLSioQb3hnleu8KBzeKgAOHo bOWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=HX2HLBhi0wlAtyTIUgiN/1RIi5SlncWFJOMrq7y7hFY=; b=0nCg4lZdbKKsDf8kvzquuNAX3qpLcLcV4fWQD9gLR4prP+mzXfWmL1gR47VqgOnHjW 9Mjl54JDFi7KLzqEMBb+KHTrptbuPg9AFJjTOu7jhWC3SkuCq9xUliHma0Renervort3 l4KjtMnLOVijnFu+vXPaQGV0HcS1X4HK8Tz57wgLmeefTu10ybTcceHcC1BwB8IHaowV QpMyxfB/Rt0VaQ6I7J9VHp+FyfQ+KnrvbKl7NFsIKcQS/LQK/pDEdDFHREO6/8jtMZin 9cmv/Oy0y945I6LIetkHne99unijGZy29aanTE9Zkz/vkV+6yAw6HSxMzyS3gubZcg4V SvPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GnYw3mSI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=IHc4jvpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si1778680eds.102.2020.08.26.10.48.32; Wed, 26 Aug 2020 10:48:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GnYw3mSI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=IHc4jvpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbgHZRro (ORCPT + 99 others); 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