Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1159871pxb; Fri, 13 Nov 2020 05:55:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu1/iTimGTTKa99w2sXuRGWT/f8j4JdGtWGIAGihBq4U8YwaRyef+QCHMoT+zP+R8pos1G X-Received: by 2002:aa7:df89:: with SMTP id b9mr2599219edy.335.1605275738261; Fri, 13 Nov 2020 05:55:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605275738; cv=none; d=google.com; s=arc-20160816; b=ENU+QzHfzOsUMCROZHDAbV4jxSeSyNJN03HgaN349vG6W0/Y/g08jv86bSaMc0Agxf dHUnM5ctRX5FuUipBCidrx+Nq9SAUQozG4A4814v1iiAVl9HRJ6zxRDhI6hzII+0RUp+ iK1Df5y6QgNTnyyYFRraknuK1sJwu+RNcTs7/fOl9Qd2h5zfvs6ZuPVhJT2xOoRwdMBy sgle2DWQpVurtUFQ0HcZebn4ASGM9vhHBUxQi3r6b8keQvSpEmFK5ssU3kWKTsHTbqAA lRx3tHx17vguHCP6Jte4rp2bzbRrH0VPnq1RYWhP2HLhh/R2y+HmuRahg/QcQFEqIRPh vLdA== 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=xsSnKN0Y2j/jQ2IRBao4uClTn5UrQq6Zg7g/UkqX+lo=; b=Fxu4S8+Ivop2BrvVfyotE7HvHy21YJo631a80NgYPxkNhQv7ANBoWri7dnps+ILvnK x97blqCXaPUszDww+S3Q9maf+N4ztUL+w2YNpxKGEADx26SS3nfvUj8qu5+l9UC54lo3 VztITE4v23GVNYi0zRo279SSJsG0/qBZrT2T/OSnl+C9VrdLDMC6t2b4cQYgcXX+JBIw UlazLezFb3CATb2pZq9OBeeSv14yHXVheslo5hEtUt//B022l9z208890TBFi7Aa7LEo D0gWcRgBwIhFOtQahsUY7BbnQuMRZjaq+HAGI3LDZ6UF2hbMxE9MLPbYxjgyaBuc0IvM cOcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ayNoDTQA; dkim=neutral (no key) header.i=@linutronix.de header.b=X8h7nBkZ; 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 y9si7096552edp.443.2020.11.13.05.55.14; Fri, 13 Nov 2020 05:55:38 -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=ayNoDTQA; dkim=neutral (no key) header.i=@linutronix.de header.b=X8h7nBkZ; 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 S1726817AbgKMNwd (ORCPT + 99 others); Fri, 13 Nov 2020 08:52:33 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:52062 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726822AbgKMNw3 (ORCPT ); Fri, 13 Nov 2020 08:52:29 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605275547; 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=xsSnKN0Y2j/jQ2IRBao4uClTn5UrQq6Zg7g/UkqX+lo=; b=ayNoDTQA8qN45li0yGYUyxDleZJkOg5NfkWvLrESAsBTP7HmGH+rsHryn2bNTDxixwa5H7 UmIPAIT1Hacp/6y9T8dmqEt6Bvhspdyb06B6qG0TOEECmj+hlLfGqkOdQvfb0iSc5gak4J oBcUXRxTY2W9ABYeWH0ECE7h42DLdDApf+ow7Sr2U7HVZy3kXUWcoZKEOgJQc61hJyygFC C86gRbCf9R81w17QQmbm1X0bphCgaakqz4VhVEEMeRTKnFFXH2m4zJHkVapUcojXJDSDzf 5/MGaf2atprYOuKwQopa03uoDwZi7/7blEcq2I7a1OeY9rFD7gqjfVXM8NQvFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605275547; 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=xsSnKN0Y2j/jQ2IRBao4uClTn5UrQq6Zg7g/UkqX+lo=; b=X8h7nBkZIVQfOzZvoYR42UafxIu8Yci8xE9VWP/nM/wn3IGE5v2RPyiosOcb53/JPb8fNi m1VFqaGW00FwpFDw== To: Marc Zyngier Cc: Jason Gunthorpe , Ziyad Atiyyeh , Itay Aveksis , Moshe Shemesh , LKML , x86@kernel.org, Joerg Roedel , iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, Bjorn Helgaas , David Woodhouse Subject: Re: iommu/vt-d: Cure VF irqdomain hickup In-Reply-To: <2196b03a44a15fdc37223040197c4ac5@kernel.org> 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> <87a6vmmf8h.fsf@nanos.tec.linutronix.de> <2196b03a44a15fdc37223040197c4ac5@kernel.org> Date: Fri, 13 Nov 2020 14:52:27 +0100 Message-ID: <87wnypl5yc.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 On Fri, Nov 13 2020 at 09:19, Marc Zyngier wrote: > On 2020-11-12 21:34, Thomas Gleixner wrote: >> That would allow to add a irq_find_matching_fwspec() based lookup to >> pci_msi_get_device_domain(). > > Just so that I understand the issue: is the core of the problem that > there is no 1:1 mapping between a PCI bus and a DMAR unit, and no > firmware topology information to indicate which one to pick? Yes, we don't have a 1:1 mapping and there is some info, but that's all a horrible mess. >> Though I'm not yet convinced that the outcome would be less horrible >> than the hack in the DMAR driver when I'm taking all the other horrors >> of x86 (including XEN) into account :) > > I tried to follow the notifier into the DMAR driver, ended up in the > IRQ remapping code, and lost the will to live. Please just don't look at that and stay alive :) > I have a question though: > > In the bus notifier callback, you end-up in dmar_pci_bus_add_dev(), > which calls intel_irq_remap_add_device(), which tries to set the MSI > domain. Why isn't that enough? Are we still missing any information at > that stage? That works, but this code is not reached for VF devices ... See the patch which cures that. If we want to get rid of that mess we'd need to rewrite the DMAR IOMMU device registration completely. I'll leave it as is for now. My will to live is more important :) Thanks tglx