Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp267389pxa; Thu, 27 Aug 2020 01:29:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiLUsUqU5U3YEXpdY9ERiQHOKoN/pETXxnDR8UrpsQzq9llFB6Xo0ojg+XmgMxrGTtU7Qf X-Received: by 2002:a17:906:ad99:: with SMTP id la25mr18907115ejb.63.1598516988370; Thu, 27 Aug 2020 01:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598516988; cv=none; d=google.com; s=arc-20160816; b=hNq/o16GBjtgoHkaJrGCCFFcYwJw6Cn1IGpfkgo2hzL9+sLuJ02aP5ko52f2/P9lyU oTbmbg3Ygrf43eJNIamP+ctjNI8vvVnulwFJOCn/mk/jVmICrMq9Dv2Wkxo93K3pOyom r+AUlEp/WME5iVicVpwsDvfCUHrA905deAHpwjeXRAeTO92kA0ONdl3H/6vCaL4YLXP1 FZFKKMc91xLDSrs/Gi38687Iu6xP07L/D8kkOmyVL9csuXR+2b/71uMvEQkM28lstcyb coHAuzxvHEZ/59Zx50+s6a8+Mc90zADPX7FaP7UzEHsWrEqi8+W1/HrHCgq5B1Dy1+Ou e/LQ== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=fP1lIkVu9qxHiZwkZTLEM1HeLj6TjWmB87CUUUGgqkI=; b=graxzftOeHkdyB71QhFd/wHM/982fHKBdFt0gzGOOh+kZQQ0Ancf2YNgXM3m9aL50C jbTmpbg+PCnm1MtIzBPeAP8/w6T4xi1BtFEcjznqXA972cx+DsJs9mb5A3w+IePF2C89 6/ciqStl/ArrVoS1wxp9goV8Vi4ysOprBI04Lz+KzuFg0LUol0hgmDyEbFf1fHIuUc4X lyqclfMN/04wa0E0IPBr5tPOLO7grwWXtBUg69H2eN/KK9IsIU2KLiipJ9XQANmDcLHb Dp41grCcoG6Rpq36i3i9k8popXrM1vccSNYPBUU0SC4Ba24U+uDgupXJP/xpizrdpVvE j7UQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh18si933731ejb.112.2020.08.27.01.29.26; Thu, 27 Aug 2020 01:29:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbgH0I2w convert rfc822-to-8bit (ORCPT + 99 others); Thu, 27 Aug 2020 04:28:52 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:28213 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbgH0I2u (ORCPT ); Thu, 27 Aug 2020 04:28:50 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-114-cyAKyHkbOAOvWmpU6WpmIQ-1; Thu, 27 Aug 2020 09:28:46 +0100 X-MC-Unique: cyAKyHkbOAOvWmpU6WpmIQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 27 Aug 2020 09:28:45 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 27 Aug 2020 09:28:45 +0100 From: David Laight To: 'Thomas Gleixner' , 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 Thread-Topic: x86/irq: Unbreak interrupt affinity setting Thread-Index: AQHWe+aKb+AhwM2rPkq6/MK3Hcp5nKlK5iEA///7/wCAALxiUA== Date: Thu, 27 Aug 2020 08:28:45 +0000 Message-ID: <620d67af76554a558061c8df5e2cb038@AcuMS.aculab.com> 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> <87ft89kqmd.fsf@nanos.tec.linutronix.de> In-Reply-To: <87ft89kqmd.fsf@nanos.tec.linutronix.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner > Sent: 26 August 2020 23:08 ... > > 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? Yep, anyone with write access to the msi-x table can get the device to write to any physical location (allowed by any IOMMU) instead of raising an interrupt. > > 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. Updating the registers should be much the same on all architectures. I probably should have looked at what msi_set_affinity() does before deciding which order the fpga logic should read the four 32bit registers in; but they are read in increasing order - so enable bit last. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)