Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp7898pxa; Wed, 26 Aug 2020 15:11:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcnFx1Y/ybOHjixF/P1ZH+NLeHbWgnxO81nqf07VcYGBajBZ8O8Fm5kioBbGb68YGXyCek X-Received: by 2002:a17:906:eb4f:: with SMTP id mc15mr17418428ejb.435.1598479910992; Wed, 26 Aug 2020 15:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598479910; cv=none; d=google.com; s=arc-20160816; b=ex6aZ392SAX6VDLMgIf1ibHfXwh33nhLRLrGiB0Gp/iJnQlzPiFBh91nWnm1IU90t8 +CIXIXPtW0VBKhkGiKIay34MFrZUvPlSSE7EfiOgg6Qucpz0r7J1/r3WMnGgDcWT1b4U ahX5sInd0MWiUjrn8TqAhGXskhYAi1ROcHNgbHNEbP56NsZC6X5bgXhvh7Rs1ny8xosd BwHhBXkGKa9KWU/w4QuImqgOCqqR6mfhuKSD5Y9N2Dmttm22yQT1ki1DXtPKIyd7E38D crHZV3tdBz3eyEfJqjKWyISe1itLv6QAhKxEAPiDP/M5P5hHIThgSGjFsYhrBrdzlmIM QDvQ== 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=4utsE2QnYLTwl7fFsiKLdj2uLDQ8VVZxXiuVQb2kEpw=; b=C5xbysdi6ei3Hdi49EHMcIhYLV4mMNTealIQA/Bb6XnYs+5Mgwwh2UdguxYUxtaZ7v dAA906tY4ZQILoOwIuEb50rhA11L/3sdPVDOfshdl6pmyddhnSHIT5/zp9d33rr3H8uV xmrFVsvWI7akbrRsEEj+WJeuk4GVE3+ipsRNTfkJ4A3jd3xq9zeJqhnM8nMR+JaI6lAT ocI0J+ZIyt9cVR/o+hiILmLb8MVCiOKy6PACrqtcIldQIPQvD6N08SlU0Gkrx++karB6 09g7Du/+6p6BEWwZ71n0i8grNKQwf5rBhK2XBUZuovTT8kVN6dARtPZ7ftBOPeqdaXkW ibLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sRBRcIPc; dkim=neutral (no key) header.i=@vger.kernel.org; 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 a11si209373edv.236.2020.08.26.15.11.28; Wed, 26 Aug 2020 15:11:50 -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=sRBRcIPc; dkim=neutral (no key) header.i=@vger.kernel.org; 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 S1726947AbgHZWIB (ORCPT + 99 others); Wed, 26 Aug 2020 18:08:01 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:33814 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbgHZWH6 (ORCPT ); Wed, 26 Aug 2020 18:07:58 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598479675; 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=4utsE2QnYLTwl7fFsiKLdj2uLDQ8VVZxXiuVQb2kEpw=; b=sRBRcIPcojSh91o3SVSNtR9BZjT/ERarAeteZurQB8clmaozva95uXsZnerPHQIaUJ2bCf 2V4LkENb+OOoqPHwDREL5YNcGUyY+O4JE9iu7ReWTkWJMDW+bCpWEa7Kxtrp6mAIxNvWDK ZXCAIzJz6ZZPVVJS1hIiPo5ryCeVOSUc105c72syPlRg2KyAIBO87N5nhtx9Duega2fnmX qFLWSY8o0h+0OV8bUdMloYebDCRGlIyMGkjeHPlsvNXg0qcvPRTKPFYzOg1VsPm4hzAHP7 5+Zyk7BVUMHvNsg3oQVwTI6XsAtb5yYknFQ5eTJHb1k+tJb1x11zFz44ScF7dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598479675; 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=4utsE2QnYLTwl7fFsiKLdj2uLDQ8VVZxXiuVQb2kEpw=; b=XlvoNOGDvY6g0zKRImvQ46z5lE62vPkFVn4F20bQCs9QuFc75x28/28A2X0OXjQbJLMT2o jMU+gEVelqOOzDAw== To: David Laight , Alexander Graf , X86 ML Cc: 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\@scylladb.com" , Brian Gerst , "stable\@vger.kernel.org" , Alex bykov Subject: RE: x86/irq: Unbreak interrupt affinity setting In-Reply-To: References: <20200826115357.3049-1-graf@amazon.com> <87k0xlv5w5.fsf@nanos.tec.linutronix.de> <87blixuuny.fsf@nanos.tec.linutronix.de> <873649utm4.fsf@nanos.tec.linutronix.de> <87wo1ltaxz.fsf@nanos.tec.linutronix.de> Date: Thu, 27 Aug 2020 00:07:54 +0200 Message-ID: <87ft89kqmd.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 On Wed, Aug 26 2020 at 21:37, David Laight wrote: > From: Thomas Gleixner >> Sent: 26 August 2020 21:22 > ... >> Moving interrupts on x86 happens in several steps. A new vector on a >> different CPU is allocated and the relevant interrupt source is >> reprogrammed to that. But that's racy and there might be an interrupt >> already in flight to the old vector. So the old vector is preserved until >> the first interrupt arrives on the new vector and the new target CPU. Once >> that happens the old vector is cleaned up, but this cleanup still depends >> on the vector number being stored in pt_regs::orig_ax, which is now -1. > > I suspect that it is much more 'racy' than that for PCI-X interrupts. > On the hardware side there is an interrupt disable bit, and address > and a value. > To raise an interrupt the hardware must write the value to the > address. Really? > If the cpu needs to move an interrupt both the address and value > need changing, but the cpu wont write the address and value using > the same TLP, so the hardware could potentially write a value to > the wrong address. Now I understand finally why msi_set_affinity() in x86 has to be so convoluted. Thanks a lot for the enlightment! tglx