From patchwork Thu Oct 12 06:25:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 151776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1021004vqb; Wed, 11 Oct 2023 23:26:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdBGPhDhgTFYx8nJZS6w8DAg0nJ6HRrX3Ehlr6Gunau4H4RRHIRZhkvs09uNrPSlaYnYk8 X-Received: by 2002:a05:6808:21a6:b0:3ad:ae0d:f845 with SMTP id be38-20020a05680821a600b003adae0df845mr30614488oib.5.1697092018381; Wed, 11 Oct 2023 23:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697092018; cv=none; d=google.com; s=arc-20160816; b=qxEl5xPiu0yB09WIZqlgHPv9YIubrLNVLtXnTccE6MmDZ/6VJzzNcpG7FmWwyeFH3e XEmQGtLAO79IZNOZzpKwIjmDJlpybIzRvCRlpYUIbRGNZ2mXjC1vKwOZlhK12hGhdfBm 6xZdLPYBSLUbs3nI/4h/eQ0OwawgDObzN6qUYtIyoQymhmiSmTvNyQX4y3WntLm02ARm tCZZDzM9x6NnwF4gJGyl72eqC0apd7KJghTEPoZfZTHaiiFGrtfQxuEmiZeSm9PcWPtO YiatYyCc+baihIcBAWnAKRX9cXUSAop2KQOewgLEUvrHm4cUJb8+sDF+UfeUmD+s89o+ DDlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=5DIwPHfjDKni4ULexliWOMEADdnbFFYA528qpHWmc1U=; fh=mMfmBBnQqUyJFpP4k/jHOdCgYBJ8qhN6QShtG+EWtzI=; b=tCNYVcBjDYRYTjzp8fWGK5iN2buWXs6BoJmdy4ToVXVAch7gcwvSfFMHqvMRYmbdDQ 6QUML/m720jvPfDZbdPbKRzM1XG7Ft4hi/lR9ePoDLbkQlRmm3Dao8rxiFZyDLRGrBHp LddvImf/+anZMZg0jptrpbxiH7VXuJF9ZAq2RzFpnWVnu8KHVdnJ1GlSoJ76bC9IAjNX LUiBstlA3ALxkScZ+rrQSO0jVEUJLQbHbql7NEqo/BHZiC6f9Ey/hA8fOVXeLG1qRPjg 4i9vbnsnNi35MroLFy0Qd5y1yRsskazPvXCsLcS06n5z1nDhBXAc4ZMztgnmYyXp672q pkiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0uxylyqQ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 27-20020a63195b000000b00566016fc08csi1589887pgz.83.2023.10.11.23.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 23:26:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0uxylyqQ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0DB0C8133C9D; Wed, 11 Oct 2023 23:26:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343510AbjJLG0Y (ORCPT + 19 others); Thu, 12 Oct 2023 02:26:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235349AbjJLG0H (ORCPT ); Thu, 12 Oct 2023 02:26:07 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73623101; Wed, 11 Oct 2023 23:25:37 -0700 (PDT) Date: Thu, 12 Oct 2023 06:25:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697091935; h=from:from:sender:sender:reply-to: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=5DIwPHfjDKni4ULexliWOMEADdnbFFYA528qpHWmc1U=; b=0uxylyqQ0pX4K9PljaQwLuBstfxCLZMXfmI9XIYw195vNTFg3SkG8IUV/y5vKP0G+yzqHL 1h5OZy5FFI0t1v+xVNrlSzrsRRx7xPlCw9cUXI/dVgoiFJiclh7zGdvTM/NXVqxqZAfAK/ wN4PtBNZ+G+7oUZcItyDc2g1O2CBdfu6JFBjjUDoJiIa/fRa4Tk2/eHABVbjUEuXpfVHzJ AY0gUw878ZECRHMLqL1pqTo2ScDio9lc8klSbLqrOC+v3NF+NZyyWTGxbDHGGuhyqNBj5p 2f+L5JZ9AW4f7/Ph6O3VHCIK/T2lM3AOQmtTd3Thzn5IgeJiw+mqP9c4fRC0Jw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697091935; h=from:from:sender:sender:reply-to: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=5DIwPHfjDKni4ULexliWOMEADdnbFFYA528qpHWmc1U=; b=Rx/39lipNDxxNymOslNgiQCbJEQOem7AeQa7ZNENUAA9OXQ0bSquN5en/9GTuE6VlXcyyY 22kHYyNyxfN4jnAQ== From: "tip-bot2 for Lu Yao" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/msi: Fix compile error caused by CONFIG_GENERIC_MSI_IRQ=y && !CONFIG_X86_LOCAL_APIC Cc: kernel test robot , Lu Yao , Ingo Molnar , Randy Dunlap , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231012032659.323251-1-yaolu@kylinos.cn> References: <20231012032659.323251-1-yaolu@kylinos.cn> MIME-Version: 1.0 Message-ID: <169709193403.3135.8043258061582152833.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 23:26:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779529960550626570 X-GMAIL-MSGID: 1779529960550626570 The following commit has been merged into the x86/apic branch of tip: Commit-ID: 441ccc351256533b6381e86a5648dbfe04b74286 Gitweb: https://git.kernel.org/tip/441ccc351256533b6381e86a5648dbfe04b74286 Author: Lu Yao AuthorDate: Thu, 12 Oct 2023 11:26:59 +08:00 Committer: Ingo Molnar CommitterDate: Thu, 12 Oct 2023 08:13:27 +02:00 x86/msi: Fix compile error caused by CONFIG_GENERIC_MSI_IRQ=y && !CONFIG_X86_LOCAL_APIC When compiling the x86 kernel, if X86_LOCAL_APIC is not enabled but GENERIC_MSI_IRQ is selected in '.config', the following compilation error will occur: include/linux/gpio/driver.h:38:19: error: field 'msiinfo' has incomplete type kernel/irq/msi.c:752:5: error: invalid use of incomplete typedef 'msi_alloc_info_t' {aka 'struct irq_alloc_info'} kernel/irq/msi.c:740:1: error: control reaches end of non-void function This is because file such as 'kernel/irq/msi.c' only depends on 'GENERIC_MSI_IRQ', and uses 'struct msi_alloc_info_t'. However, this struct depends on 'X86_LOCAL_APIC'. When enable 'GENERIC_MSI_IRQ' or 'X86_LOCAL_APIC' will select 'IRQ_DOMAIN_HIERARCHY', so exposing this struct using 'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'. Under the above conditions, if 'HPET_TIMER' is selected, the following compilation error will occur: arch/x86/kernel/hpet.c:550:13: error: ‘x86_vector_domain’ undeclared arch/x86/kernel/hpet.c:600:9: error: implicit declaration of function ‘init_irq_alloc_info’ This is because 'x86_vector_domain' is defined in 'kernel/apic/vector.c' which is compiled only when 'X86_LOCAL_APIC' is enabled. Besides, function 'msi_domain_set_affinity' is defined in 'include/linux/msi.h' which depends on 'GENERIC_MSI_IRQ'. So use 'X86_LOCAL_APIC' and 'GENERIC_MSI_IRQ' to expose these code. Reported-by: kernel test robot Signed-off-by: Lu Yao Signed-off-by: Ingo Molnar Acked-by: Randy Dunlap Tested-by: Randy Dunlap Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20231012032659.323251-1-yaolu@kylinos.cn --- arch/x86/include/asm/hw_irq.h | 6 +++--- arch/x86/kernel/hpet.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 5518298..b02c3cd 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -28,7 +28,7 @@ #include #include -#ifdef CONFIG_X86_LOCAL_APIC +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY struct irq_data; struct pci_dev; struct msi_desc; @@ -105,10 +105,10 @@ static inline void irq_complete_move(struct irq_cfg *c) { } #endif extern void apic_ack_edge(struct irq_data *data); -#else /* CONFIG_X86_LOCAL_APIC */ +#else /* CONFIG_IRQ_DOMAIN_HIERARCHY */ static inline void lock_vector_lock(void) {} static inline void unlock_vector_lock(void) {} -#endif /* CONFIG_X86_LOCAL_APIC */ +#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */ /* Statistics */ extern atomic_t irq_err_count; diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 1648aa0..41eecf1 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -52,7 +52,7 @@ unsigned long hpet_address; u8 hpet_blockid; /* OS timer block num */ bool hpet_msi_disable; -#ifdef CONFIG_GENERIC_MSI_IRQ +#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_GENERIC_MSI_IRQ) static DEFINE_PER_CPU(struct hpet_channel *, cpu_hpet_channel); static struct irq_domain *hpet_domain; #endif @@ -469,7 +469,7 @@ static void __init hpet_legacy_clockevent_register(struct hpet_channel *hc) /* * HPET MSI Support */ -#ifdef CONFIG_GENERIC_MSI_IRQ +#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_GENERIC_MSI_IRQ) static void hpet_msi_unmask(struct irq_data *data) { struct hpet_channel *hc = irq_data_get_irq_handler_data(data);