Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3058705pxb; Mon, 16 Nov 2020 04:53:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJylaGXu/6v55aOm+BHah9iPVxlybglGGH0fdVLjwQg1t6OOaa5FgFKdS+vDrc5jPRBa3AlE X-Received: by 2002:a17:906:bcf9:: with SMTP id op25mr13992772ejb.223.1605531219120; Mon, 16 Nov 2020 04:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605531219; cv=none; d=google.com; s=arc-20160816; b=Ydu2OSM1SeevavUxovUbkEDr353WZukCd3ChOrvaXv+dzC9sJNSIM+tWVyZDz5HC70 Hy7Lsj1qVAdTH2WWMnJHlXmhBqJRerXSlHxHvlUe23Bfhdp2Spo7xG0rpyMHpSiixMfK 37E03K2ztt88Inrl4oZpmNA6eaeKnBY2d7k55mDpsrdQSWPQn2HfeT4skWKboJTCsVfa dyLEEM8mAUrnvKf29zeXtFX44LOKJgyoPHGKanYc3yRGK6wo25PhMX82gbvk5qQ48CX8 c3jKadRjBlH4TtMJ8YORF1ZnkXt6sMtPOqTvNKqomN5MeF1YNErP0ZXU5HOGht4l/tjj H5XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=0MZk8f05zzIV7Ttfy5YcrIRRf3Ks113ilZvj4y+g/U4=; b=NrfT4oSlMbjnaEHaX8LwWMOGcRoT8BjHcXbYutbpVGMM2kaQh68+LeazUid9BdoFX4 Opnbml4xg9dMGYmnsZ+65Rl9yg18RacjogK4TP9t3UaSvILDLqztpkUPz30Rq5lb9iGg M3Qx6hub3QVwDWd9O6VdAsuFNbhwu9tnw4RufvYE1h2AKWHbfAcm/TAcShgx6D5kSbQR mi2eVvaVSv5cs8AOohwoIBwZrmdt+MJ81bjVPDUsqhXOLcP8HMT6VEMGl6fzjQdGVUVz PN9P4aCVKglJO0dfeyVl9p7MVE7piEiqJfzPQOcLsp6bYMJkzt9kkVr87nrDkOYFzG0L 1+CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aEs2krwq; dkim=neutral (no key) header.i=@linutronix.de; 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 ar8si11592599ejc.496.2020.11.16.04.53.15; Mon, 16 Nov 2020 04:53:39 -0800 (PST) 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=aEs2krwq; dkim=neutral (no key) header.i=@linutronix.de; 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 S1726754AbgKPMuf (ORCPT + 99 others); Mon, 16 Nov 2020 07:50:35 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41066 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbgKPMuf (ORCPT ); Mon, 16 Nov 2020 07:50:35 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605531033; 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=0MZk8f05zzIV7Ttfy5YcrIRRf3Ks113ilZvj4y+g/U4=; b=aEs2krwqPJ5mncHAdF1YpE/lMEDDjlcz7iqKbOyZpZsY/f5uD7btQ7ZtbVF1m0VUrxBBYY /NmlpfD+lDAWr+jFZ1LI7D+baDhdxVQYvEThXbsaw0u/P505555eqUTPPkOmmgPEJC5c41 hLHY497BOs49EMjQsmeEa/TCmd/8IgbWp0mAIFg1I0rwBLiidqd2yawOVHTIIGblKki72P uU7yHmaWFxb0GAzley08IBzxvR/UQqBaH0/M1weOTpxoKKMOnxYc6MfMQ07DTDY7/IjEcW ajRYjH/sV8IyM6VR94qsA5AiV0NGIQc6GriZQmwK8Dm/89rxobYk6y6lztU2Cg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605531033; 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=0MZk8f05zzIV7Ttfy5YcrIRRf3Ks113ilZvj4y+g/U4=; b=2/MsSG7CjQLYFTCWmCzdOxzaBv33PtlagCdIBlyEhwQgyKbUIZyEh4xZmT0oEgioFkXStT 5cqgyGxf6iGQBnDQ== To: Geert Uytterhoeven Cc: Jason Gunthorpe , Ziyad Atiyyeh , Itay Aveksis , Moshe Shemesh , LKML , the arch/x86 maintainers , Joerg Roedel , Linux IOMMU , linux-pci , Bjorn Helgaas , Marc Zyngier , David Woodhouse Subject: Re: iommu/vt-d: Cure VF irqdomain hickup In-Reply-To: References: <20200826111628.794979401@linutronix.de> <20201112125531.GA873287@nvidia.com> <87mtzmmzk6.fsf@nanos.tec.linutronix.de> <87k0uqmwn4.fsf@nanos.tec.linutronix.de> <87d00imlop.fsf@nanos.tec.linutronix.de> Date: Mon, 16 Nov 2020 13:50:32 +0100 Message-ID: <87lff1zcrr.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Geert, On Mon, Nov 16 2020 at 10:47, Geert Uytterhoeven wrote: > On Thu, Nov 12, 2020 at 8:16 PM Thomas Gleixner wrote: >> The recent changes to store the MSI irqdomain pointer in struct device >> missed that Intel DMAR does not register virtual function devices. Due to >> that a VF device gets the plain PCI-MSI domain assigned and then issues >> compat MSI messages which get caught by the interrupt remapping unit. >> >> Cure that by inheriting the irq domain from the physical function >> device. >> >> That's a temporary workaround. The correct fix is to inherit the irq domain >> from the bus, but that's a larger effort which needs quite some other >> changes to the way how x86 manages PCI and MSI domains. >> >> Fixes: 85a8dfc57a0b ("iommm/vt-d: Store irq domain in struct device") >> Reported-by: Jason Gunthorpe >> Signed-off-by: Thomas Gleixner >> --- >> drivers/iommu/intel/dmar.c | 19 ++++++++++++++++++- >> 1 file changed, 18 insertions(+), 1 deletion(-) >> >> --- a/drivers/iommu/intel/dmar.c >> +++ b/drivers/iommu/intel/dmar.c >> @@ -333,6 +333,11 @@ static void dmar_pci_bus_del_dev(struct >> dmar_iommu_notify_scope_dev(info); >> } >> >> +static inline void vf_inherit_msi_domain(struct pci_dev *pdev) >> +{ >> + dev_set_msi_domain(&pdev->dev, dev_get_msi_domain(&pdev->physfn->dev)); > > If CONFIG_PCI_ATS is not set: > > error: 'struct pci_dev' has no member named 'physfn' > thanks for pointing that out. Yet moar ifdeffery, oh well... Thanks, tglx