Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2556413rdb; Mon, 4 Dec 2023 00:14:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBBJPEcqGg4lIJfF824RziS/EDa9ooFnBvNjDbk4V1+JDaCua7KPpZcDqrujJdLTWBz1w1 X-Received: by 2002:a05:6358:917:b0:170:7b0:2bc3 with SMTP id r23-20020a056358091700b0017007b02bc3mr4488131rwi.0.1701677646430; Mon, 04 Dec 2023 00:14:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701677646; cv=none; d=google.com; s=arc-20160816; b=bMWGxIhaGQ43xXDXO7nfiMndtaehqnoUexiBm5nCuaYrsTpdFUTum357DSArhccd1s 4xJ7NDhCRqAJJU6JYZQLnZajNhfcZcZT2xAX2e4njTVKoDVoT3O8m0WzUpll6U9z+mRY yQv5InIDDAQh9vpuRgpXkLRQWY1vLTuiC7iUQjtbyAAt258v3cOtBVH1T8+JF8FeBcYp 620ntJaJPvw/kONqUsThKDMKIgyC0Akuztlsx8kzPVGv3wmhnXlZkwZ9p5jVtV2XbHPl 0G/e0LKU98/26XoXhn6rkNmTBPqRVCN5ImEGhGIHS3H72ZSr7/FjZxmgc2w4G/+rHjwi Rkpw== 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=gMNsPU3Juib2yJf6SWQqDXaxEhWmoFOPHWoGv9RWmGg=; fh=s5znDkCst9goEYmDEbaVX+aMd2gW8qMwpu/kSAaSxis=; b=o+tMeIQy4/PRlsNGVVrJg7dSFYjapqjdLeG/Vh9tu/kAm4o2cY2v2pjAm1n0LiURCm Dwksml/uQvlrGL10sR6HAghJYilQ6VPCkwePKmddbIK7nFff3rGEpoEpbLf/dK7xvTVn 4Ydx6cVjxzS7Xn5All8XOp/PwXSV9o/yMWKXpl/Dk/1FCWmg+0JbFrMikHLB71xlIBmW 4EmZRt90hlhdpXcK5tFq4rxjiSLlgejo2Q2qQLG7yu8BmswYzwiWSLgAjagfGGw/jclg hXaHj2Ou6S7JX6zd48e61Pp694/xlrX5TEMkA7uIVs+dLnImau0aAYOKeeCNnTZUKC11 8t+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=c9Sil9zK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l24-20020a63ba58000000b00589878c0a5bsi3306741pgu.71.2023.12.04.00.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 00:14:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=c9Sil9zK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 228F18070E13; Mon, 4 Dec 2023 00:14:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbjLDINv (ORCPT + 99 others); Mon, 4 Dec 2023 03:13:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjLDINu (ORCPT ); Mon, 4 Dec 2023 03:13:50 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A762CBB; Mon, 4 Dec 2023 00:13:56 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701677635; 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=gMNsPU3Juib2yJf6SWQqDXaxEhWmoFOPHWoGv9RWmGg=; b=c9Sil9zKcRmAM17YdNijnJ738PZPkK/vFPXvfZqAahgs6pPDG3sDKWQXOdww6YNmkHldsI vjwOnAXB+bYEjHmN1RamCkmOVTAX2fGQdmvw2pNYjUI0MxdPmd4T1YHOg6v27La0V6EFgU shnYxpZ7VtqifbKRJUw+fltnGt8KchZV9aqpZBYYCcSMPwCNLOTLDHzMzJ3OMeRCm6gji/ ZBI7XVm6Xe+uzjQsA5VNiKpVTduqxYnPjwbaeWpGWrT98UaiypT/oFki+dXe3gGk7j402j xblTjyWiv/lL2Vg+dWyUHVVUVgRYDX3x98dOizKDaWFwW3nuPFqS5GwLQ0e/Fg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701677635; 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=gMNsPU3Juib2yJf6SWQqDXaxEhWmoFOPHWoGv9RWmGg=; b=zBwXBxP/CtRum3O7TXJpoQS0cbxSZPFzNqDfrXvR7wNiGLNFMWJgE3xAEKIaSQKeV6xH6I vHV1cGfsxAipPcAw== To: Jiqian Chen , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Boris Ostrovsky , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Roger Pau =?utf-8?Q?Monn=C3=A9?= , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Stefano Stabellini , Alex Deucher , Christian Koenig , Stewart Hildebrand , Xenia Ragiadakou , Honglei Huang , Julia Zhang , Huang Rui , Jiqian Chen , Huang Rui Subject: Re: [RFC KERNEL PATCH v2 2/3] xen/pvh: Unmask irq for passthrough device in PVH dom0 In-Reply-To: <20231124103123.3263471-3-Jiqian.Chen@amd.com> References: <20231124103123.3263471-1-Jiqian.Chen@amd.com> <20231124103123.3263471-3-Jiqian.Chen@amd.com> Date: Mon, 04 Dec 2023 09:13:54 +0100 Message-ID: <87bkb6xu4d.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 00:14:04 -0800 (PST) On Fri, Nov 24 2023 at 18:31, Jiqian Chen wrote: > diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c > index 5a96b6c66c07..b83d02bcc76c 100644 > --- a/drivers/xen/xen-pciback/pci_stub.c > +++ b/drivers/xen/xen-pciback/pci_stub.c > @@ -357,6 +357,7 @@ static int pcistub_match(struct pci_dev *dev) > static int pcistub_init_device(struct pci_dev *dev) > { > struct xen_pcibk_dev_data *dev_data; > + struct irq_desc *desc = NULL; > int err = 0; > > dev_dbg(&dev->dev, "initializing...\n"); > @@ -399,6 +400,12 @@ static int pcistub_init_device(struct pci_dev *dev) > if (err) > goto config_release; > > + if (xen_initial_domain() && xen_pvh_domain()) { > + if (dev->irq <= 0 || !(desc = irq_to_desc(dev->irq))) Driver code has absolutely no business to access irq_desc. > + goto config_release; > + unmask_irq(desc); Or to invoke any internal function. > --- a/kernel/irq/chip.c > +++ b/kernel/irq/chip.c > @@ -439,6 +439,7 @@ void unmask_irq(struct irq_desc *desc) > irq_state_clr_masked(desc); > } > } > +EXPORT_SYMBOL_GPL(unmask_irq); Not going to happen. > --- a/kernel/irq/irqdesc.c > +++ b/kernel/irq/irqdesc.c > @@ -380,7 +380,7 @@ struct irq_desc *irq_to_desc(unsigned int irq) > { > return mtree_load(&sparse_irqs, irq); > } > -#ifdef CONFIG_KVM_BOOK3S_64_HV_MODULE > +#if defined CONFIG_KVM_BOOK3S_64_HV_MODULE || defined CONFIG_XEN_PVH Neither that. This all smells badly like a XEN internal issue and we are not going to hack around it by exposing interrupt internals. Thanks, tglx