All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
@ 2015-06-16 20:31 ` Joseph Salisbury
  0 siblings, 0 replies; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:04 UTC (permalink / raw)
  To: kamal.mostafa
  Cc: nmeier, fengguang.wu, gregkh, kys, haiyangz, devel, linux-kernel,
	stable

Hello,

Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.13.y-ckt release.  They were
included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
http://bugs.launchpad.net/bugs/1463584 .


commit 96c1d0581d00f7abe033350edb021a9d947d8d81
Author: Nick Meier <nmeier@microsoft.com>
Date:   Sat Feb 28 11:39:01 2015 -0800

    Drivers: hv: vmbus: Add support for VMBus panic notifier handler

commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13
Author: Nick Meier <nmeier@microsoft.com>
Date:   Wed Mar 18 12:29:24 2015 -0700

    Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY


Commit 96c1d05 does not apply cleanly to v3.13.y-ckt, so I performed a backport, which is
in email 1/1.


Sincerely,

Joseph Salisbury







Nick Meier (2):
  Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  Drivers: hv: vmbus: Correcting truncation error for constant
    HV_CRASH_CTL_CRASH_NOTIFY

 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [3.13.y-ckt][PATCH 1/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  2015-06-16 20:31 ` [v3.14.y][PATCH " Joseph Salisbury
@ 2015-06-16 20:10   ` Joseph Salisbury
  -1 siblings, 0 replies; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:04 UTC (permalink / raw)
  To: kamal.mostafa
  Cc: nmeier, fengguang.wu, gregkh, kys, haiyangz, devel, linux-kernel,
	stable

From: Nick Meier <nmeier@microsoft.com>

BugLink: http://bugs.launchpad.net/bugs/1463584

Hyper-V allows a guest to notify the Hyper-V host that a panic
condition occured.  This notification can include up to five 64
bit values.  These 64 bit values are written into crash MSRs.
Once the data has been written into the crash MSRs, the host is
then notified by writing into a Crash Control MSR.  On the Hyper-V
host, the panic notification data is captured in the Windows Event
log as a 18590 event.

Crash MSRs are defined in appendix H of the Hypervisor Top Level
Functional Specification.  At the time of this patch, v4.0 is the
current functional spec.  The URL for the v4.0 document is:

http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx

Signed-off-by: Nick Meier <nmeier@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index e1bca88..0a63125 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -49,6 +49,17 @@ enum hv_cpuid_function {
 	HVCPUID_IMPLEMENTATION_LIMITS		= 0x40000005,
 };
 
+#define  HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE   0x400
+
+#define HV_X64_MSR_CRASH_P0   0x40000100
+#define HV_X64_MSR_CRASH_P1   0x40000101
+#define HV_X64_MSR_CRASH_P2   0x40000102
+#define HV_X64_MSR_CRASH_P3   0x40000103
+#define HV_X64_MSR_CRASH_P4   0x40000104
+#define HV_X64_MSR_CRASH_CTL  0x40000105
+
+#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000000000000000
+
 /* Define version of the synthetic interrupt controller. */
 #define HV_SYNIC_VERSION		(1)
 
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index ec88c22..0fc7706 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -37,6 +37,8 @@
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
+#include <linux/notifier.h>
+#include <linux/ptrace.h>
 #include "hyperv_vmbus.h"
 
 
@@ -46,6 +48,31 @@ static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
 
+
+int hyperv_panic_event(struct notifier_block *nb,
+			unsigned long event, void *ptr)
+{
+	struct pt_regs *regs;
+
+	regs = current_pt_regs();
+
+	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
+	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
+	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
+	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
+	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
+
+	/*
+	 * Let Hyper-V know there is crash data available
+	 */
+	wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY);
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block hyperv_panic_block = {
+	.notifier_call = hyperv_panic_event,
+};
+
 struct resource hyperv_mmio = {
 	.name  = "hyperv mmio",
 	.flags = IORESOURCE_MEM,
@@ -755,6 +782,14 @@ static int vmbus_bus_init(int irq)
 	if (ret)
 		goto err_alloc;
 
+	/*
+	 * Only register if the crash MSRs are available
+	 */
+	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		atomic_notifier_chain_register(&panic_notifier_list,
+					       &hyperv_panic_block);
+	}
+
 	vmbus_request_offers();
 
 	return 0;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [3.13.y-ckt][PATCH 1/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
@ 2015-06-16 20:10   ` Joseph Salisbury
  0 siblings, 0 replies; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:10 UTC (permalink / raw)
  To: kamal.mostafa
  Cc: nmeier, fengguang.wu, gregkh, kys, haiyangz, devel, linux-kernel,
	stable

From: Nick Meier <nmeier@microsoft.com>

BugLink: http://bugs.launchpad.net/bugs/1463584

Hyper-V allows a guest to notify the Hyper-V host that a panic
condition occured.  This notification can include up to five 64
bit values.  These 64 bit values are written into crash MSRs.
Once the data has been written into the crash MSRs, the host is
then notified by writing into a Crash Control MSR.  On the Hyper-V
host, the panic notification data is captured in the Windows Event
log as a 18590 event.

Crash MSRs are defined in appendix H of the Hypervisor Top Level
Functional Specification.  At the time of this patch, v4.0 is the
current functional spec.  The URL for the v4.0 document is:

http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx

Signed-off-by: Nick Meier <nmeier@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index e1bca88..0a63125 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -49,6 +49,17 @@ enum hv_cpuid_function {
 	HVCPUID_IMPLEMENTATION_LIMITS		= 0x40000005,
 };
 
+#define  HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE   0x400
+
+#define HV_X64_MSR_CRASH_P0   0x40000100
+#define HV_X64_MSR_CRASH_P1   0x40000101
+#define HV_X64_MSR_CRASH_P2   0x40000102
+#define HV_X64_MSR_CRASH_P3   0x40000103
+#define HV_X64_MSR_CRASH_P4   0x40000104
+#define HV_X64_MSR_CRASH_CTL  0x40000105
+
+#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000000000000000
+
 /* Define version of the synthetic interrupt controller. */
 #define HV_SYNIC_VERSION		(1)
 
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index ec88c22..0fc7706 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -37,6 +37,8 @@
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
+#include <linux/notifier.h>
+#include <linux/ptrace.h>
 #include "hyperv_vmbus.h"
 
 
@@ -46,6 +48,31 @@ static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
 
+
+int hyperv_panic_event(struct notifier_block *nb,
+			unsigned long event, void *ptr)
+{
+	struct pt_regs *regs;
+
+	regs = current_pt_regs();
+
+	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
+	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
+	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
+	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
+	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
+
+	/*
+	 * Let Hyper-V know there is crash data available
+	 */
+	wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY);
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block hyperv_panic_block = {
+	.notifier_call = hyperv_panic_event,
+};
+
 struct resource hyperv_mmio = {
 	.name  = "hyperv mmio",
 	.flags = IORESOURCE_MEM,
@@ -755,6 +782,14 @@ static int vmbus_bus_init(int irq)
 	if (ret)
 		goto err_alloc;
 
+	/*
+	 * Only register if the crash MSRs are available
+	 */
+	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		atomic_notifier_chain_register(&panic_notifier_list,
+					       &hyperv_panic_block);
+	}
+
 	vmbus_request_offers();
 
 	return 0;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 1/1]Drivers: hv: vmbus: Add support for VMBus panic notifier handler
       [not found] ` <cover.1434395983.git.joseph.salisbury@canonical.com>
@ 2015-06-16 20:22   ` Joseph Salisbury
  2015-06-27  0:47     ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:22 UTC (permalink / raw)
  To: luis.henriques, kamal.mostafa, sasha.levin, gregkh
  Cc: nmeier, fengguang.wu, kys, haiyangz, devel, linux-kernel, stable

From: Nick Meier <nmeier@microsoft.com>

BugLink: http://bugs.launchpad.net/bugs/1463584

Hyper-V allows a guest to notify the Hyper-V host that a panic
condition occured.  This notification can include up to five 64
bit values.  These 64 bit values are written into crash MSRs.
Once the data has been written into the crash MSRs, the host is
then notified by writing into a Crash Control MSR.  On the Hyper-V
host, the panic notification data is captured in the Windows Event
log as a 18590 event.

Crash MSRs are defined in appendix H of the Hypervisor Top Level
Functional Specification.  At the time of this patch, v4.0 is the
current functional spec.  The URL for the v4.0 document is:

http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx

Signed-off-by: Nick Meier <nmeier@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(Backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 44b1c94..e54825c 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -49,6 +49,17 @@ enum hv_cpuid_function {
 	HVCPUID_IMPLEMENTATION_LIMITS		= 0x40000005,
 };
 
+#define  HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE   0x400
+
+#define HV_X64_MSR_CRASH_P0   0x40000100
+#define HV_X64_MSR_CRASH_P1   0x40000101
+#define HV_X64_MSR_CRASH_P2   0x40000102
+#define HV_X64_MSR_CRASH_P3   0x40000103
+#define HV_X64_MSR_CRASH_P4   0x40000104
+#define HV_X64_MSR_CRASH_CTL  0x40000105
+
+#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000000000000000
+
 /* Define version of the synthetic interrupt controller. */
 #define HV_SYNIC_VERSION		(1)
 
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 35e3f42..c28e225 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -36,6 +36,8 @@
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
+#include <linux/notifier.h>
+#include <linux/ptrace.h>
 #include "hyperv_vmbus.h"
 
 static struct acpi_device  *hv_acpi_dev;
@@ -44,6 +46,31 @@ static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
 
+
+int hyperv_panic_event(struct notifier_block *nb,
+			unsigned long event, void *ptr)
+{
+	struct pt_regs *regs;
+
+	regs = current_pt_regs();
+
+	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
+	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
+	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
+	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
+	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
+
+	/*
+	 * Let Hyper-V know there is crash data available
+	 */
+	wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY);
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block hyperv_panic_block = {
+	.notifier_call = hyperv_panic_event,
+};
+
 struct resource hyperv_mmio = {
 	.name  = "hyperv mmio",
 	.flags = IORESOURCE_MEM,
@@ -744,6 +771,14 @@ static int vmbus_bus_init(int irq)
 	if (ret)
 		goto err_alloc;
 
+	/*
+	 * Only register if the crash MSRs are available
+	 */
+	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		atomic_notifier_chain_register(&panic_notifier_list,
+					       &hyperv_panic_block);
+	}
+
 	vmbus_request_offers();
 
 	return 0;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [v3.14.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
@ 2015-06-16 20:31 ` Joseph Salisbury
  0 siblings, 0 replies; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:31 UTC (permalink / raw)
  To: gregkh; +Cc: nmeier, fengguang.wu, kys, haiyangz, devel, linux-kernel, stable

Hello,

Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.14.y release.  They were
included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
http://bugs.launchpad.net/bugs/1463584 .


commit 96c1d0581d00f7abe033350edb021a9d947d8d81
Author: Nick Meier <nmeier@microsoft.com>
Date:   Sat Feb 28 11:39:01 2015 -0800

    Drivers: hv: vmbus: Add support for VMBus panic notifier handler

commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13
Author: Nick Meier <nmeier@microsoft.com>
Date:   Wed Mar 18 12:29:24 2015 -0700

    Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY


Commit 96c1d05 does not apply cleanly to v3.14.y, so I performed a backport, which is
in email 1/1.


Sincerely,

Joseph Salisbury







Nick Meier (2):
  Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  Drivers: hv: vmbus: Correcting truncation error for constant
    HV_CRASH_CTL_CRASH_NOTIFY

 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [v3.14.y][PATCH 1/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
       [not found] ` <cover.1434486527.git.joseph.salisbury@canonical.com>
@ 2015-06-16 20:31   ` Joseph Salisbury
  2015-06-16 20:39     ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:31 UTC (permalink / raw)
  To: gregkh; +Cc: nmeier, fengguang.wu, kys, haiyangz, devel, linux-kernel, stable

From: Nick Meier <nmeier@microsoft.com>


Hyper-V allows a guest to notify the Hyper-V host that a panic
condition occured.  This notification can include up to five 64
bit values.  These 64 bit values are written into crash MSRs.
Once the data has been written into the crash MSRs, the host is
then notified by writing into a Crash Control MSR.  On the Hyper-V
host, the panic notification data is captured in the Windows Event
log as a 18590 event.

Crash MSRs are defined in appendix H of the Hypervisor Top Level
Functional Specification.  At the time of this patch, v4.0 is the
current functional spec.  The URL for the v4.0 document is:

http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx

Signed-off-by: Nick Meier <nmeier@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>

Conflicts:
	drivers/hv/vmbus_drv.c
---
 drivers/hv/hyperv_vmbus.h | 11 +++++++++++
 drivers/hv/vmbus_drv.c    | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index e055176..3f39c73 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -49,6 +49,17 @@ enum hv_cpuid_function {
 	HVCPUID_IMPLEMENTATION_LIMITS		= 0x40000005,
 };
 
+#define  HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE   0x400
+
+#define HV_X64_MSR_CRASH_P0   0x40000100
+#define HV_X64_MSR_CRASH_P1   0x40000101
+#define HV_X64_MSR_CRASH_P2   0x40000102
+#define HV_X64_MSR_CRASH_P3   0x40000103
+#define HV_X64_MSR_CRASH_P4   0x40000104
+#define HV_X64_MSR_CRASH_CTL  0x40000105
+
+#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000000000000000
+
 /* Define version of the synthetic interrupt controller. */
 #define HV_SYNIC_VERSION		(1)
 
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 077bb1b..66168c3 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -36,6 +36,8 @@
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
+#include <linux/notifier.h>
+#include <linux/ptrace.h>
 #include "hyperv_vmbus.h"
 
 static struct acpi_device  *hv_acpi_dev;
@@ -44,6 +46,36 @@ static struct tasklet_struct msg_dpc;
 static struct completion probe_event;
 static int irq;
 
+int hyperv_panic_event(struct notifier_block *nb,
+			unsigned long event, void *ptr)
+{
+	struct pt_regs *regs;
+
+	regs = current_pt_regs();
+
+	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
+	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
+	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
+	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
+	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
+
+	/*
+	 * Let Hyper-V know there is crash data available
+	 */
+	wrmsrl(HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY);
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block hyperv_panic_block = {
+	.notifier_call = hyperv_panic_event,
+};
+
+struct resource hyperv_mmio = {
+	.name  = "hyperv mmio",
+	.flags = IORESOURCE_MEM,
+};
+EXPORT_SYMBOL_GPL(hyperv_mmio);
+
 static int vmbus_exists(void)
 {
 	if (hv_acpi_dev == NULL)
@@ -747,6 +779,14 @@ static int vmbus_bus_init(int irq)
 	if (ret)
 		goto err_alloc;
 
+	/*
+	 * Only register if the crash MSRs are available
+	 */
+	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+		atomic_notifier_chain_register(&panic_notifier_list,
+					       &hyperv_panic_block);
+	}
+
 	vmbus_request_offers();
 
 	return 0;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [v3.14.y][PATCH 1/1] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  2015-06-16 20:31   ` [v3.14.y][PATCH 1/1] Drivers: " Joseph Salisbury
@ 2015-06-16 20:39     ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2015-06-16 20:39 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: fengguang.wu, haiyangz, linux-kernel, stable, nmeier, devel

On Tue, Jun 16, 2015 at 04:31:38PM -0400, Joseph Salisbury wrote:
> From: Nick Meier <nmeier@microsoft.com>
> 
> 
> Hyper-V allows a guest to notify the Hyper-V host that a panic
> condition occured.  This notification can include up to five 64
> bit values.  These 64 bit values are written into crash MSRs.
> Once the data has been written into the crash MSRs, the host is
> then notified by writing into a Crash Control MSR.  On the Hyper-V
> host, the panic notification data is captured in the Windows Event
> log as a 18590 event.
> 
> Crash MSRs are defined in appendix H of the Hypervisor Top Level
> Functional Specification.  At the time of this patch, v4.0 is the
> current functional spec.  The URL for the v4.0 document is:
> 
> http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx
> 
> Signed-off-by: Nick Meier <nmeier@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> (backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> 
> Conflicts:
> 	drivers/hv/vmbus_drv.c

What are these two lines doing here?

Please remove and resend.

Also, what about 4.0 and other kernels, should this patch go there as
well?  If so, just say "please add commit id XXXXXX to these kernels",
that's all that is needed if no patch changes are required.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
  2015-06-16 20:31 ` [v3.14.y][PATCH " Joseph Salisbury
                   ` (3 preceding siblings ...)
  (?)
@ 2015-06-16 20:41 ` Greg KH
  2015-06-16 20:49   ` Joseph Salisbury
  -1 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2015-06-16 20:41 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: kamal.mostafa, nmeier, fengguang.wu, kys, haiyangz, devel,
	linux-kernel, stable

On Tue, Jun 16, 2015 at 04:10:46PM -0400, Joseph Salisbury wrote:
> Hello,
> 
> Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
> 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.13.y-ckt release.  They were
> included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
> http://bugs.launchpad.net/bugs/1463584 .

Multiple messages sent with the same message-id, yet different subjects
and content.  That's a sure way to have your messages dropped into a
spam folder...

Please fix your way of submitting these and resend properly.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
  2015-06-16 20:41 ` [3.13.y-ckt][PATCH 0/1][Hyper-V] " Greg KH
@ 2015-06-16 20:49   ` Joseph Salisbury
  0 siblings, 0 replies; 14+ messages in thread
From: Joseph Salisbury @ 2015-06-16 20:49 UTC (permalink / raw)
  To: Greg KH
  Cc: kamal.mostafa, nmeier, fengguang.wu, kys, haiyangz, devel,
	linux-kernel, stable

On 06/16/2015 04:41 PM, Greg KH wrote:
> On Tue, Jun 16, 2015 at 04:10:46PM -0400, Joseph Salisbury wrote:
>> Hello,
>>
>> Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
>> 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.13.y-ckt release.  They were
>> included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
>> http://bugs.launchpad.net/bugs/1463584 .
> Multiple messages sent with the same message-id, yet different subjects
> and content.  That's a sure way to have your messages dropped into a
> spam folder...
>
> Please fix your way of submitting these and resend properly.
>
> thanks,
>
> greg k-h

Thanks for the feedback.  I'll fix things up and resend for all the
stable kernels.

Thanks,

Joe

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
  2015-06-16 20:31 ` [v3.14.y][PATCH " Joseph Salisbury
@ 2015-06-17 14:50   ` Luis Henriques
  -1 siblings, 0 replies; 14+ messages in thread
From: Luis Henriques @ 2015-06-17 14:50 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: kamal.mostafa, sasha.levin, gregkh, nmeier, fengguang.wu, kys,
	haiyangz, devel, linux-kernel, stable

On Tue, Jun 16, 2015 at 04:22:11PM -0400, Joseph Salisbury wrote:
> Hello,
> 
> Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
> 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.16.y-ckt, v3.18.y, v3.19.y-ckt and v4.0.y releases.  
> They were included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
> http://bugs.launchpad.net/bugs/1463584 .
> 

Thanks Joseph, I'll queue both commits (using your backport) for the
3.16 kernel.

Cheers,
--
Luís


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
@ 2015-06-17 14:50   ` Luis Henriques
  0 siblings, 0 replies; 14+ messages in thread
From: Luis Henriques @ 2015-06-17 14:50 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: kamal.mostafa, sasha.levin, gregkh, nmeier, fengguang.wu, kys,
	haiyangz, devel, linux-kernel, stable

On Tue, Jun 16, 2015 at 04:22:11PM -0400, Joseph Salisbury wrote:
> Hello,
> 
> Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
> 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.16.y-ckt, v3.18.y, v3.19.y-ckt and v4.0.y releases.  
> They were included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
> http://bugs.launchpad.net/bugs/1463584 .
> 

Thanks Joseph, I'll queue both commits (using your backport) for the
3.16 kernel.

Cheers,
--
Lu�s


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler
  2015-06-16 20:31 ` [v3.14.y][PATCH " Joseph Salisbury
                   ` (5 preceding siblings ...)
  (?)
@ 2015-06-17 18:22 ` Kamal Mostafa
  -1 siblings, 0 replies; 14+ messages in thread
From: Kamal Mostafa @ 2015-06-17 18:22 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: luis.henriques, kamal.mostafa, sasha.levin, gregkh, nmeier,
	fengguang.wu, kys, haiyangz, devel, linux-kernel, stable

On Tue, 2015-06-16 at 16:22 -0400, Joseph Salisbury wrote:
> Hello,
> 
> Please consider including upstream commits 96c1d0581d00f7abe033350edb021a9d947d8d81 and
> 5ef5b6927f14f29cacd78fa1fb861661a5367f13 in the next v3.16.y-ckt, v3.18.y, v3.19.y-ckt and v4.0.y releases.  
> They were included mainline as of v4.1-rc1.  They have been tested and confirmed to resolve
> http://bugs.launchpad.net/bugs/1463584 .
> 
> 
> commit 96c1d0581d00f7abe033350edb021a9d947d8d81
> Author: Nick Meier <nmeier@microsoft.com>
> Date:   Sat Feb 28 11:39:01 2015 -0800
> 
>     Drivers: hv: vmbus: Add support for VMBus panic notifier handler
> 
> commit 5ef5b6927f14f29cacd78fa1fb861661a5367f13
> Author: Nick Meier <nmeier@microsoft.com>
> Date:   Wed Mar 18 12:29:24 2015 -0700
> 
>     Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY
> 
> 
> Commit 96c1d05 does not cherry-pick cleanly, so I performed a backport, which is
> in email 1/1.

Thanks Joseph!  Queued up for 3.19-stable.

 -Kamal



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 1/1]Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  2015-06-16 20:22   ` [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 1/1]Drivers: " Joseph Salisbury
@ 2015-06-27  0:47     ` Greg KH
  2015-06-30 15:20       ` Kamal Mostafa
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2015-06-27  0:47 UTC (permalink / raw)
  To: Joseph Salisbury
  Cc: luis.henriques, kamal.mostafa, sasha.levin, fengguang.wu,
	haiyangz, linux-kernel, stable, nmeier, devel

On Tue, Jun 16, 2015 at 04:22:12PM -0400, Joseph Salisbury wrote:
> From: Nick Meier <nmeier@microsoft.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1463584
> 
> Hyper-V allows a guest to notify the Hyper-V host that a panic
> condition occured.  This notification can include up to five 64
> bit values.  These 64 bit values are written into crash MSRs.
> Once the data has been written into the crash MSRs, the host is
> then notified by writing into a Crash Control MSR.  On the Hyper-V
> host, the panic notification data is captured in the Windows Event
> log as a 18590 event.
> 
> Crash MSRs are defined in appendix H of the Hypervisor Top Level
> Functional Specification.  At the time of this patch, v4.0 is the
> current functional spec.  The URL for the v4.0 document is:
> 
> http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx
> 
> Signed-off-by: Nick Meier <nmeier@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> (Backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  drivers/hv/hyperv_vmbus.h | 11 +++++++++++
>  drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 46 insertions(+)

This is a new feature, why should it be added to -stable releases?

Sorry, not going to take it, upgrade to 4.1 if you want this feature.

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 1/1]Drivers: hv: vmbus: Add support for VMBus panic notifier handler
  2015-06-27  0:47     ` Greg KH
@ 2015-06-30 15:20       ` Kamal Mostafa
  0 siblings, 0 replies; 14+ messages in thread
From: Kamal Mostafa @ 2015-06-30 15:20 UTC (permalink / raw)
  To: Joseph Salisbury, Greg KH, Sasha Levin
  Cc: Luis Henriques, fengguang.wu, haiyangz, linux-kernel, stable,
	nmeier, devel

On Fri, 2015-06-26 at 17:47 -0700, Greg KH wrote:
> On Tue, Jun 16, 2015 at 04:22:12PM -0400, Joseph Salisbury wrote:
> > From: Nick Meier <nmeier@microsoft.com>
> > 
> > BugLink: http://bugs.launchpad.net/bugs/1463584
> > 
> > Hyper-V allows a guest to notify the Hyper-V host that a panic
> > condition occured.  This notification can include up to five 64
> > bit values.  These 64 bit values are written into crash MSRs.
> > Once the data has been written into the crash MSRs, the host is
> > then notified by writing into a Crash Control MSR.  On the Hyper-V
> > host, the panic notification data is captured in the Windows Event
> > log as a 18590 event.
> > 
> > Crash MSRs are defined in appendix H of the Hypervisor Top Level
> > Functional Specification.  At the time of this patch, v4.0 is the
> > current functional spec.  The URL for the v4.0 document is:
> > 
> > http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor Top Level Functional Specification v4.0.docx
> > 
> > Signed-off-by: Nick Meier <nmeier@microsoft.com>
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > (Backported from commit 96c1d0581d00f7abe033350edb021a9d947d8d81)
> > Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> > ---
> >  drivers/hv/hyperv_vmbus.h | 11 +++++++++++
> >  drivers/hv/vmbus_drv.c    | 35 +++++++++++++++++++++++++++++++++++
> >  2 files changed, 46 insertions(+)
> 
> This is a new feature, why should it be added to -stable releases?
> 
> Sorry, not going to take it, upgrade to 4.1 if you want this feature.
> 
> greg k-h

Greg is right: this isn't suitable for stable, so Luís and I will also
drop/revert these from the -ckt stable kernels (3.13, 3.16, and 3.19):

        Drivers: hv: vmbus: Add support for VMBus panic notifier handler
        Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY

Sasha, it looks like you've already dropped them from 3.18 but heads-up
just in case.

Thanks Greg!

 -Kamal


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-06-30 15:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 20:04 [3.13.y-ckt][PATCH 0/1][Hyper-V] Add support for VMBus panic notifier handler Joseph Salisbury
2015-06-16 20:31 ` [v3.14.y][PATCH " Joseph Salisbury
2015-06-16 20:04 ` [3.13.y-ckt][PATCH 1/1] Drivers: hv: vmbus: " Joseph Salisbury
2015-06-16 20:10   ` Joseph Salisbury
     [not found] ` <cover.1434395983.git.joseph.salisbury@canonical.com>
2015-06-16 20:22   ` [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH 1/1]Drivers: " Joseph Salisbury
2015-06-27  0:47     ` Greg KH
2015-06-30 15:20       ` Kamal Mostafa
     [not found] ` <cover.1434486527.git.joseph.salisbury@canonical.com>
2015-06-16 20:31   ` [v3.14.y][PATCH 1/1] Drivers: " Joseph Salisbury
2015-06-16 20:39     ` Greg KH
2015-06-16 20:41 ` [3.13.y-ckt][PATCH 0/1][Hyper-V] " Greg KH
2015-06-16 20:49   ` Joseph Salisbury
2015-06-17 14:50 ` [v3.16.y-ckt][v3.18.y][v3.19.y-ckt][v4.0.y][PATCH " Luis Henriques
2015-06-17 14:50   ` Luis Henriques
2015-06-17 18:22 ` Kamal Mostafa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.