Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2109316pxk; Mon, 14 Sep 2020 05:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpwX5d8eNsBiokFswfyndbZoK1jC6d4ZQ6hBDfZIbO1IxnTQ6vcyML//WahjBB27D4nrNq X-Received: by 2002:a50:d2d1:: with SMTP id q17mr16853998edg.167.1600085523063; Mon, 14 Sep 2020 05:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600085523; cv=none; d=google.com; s=arc-20160816; b=LHYnzTi5CQ1fCBWC44CAJFYRG37gZyC41E39m/KpifsXsgBp/wstn+B6AhSbJnm1HQ m+8YzAQ3Sj6c2Fw0Ry7QjLI+UgqUi6x61KUHkkAMmiJiDmeg59p6t9QtaVi5Biwq9Vvr VXD/Fg2f5Ec2LiurNRmF9hI6LwXIjsm7GvgtYUj8ahwuYw9B3sO2igAi5Q52yUyyp3ei 6EF7yXq+6oxF8XfXeKsNBoP12aS+ZGZlp2RBzpyDhhuTFBGr80GkbgbnZ7idSNrCaqEf njBN6sNbh+chn92EOIUiSi/9D/Moefdfv5Cqvupx/z9Au4v0ZkLGGL8Our9RtY4S/dtC YK1w== 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=3zVgkc0Vpun48hSHnelT6bR/5tr24X+6uZTMKdzP2+o=; b=ufDGtfVhleoAIyKmacScIWRKqOeuGqZs97Q0zaAIEjrYoyzELDzRwolmfuI+wZ8DNd qkBPj8A8rzmW64A4wf2So9UhUvBmI3FdoJ4MGeqp59Bl2lw2YnVREhzZommsSSGRNoeC VYiR2w+TUbhJvOdgRxyonS3C6FJKSh+LAVxisqFy6w4VsC/wVV+5lPy+mcbGov775JFN tt5TYV+XRhIyOKqWavYCwQGOOeZzKfEX8CYfJZWlFGoheD4XOE3hfi9uXXzQbxKZkvpg WozQ2S0myCzC4FvvPvz+pTcTPNw/6vgjExSUCLhi56yCqCshKoiLV8+Ht2sINF0sZ3Jp BWXw== 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 x11si7736883edl.498.2020.09.14.05.11.39; Mon, 14 Sep 2020 05:12:03 -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 S1726172AbgINMHH (ORCPT + 99 others); Mon, 14 Sep 2020 08:07:07 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55579 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgINMEG (ORCPT ); Mon, 14 Sep 2020 08:04:06 -0400 Received: by mail-wm1-f66.google.com with SMTP id d4so5001707wmd.5; Mon, 14 Sep 2020 05:03:17 -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=3zVgkc0Vpun48hSHnelT6bR/5tr24X+6uZTMKdzP2+o=; b=SNwbZw7MRlqlnovIawYuv3vzdU19xIwFJZAg18ZCu0832eIYvi9OwA1DXavWq+ja3a MONYgGwz2h7OXJK+NmBwa29BFwUukK4Ow0onR7udGL4RyfvnAsxuCSfAT2FXupyMZX0f mgTtXbbUYpQ8utxVQAenDRNW7URXrD4vG4gjGJVpGxROFfCjn/5MqXQYvBV5RVkp3lDu MteHWMpZx05sf/RoPR2RB9+tWnAvDPzJqsqxWNa+mRSJEu/ghbaw1SvE2juBoN800wGY XrxjSwBioW/NA1ubI186CAJXi1MQTBK/CcAWNP7uQHX/4xxfuOEGVe4vs3j1Ag2polUO C6ng== X-Gm-Message-State: AOAM5329ErDebPjwqaPFRSb57+7rFmBTZeK7Jioyqikd5nr2pqUobK8m ecsvY4rDQIzJolH/O1p+eRgwO7u6IMk= X-Received: by 2002:a1c:9654:: with SMTP id y81mr14713888wmd.9.1600084780019; Mon, 14 Sep 2020 04:59:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 04:59:39 -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 , 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 RFC v1 14/18] asm-generic/hyperv: import data structures for mapping device interrupts Date: Mon, 14 Sep 2020 11:59:23 +0000 Message-Id: <20200914115928.83184-6-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 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 20d628c1ed50..33210fa9899f 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -559,6 +559,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 faf892ce152d..410e2dd09a84 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 @@ -691,4 +693,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