Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1800052pxu; Tue, 24 Nov 2020 09:11:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSjX/txEYrcaKKXnVRkFaeeW0XlTMMbDOIi+GmM5kFp1Tx1lLruk/J2R5qaUdo5ngP1zWu X-Received: by 2002:a17:906:1e0c:: with SMTP id g12mr4808860ejj.115.1606237887931; Tue, 24 Nov 2020 09:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606237887; cv=none; d=google.com; s=arc-20160816; b=sIYiwzx3w+/fMsOzvTD/F4JBcCYc2qLHZ/utw4yk4LegxQQlIpsmRljyzkJKUhQ+nd UtBp9cbxZZLEvcn/CCo4kFFtPHkE+SvNTi6DXqU08j2ZhnVYDOy8c5DelB1icGdWE/LG WxYC37iYje12shTc91DjtmVXNSMJUFRPkfD/x366Cx1SnQfPcyLT3EnsjDMDEwyrhzED UGkFrfoAhhEaL1k20VJZxE/uIp0XvRisynOzLBoQUvAFqMSXFHh6PRShVV8FNClmp9v7 tEplVU/p8BDKUFijORRQnzS76tbxHbo3eWG1eJ0J67Y1bILVDC2hQ+0pVU4oZFKn9zLe AtAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5ffZGnFfG/i7fEcgkAsrxXNlo5GdKz18dLPh/88U9IU=; b=WCWCLY30Zl6DJGUlascDZsm/lLbTcleQNR+6k422OgCIgIR4rJa9IALbPnCYsglv+V Zgp/nEfLDCRjnsbFybdJyBbHbvC5bLwrnyQzjaB9RSX/joq+wJ3jFr0WhgjeYQ44TfjE cgVJoHKtlblez7NecM9d6SfrG+vp4+mg1cyHW9lMfw7f4+137Nmg1Bd9jDBe9BxiwcGV Srig6Sq5RZD+63IgS1JE2SbJ6ZUKY3vXTpwHtMQqI1v+2WtiNx4erAS//HN7t3RPfJgR wcaQfc0pkGV5YORjJBSVY6n9TXh0YzAeLLt8MPrz9o9qhZowLFW5n2mDssCERWYRdCTI LMXg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si8436770ejj.217.2020.11.24.09.11.02; Tue, 24 Nov 2020 09:11:27 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403793AbgKXRII (ORCPT + 99 others); Tue, 24 Nov 2020 12:08:08 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51121 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390675AbgKXRIG (ORCPT ); Tue, 24 Nov 2020 12:08:06 -0500 Received: by mail-wm1-f66.google.com with SMTP id c198so3070830wmd.0; Tue, 24 Nov 2020 09:08:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ffZGnFfG/i7fEcgkAsrxXNlo5GdKz18dLPh/88U9IU=; b=ME8lq3TTuUGKAKkjOa4RKGhcmeev0vL5+/7zdmtfkMcr8ZP4v6fXsNZGPJ5tI37hZA eiPRqnpUmK4b0XOxb2r7oXMw0zk1z8tkK0hEo0wfYLpHizLu+T6ZF3KcMyaNa7fHdPvC 2ya2XLdcfFlwCpIfFFmJimqabGksPBpL2H9XRICwd9j0iZyMDP37jr7QI6ETURgbxsAr sOqwQwmFdU1wjkp/iQwnp6dNc1lbkTWucg7GHBTbHAXEhZD2ius0aRNngpBQDDEpNruA 9QCCEfl6uxP2KKUyupmK9XQcrzoJt4JsM3csqQ3amPRWtej/SmWu79lN4sZOtQjtphlD eYxA== X-Gm-Message-State: AOAM533O0LY9qnmbR9pIzrl+Az6M+z/hvZiQ9Fass6MjjroGGGRAukUA jPMWpKzmo3y7p8AfDYTnCKkTIIw4VkY= X-Received: by 2002:a1c:35c2:: with SMTP id c185mr5612923wma.74.1606237682063; Tue, 24 Nov 2020 09:08:02 -0800 (PST) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id v20sm6419874wmh.44.2020.11.24.09.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 09:08:01 -0800 (PST) From: Wei Liu To: Linux on Hyper-V List Cc: virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Wei Liu , Rob Herring , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Lorenzo Pieralisi , Bjorn Helgaas , Arnd Bergmann , linux-pci@vger.kernel.org (open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS), linux-arch@vger.kernel.org (open list:GENERIC INCLUDE/ASM HEADER FILES) Subject: [PATCH v3 12/17] asm-generic/hyperv: update hv_interrupt_entry Date: Tue, 24 Nov 2020 17:07:39 +0000 Message-Id: <20201124170744.112180-13-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201124170744.112180-1-wei.liu@kernel.org> References: <20201124170744.112180-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will soon use the same structure to handle IO-APIC interrupts as well. Introduce an enum to identify the source and a data structure for IO-APIC RTE. While at it, update pci-hyperv.c to use the enum. No functional change. Signed-off-by: Wei Liu Acked-by: Rob Herring --- drivers/pci/controller/pci-hyperv.c | 2 +- include/asm-generic/hyperv-tlfs.h | 36 +++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 03ed5cb1c4b2..59edc0bf00fe 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -1216,7 +1216,7 @@ static void hv_irq_unmask(struct irq_data *data) params = &hbus->retarget_msi_interrupt_params; memset(params, 0, sizeof(*params)); params->partition_id = HV_PARTITION_ID_SELF; - params->int_entry.source = 1; /* MSI(-X) */ + params->int_entry.source = HV_INTERRUPT_SOURCE_MSI; hv_set_msi_entry_from_desc(¶ms->int_entry.msi_entry, msi_desc); params->device_id = (hbus->hdev->dev_instance.b[5] << 24) | (hbus->hdev->dev_instance.b[4] << 16) | diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index 7e103be42799..8423bf53c237 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -480,6 +480,11 @@ struct hv_create_vp { u64 flags; } __packed; +enum hv_interrupt_source { + HV_INTERRUPT_SOURCE_MSI = 1, /* MSI and MSI-X */ + HV_INTERRUPT_SOURCE_IOAPIC, +}; + union hv_msi_address_register { u32 as_uint32; struct { @@ -513,10 +518,37 @@ union hv_msi_entry { } __packed; }; +union hv_ioapic_rte { + u64 as_uint64; + + struct { + u32 vector:8; + u32 delivery_mode:3; + u32 destination_mode:1; + u32 delivery_status:1; + u32 interrupt_polarity:1; + u32 remote_irr:1; + u32 trigger_mode:1; + u32 interrupt_mask:1; + u32 reserved1:15; + + u32 reserved2:24; + u32 destination_id:8; + }; + + struct { + u32 low_uint32; + u32 high_uint32; + }; +} __packed; + struct hv_interrupt_entry { - u32 source; /* 1 for MSI(-X) */ + u32 source; u32 reserved1; - union hv_msi_entry msi_entry; + union { + union hv_msi_entry msi_entry; + union hv_ioapic_rte ioapic_rte; + }; } __packed; /* -- 2.20.1