lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b4c2bf69332b8c7bcfb060341d5e9bcdadbe7fd1.1622654100.git.viremana@linux.microsoft.com>
Date:   Wed,  2 Jun 2021 17:20:56 +0000
From:   Vineeth Pillai <viremana@...ux.microsoft.com>
To:     Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
        Wei Liu <wei.liu@...nel.org>,
        Sunil Muthuswamy <sunilmut@...rosoft.com>,
        Michael Kelley <mikelley@...rosoft.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:     Vineeth Pillai <viremana@...ux.microsoft.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org
Subject: [PATCH 11/17] mshv: HvClearVirtualInterrupt hypercall

For HvX64InterruptTypeExtInt interrupts, before asserting a new
interrupt, previous inteerupt's acknowledgment should be cleared
by this hypercall HvClearVirtualInterrupt. (TLFS 10.3.2)

This is to be used in a later patch in this series.

Signed-off-by: Vineeth Pillai <viremana@...ux.microsoft.com>
---
 drivers/hv/hv_call.c              | 20 ++++++++++++++++++++
 drivers/hv/mshv.h                 |  1 +
 include/asm-generic/hyperv-tlfs.h |  1 +
 3 files changed, 22 insertions(+)

diff --git a/drivers/hv/hv_call.c b/drivers/hv/hv_call.c
index 57db3a8ac94a..d5cdbe4e93da 100644
--- a/drivers/hv/hv_call.c
+++ b/drivers/hv/hv_call.c
@@ -743,6 +743,26 @@ int hv_call_translate_virtual_address(
 }
 
 
+int
+hv_call_clear_virtual_interrupt(u64 partition_id)
+{
+	unsigned long flags;
+	int status;
+
+	local_irq_save(flags);
+	status = hv_do_fast_hypercall8(HVCALL_CLEAR_VIRTUAL_INTERRUPT,
+				       partition_id) &
+			HV_HYPERCALL_RESULT_MASK;
+	local_irq_restore(flags);
+
+	if (status != HV_STATUS_SUCCESS) {
+		pr_err("%s: %s\n", __func__, hv_status_to_string(status));
+		return -hv_status_to_errno(status);
+	}
+
+	return 0;
+}
+
 int
 hv_call_create_port(u64 port_partition_id, union hv_port_id port_id,
 		    u64 connection_partition_id,
diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h
index 76cd00fd4b3f..404807c98512 100644
--- a/drivers/hv/mshv.h
+++ b/drivers/hv/mshv.h
@@ -117,6 +117,7 @@ int hv_call_assert_virtual_interrupt(
 		u32 vector,
 		u64 dest_addr,
 		union hv_interrupt_control control);
+int hv_call_clear_virtual_interrupt(u64 partition_id);
 int hv_call_get_vp_state(
 		u32 vp_index,
 		u64 partition_id,
diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h
index 3ed4f532ed57..693d41192e9e 100644
--- a/include/asm-generic/hyperv-tlfs.h
+++ b/include/asm-generic/hyperv-tlfs.h
@@ -159,6 +159,7 @@ struct ms_hyperv_tsc_page {
 #define HVCALL_GET_VP_REGISTERS			0x0050
 #define HVCALL_SET_VP_REGISTERS			0x0051
 #define HVCALL_TRANSLATE_VIRTUAL_ADDRESS	0x0052
+#define HVCALL_CLEAR_VIRTUAL_INTERRUPT		0x0056
 #define HVCALL_DELETE_PORT			0x0058
 #define HVCALL_DISCONNECT_PORT			0x005b
 #define HVCALL_POST_MESSAGE			0x005c
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ