Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp199102pxb; Wed, 20 Jan 2021 05:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+T5GepnIz9rzumD5CY6F709UwpQejyTBNVLwoUu0f0VL0QIK8ObRtQcDFpqeJ02UzDl8r X-Received: by 2002:a17:906:29d4:: with SMTP id y20mr6052069eje.294.1611147787597; Wed, 20 Jan 2021 05:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611147787; cv=none; d=google.com; s=arc-20160816; b=HX357gTgkL2LtPt5eoblVEvIA0ucNXle7xmJvMr3vAk/tyQo2P3VkI+Xno2BC7/10B +R4hzDkKsG+/2NxE9IOUrSIWUST1wTpkTo+p+NhwBkA3O9y91LogLv+ByM+47ZPHCdvR 5zb5uBszm+0QwnmE0tvalFnLXGHiQBOh3TuTCKw89N/1WucJuDiOpyp0GFOjzC66JQBH wYJpP+YaCYDZ3aFodeOa+sq/HydQIE1uZXpnMiXfQwKU5DdBpWmj7kn6MbxwKWmSvuSI IqnMG2ldpVaTK15uuDvjxFNiacYLRbxxtBAmHP5lfNwXEchjrar9PYDHYRx7JvphEv7d oLSw== 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=Ib7tyiX0BGEQmayJX1r0is3zXQopkTNEFvw3DWHlEoQ=; b=mrEcEJdCBFqeSqRX8MCw74mZWxLQe78XN4u2N5R8UD2asFv7eokNQUlUH2SxqHvewO g+ppHJz+2+oNRCn/YFRwLe0NDwqSKqly7pL2WI4HcPdXBvUpAwjU/a1avPBuSTF5JuQV w1D6pj2Tuh0ISMU7/h3nojrinkLgx9I7gl+z3MDNgnGKH/1+ijbC0W9FBADEhz55eX2V mX6NVbJ5Uz5f/THnuuN61TcE4C3Ern+zXk9JqWpDraFu9q2sOaidlcoJEMYQEa/Okv3X lRaWIBZzcGoq+a3PrM25icgmfcnyhBChVB2gyyuqM6HGivIXhif59DZR+x9RzemOeJns 6XuA== 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 n12si803026edo.512.2021.01.20.05.02.39; Wed, 20 Jan 2021 05:03:07 -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 S2388963AbhATNBA (ORCPT + 99 others); Wed, 20 Jan 2021 08:01:00 -0500 Received: from mail-lf1-f52.google.com ([209.85.167.52]:40850 "EHLO mail-lf1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389272AbhATMLd (ORCPT ); Wed, 20 Jan 2021 07:11:33 -0500 Received: by mail-lf1-f52.google.com with SMTP id v24so27167815lfr.7; Wed, 20 Jan 2021 04:11:15 -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=Ib7tyiX0BGEQmayJX1r0is3zXQopkTNEFvw3DWHlEoQ=; b=nJSYUGsgf4ozNAae2LfFix7XcYwxMQUrVzmwmxs5gGEN3ELxiULpYGEn/cFi2LSOIo 28r+Z3MUO9cOmU9BqUBRBPGl6PX0vFZAessAPnFKJzSDgNudHO3hl1aEhzJOvW2wXxl3 QH4mHB18TW2d0TaHI3ektYyibC9ifLZ+Bw1mNqb67x0E4alMsg5e1PdEMVSWgdscUQf/ 9zVDwTRFl2VuVFyvJUNubV7wYDZqd6dXdM23adbcrpMBK+iVlS8p5CWN8J3/m0LxsaOI ELAWoZLwNeMezdK3Y7aHD0ecQy7GcqZp4vmajKjRRtANWRyqVGgStnG7Y9nnk4MccLNz XA2A== X-Gm-Message-State: AOAM5336k4wYyxQB5pRLk9CVqa3jrgaXfy5Yfds/UWL8CdkZPKLQY98U VwhStj2+YJpfT+NE11xIuuTt834UzAk= X-Received: by 2002:a5d:43cc:: with SMTP id v12mr8736721wrr.319.1611144077348; Wed, 20 Jan 2021 04:01:17 -0800 (PST) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id x17sm3747671wro.40.2021.01.20.04.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 04:01:16 -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 , pasha.tatashin@soleen.com, Wei Liu , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org (open list:GENERIC INCLUDE/ASM HEADER FILES) Subject: [PATCH v5 14/16] asm-generic/hyperv: import data structures for mapping device interrupts Date: Wed, 20 Jan 2021 12:00:56 +0000 Message-Id: <20210120120058.29138-15-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120120058.29138-1-wei.liu@kernel.org> References: <20210120120058.29138-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 Signed-off-by: Sunil Muthuswamy Co-Developed-by: Sunil Muthuswamy Signed-off-by: Wei Liu --- arch/x86/include/asm/hyperv-tlfs.h | 13 +++++++++++ include/asm-generic/hyperv-tlfs.h | 36 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 204010350604..ab7d6cde548d 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -533,6 +533,19 @@ struct hv_partition_assist_pg { u32 tlb_lock_count; }; +enum hv_interrupt_type { + HV_X64_INTERRUPT_TYPE_FIXED = 0x0000, + HV_X64_INTERRUPT_TYPE_LOWESTPRIORITY = 0x0001, + HV_X64_INTERRUPT_TYPE_SMI = 0x0002, + HV_X64_INTERRUPT_TYPE_REMOTEREAD = 0x0003, + HV_X64_INTERRUPT_TYPE_NMI = 0x0004, + HV_X64_INTERRUPT_TYPE_INIT = 0x0005, + HV_X64_INTERRUPT_TYPE_SIPI = 0x0006, + HV_X64_INTERRUPT_TYPE_EXTINT = 0x0007, + HV_X64_INTERRUPT_TYPE_LOCALINT0 = 0x0008, + HV_X64_INTERRUPT_TYPE_LOCALINT1 = 0x0009, + HV_X64_INTERRUPT_TYPE_MAXIMUM = 0x000A, +}; #include diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index 42ff1326c6bd..07efe0131fe3 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -152,6 +152,8 @@ struct ms_hyperv_tsc_page { #define HVCALL_RETRIEVE_DEBUG_DATA 0x006a #define HVCALL_RESET_DEBUG_SESSION 0x006b #define HVCALL_ADD_LOGICAL_PROCESSOR 0x0076 +#define HVCALL_MAP_DEVICE_INTERRUPT 0x007c +#define HVCALL_UNMAP_DEVICE_INTERRUPT 0x007d #define HVCALL_RETARGET_INTERRUPT 0x007e #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0 @@ -702,4 +704,38 @@ union hv_device_id { } acpi; } __packed; +enum hv_interrupt_trigger_mode { + HV_INTERRUPT_TRIGGER_MODE_EDGE = 0, + HV_INTERRUPT_TRIGGER_MODE_LEVEL = 1, +}; + +struct hv_device_interrupt_descriptor { + u32 interrupt_type; + u32 trigger_mode; + u32 vector_count; + u32 reserved; + struct hv_device_interrupt_target target; +} __packed; + +struct hv_input_map_device_interrupt { + u64 partition_id; + u64 device_id; + u64 flags; + struct hv_interrupt_entry logical_interrupt_entry; + struct hv_device_interrupt_descriptor interrupt_descriptor; +} __packed; + +struct hv_output_map_device_interrupt { + struct hv_interrupt_entry interrupt_entry; +} __packed; + +struct hv_input_unmap_device_interrupt { + u64 partition_id; + u64 device_id; + struct hv_interrupt_entry interrupt_entry; +} __packed; + +#define HV_SOURCE_SHADOW_NONE 0x0 +#define HV_SOURCE_SHADOW_BRIDGE_BUS_RANGE 0x1 + #endif -- 2.20.1