Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2344094pxk; Mon, 14 Sep 2020 10:45:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU2FK7HJEcOJ3c9X6FsHyGf4rg9nLyhhMY+7UdQOfvr3nLXA5WwE1R4AwDiWOMUSYivvF1 X-Received: by 2002:a17:906:1f08:: with SMTP id w8mr15589837ejj.181.1600105550057; Mon, 14 Sep 2020 10:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600105550; cv=none; d=google.com; s=arc-20160816; b=rLHcODdsJ8fkqNkR9OshAoL9Pn7pCbolITYhx/uFVzOQKXoEYhdArqpp1z18WolFez MlNy1aPy1PUZDu9sDdLo415EJ16Y/R6TKuZk0QOz3oLhCMdW0PXQaGNUORVUDvOhD/tl 6gaAnggV7AXUVjVhjCDDZBnb3v8DA/uj4pLu+gZFsiv8TCutIQQYCYuFY9QtiqNwpywA 91I8F8LrCQot0gJA4SR0cgpDt7zVfq0FcCRdySdeY+q5AcDjrSbKi71k/MbrWDR6sbNo Z7prknKEn9UF58TBou1zkvKCW1olrv3wvV1wqxo8KSzZ/MYI+e/s16VK0zYZr828dnNa NjdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lt7oJ0RYkp7GOEh6jTuKHSPMhemyBNu8hytTPWvgNCo=; b=zhbdQOkt2eNjbdHd9GFGcQmSFPbS65h2HFNEqT7e/krvNm26LdCI5AtxVo89BOBBcF f7njrHJm1BwNwyWY53jD3AHr8plgIOYvCone26d0mUOItXEXILTzHIpuDkZZW6Py3iI7 vmOcEIHRbX0SZ46pW+8mseiqAhKlt3DPGkFqUoh1g6yZz2BOzbUNbMPt9tm9Eq30lVYH PZYpC+ylcmIqUVrSpkaLL0ds/mem46M6iPfucH3OsPiLZqW4mRf4ULmjKT0dU2ngKeZA GVzUCeK3BBwHB4ewrnY6fuGgQ7+1DF6SM8304mDBAOPGunZLcmRmxOQXiBddipm73z1B OuuQ== 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 j4si7814360eds.475.2020.09.14.10.45.27; Mon, 14 Sep 2020 10:45:50 -0700 (PDT) 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 S1726045AbgINRoY (ORCPT + 99 others); Mon, 14 Sep 2020 13:44:24 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34167 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgINMFm (ORCPT ); Mon, 14 Sep 2020 08:05:42 -0400 Received: by mail-ed1-f65.google.com with SMTP id k14so1378055edo.1; Mon, 14 Sep 2020 05:04:13 -0700 (PDT) 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=lt7oJ0RYkp7GOEh6jTuKHSPMhemyBNu8hytTPWvgNCo=; b=lqeoMTZYZ4zIeHG8LVZcFF9rMMzJLajFDX7zt6SNPOIo55+obfbLOsqILmJHc/pSGm I6PxSRY9SuodV/AvUap2WTqwdP5iEgtPXFLAWEyDwwzQjuldrE1oNusSfI+p3XCubgUI v430O/zIWSQX6nQoDPB8vT4Rima0g648FUHFo98W+3z/A7I1HQj8TUlDP3F190A2rhEG ngPeh3he24uGSE1Jy/ofwmpyK7cXoez7UwfZX8qvfs3RVsQOEDm64CFG2MEv4tALqrhN 3Tdcgq44H52WDJ9RcqqRaB3sBD5jWTIs3Tw/iSIczEI116KobX1+jNH6/Fc0IKE3y9GV lGyQ== X-Gm-Message-State: AOAM532jOQaAZYN/JELkdntk4lP7tH1kAHxxBEyMtnzmf5vMsQlQEMD3 iyDTZJdnOCPYzwnosjQq7FMDM617SVk= X-Received: by 2002:adf:ed12:: with SMTP id a18mr16432588wro.178.1600084778613; Mon, 14 Sep 2020 04:59:38 -0700 (PDT) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id c205sm18764809wmd.33.2020.09.14.04.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 04:59:38 -0700 (PDT) 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 , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Lorenzo Pieralisi , Rob Herring , 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 RFC v1 12/18] asm-generic/hyperv: update hv_interrupt_entry Date: Mon, 14 Sep 2020 11:59:21 +0000 Message-Id: <20200914115928.83184-4-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200914112802.80611-1-wei.liu@kernel.org> References: <20200914112802.80611-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 --- 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 bf40ff09c99d..b38faa04234b 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -1215,7 +1215,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 e7e80a27777b..83945ada5a50 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -469,6 +469,11 @@ struct hv_create_vp { u64 flags; }; +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 { @@ -502,10 +507,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