From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D63C433ED for ; Fri, 14 May 2021 20:52:23 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C693613EB for ; Fri, 14 May 2021 20:52:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C693613EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Fhgh46vKnz3bsG for ; Sat, 15 May 2021 06:52:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=OUnuK95D; dkim=fail reason="signature verification failed" header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=bPU2yGzS; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=193.142.43.55; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=OUnuK95D; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=bPU2yGzS; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FhggZ0WNCz2xZ3 for ; Sat, 15 May 2021 06:51:54 +1000 (AEST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1621025511; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x24V9d0PpiUIyUwPjo7G+YqukfzUq9ldeYVq3IiRBAQ=; b=OUnuK95DK4cX9Vz7igSIrESiPOl75Vk4Sd4deo5S6PcYgLwEnD8X0u+2MrU/v22d3VNeXY 8tHVOaUZL8weSTGqCG9MrOoTQoSV2irRADauIrMp7KTnYPtAalZXXO7wftvK2oyhFj4KDM dDxNCN2HbiGqZlBjIIHqPteRdDKtITMgKcHa/N0lX23+RvFk4GHNeGMoi3yI8SyTRrevyJ 11QbUvD4cgWodOBjMgodEawpGR/DTV9SCZCP937TqxVQV0xrBBFus2qh15FHzqCB10YoOm YhTyb2+zudMDleRjBXIR//J4pz2Kww4DK4nyQ6NzKyudG30lrfaJFwQSyuzrhA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1621025511; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x24V9d0PpiUIyUwPjo7G+YqukfzUq9ldeYVq3IiRBAQ=; b=bPU2yGzS75RSEHrGzxcw4Oia8yFJknu6T5MQBNp85GurlGChW7FIagFpMdxOudJy08WaH3 tFN/D4HZpYImiFBQ== To: =?utf-8?Q?C=C3=A9dric?= Le Goater , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 15/31] KVM: PPC: Book3S HV: XIVE: Fix mapping of passthrough interrupts In-Reply-To: <20210430080407.4030767-16-clg@kaod.org> References: <20210430080407.4030767-1-clg@kaod.org> <20210430080407.4030767-16-clg@kaod.org> Date: Fri, 14 May 2021 22:51:51 +0200 Message-ID: <87im3l2g48.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?Q?C=C3=A9dric?= Le Goater , Marc Zyngier Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Apr 30 2021 at 10:03, C=C3=A9dric Le Goater wrote: CC: +Marc > PCI MSI interrupt numbers are now mapped in a PCI-MSI domain but the > underlying calls handling the passthrough of the interrupt in the > guest need a number in the XIVE IRQ domain. > > Use the IRQ data mapped in the XIVE IRQ domain and not the one in the > PCI-MSI domain. > > Exporting irq_get_default_host() might not be the best solution. > > Cc: Thomas Gleixner > Cc: Paul Mackerras > Signed-off-by: C=C3=A9dric Le Goater > --- > arch/powerpc/kvm/book3s_xive.c | 3 ++- > kernel/irq/irqdomain.c | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xiv= e.c > index 3a7da42bed57..81b9f4fc3978 100644 > --- a/arch/powerpc/kvm/book3s_xive.c > +++ b/arch/powerpc/kvm/book3s_xive.c > @@ -861,7 +861,8 @@ int kvmppc_xive_set_mapped(struct kvm *kvm, unsigned = long guest_irq, > struct kvmppc_xive *xive =3D kvm->arch.xive; > struct kvmppc_xive_src_block *sb; > struct kvmppc_xive_irq_state *state; > - struct irq_data *host_data =3D irq_get_irq_data(host_irq); > + struct irq_data *host_data =3D > + irq_domain_get_irq_data(irq_get_default_host(), host_irq); > unsigned int hw_irq =3D (unsigned int)irqd_to_hwirq(host_data); > u16 idx; > u8 prio; > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index d10ab1d689d5..8a073d1ce611 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -481,6 +481,7 @@ struct irq_domain *irq_get_default_host(void) > { > return irq_default_domain; > } > +EXPORT_SYMBOL_GPL(irq_get_default_host); >=20=20 > static void irq_domain_clear_mapping(struct irq_domain *domain, > irq_hw_number_t hwirq)