stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Nick Meier <nmeier@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joseph Salisbury <joseph.salisbury@canonical.com>
Subject: Re: [PATCH 3.16.y-ckt 48/71] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
Date: Tue, 30 Jun 2015 17:19:47 +0100	[thread overview]
Message-ID: <20150630161947.GA1865@ares> (raw)
In-Reply-To: <1435226570-3669-49-git-send-email-luis.henriques@canonical.com>

On Thu, Jun 25, 2015 at 11:02:27AM +0100, Luis Henriques wrote:
> 3.16.7-ckt14 -stable review patch.  If anyone has any objections, please let me know.
>

As pointed out by Greg, this is actually a new feature that shouldn't
be added to -stable releases.  Thus, I'm dropping this patch and
5ef5b6927f14 ("Drivers: hv: vmbus: Correcting truncation error for
constant HV_CRASH_CTL_CRASH_NOTIFY")

Cheers,
--
Lu�s

> ------------------
> 
> From: Nick Meier <nmeier@microsoft.com>
> 
> commit 96c1d0581d00f7abe033350edb021a9d947d8d81 upstream.
> 
> 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>
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> Signed-off-by: Luis Henriques <luis.henriques@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 c386d8dc7223..64318c03002a 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 4d6b26979fbd..3d2d710744ca 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -35,6 +35,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;
> @@ -43,6 +45,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,
> @@ -711,6 +738,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;

  reply	other threads:[~2015-06-30 16:19 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 10:01 [3.16.y-ckt stable] Linux 3.16.7-ckt14 stable review Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 01/71] iio: adis16400: Report pressure channel scale Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 02/71] iio: adis16400: Use != channel indices for the two voltage channels Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 03/71] iio: adis16400: Compute the scan mask from channel indices Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 04/71] iio: adis16400: Remove unused variable Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 05/71] iio: adis16400: Fix burst mode Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 06/71] iio: adis16400: Fix burst transfer for adis16448 Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 07/71] USB: serial: ftdi_sio: Add support for a Motion Tracker Development Board Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 08/71] iio: adc: twl6030-gpadc: Fix modalias Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 09/71] serial: imx: Fix DMA handling for IDLE condition aborts Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 10/71] usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 11/71] ALSA: usb-audio: Add mic volume fix quirk for Logitech Quickcam Fusion Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 12/71] ozwpan: Use proper check to prevent heap overflow Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 13/71] ozwpan: Use unsigned ints " Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 14/71] ozwpan: divide-by-zero leading to panic Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 15/71] ozwpan: unchecked signed subtraction leads to DoS Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 16/71] n_tty: Fix auditing support for cannonical mode Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 17/71] drm/i915/hsw: Fix workaround for server AUX channel clock divisor Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 18/71] x86/asm/irq: Stop relying on magic JMP behavior for early_idt_handlers Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 19/71] lib: Fix strnlen_user() to not touch memory after specified maximum Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 20/71] Input: elantech - fix detection of touchpads where the revision matches a known rate Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 21/71] ALSA: hda/realtek - Add a fixup for another Acer Aspire 9420 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 22/71] ALSA: usb-audio: add MAYA44 USB+ mixer control names Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 23/71] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 24/71] USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 25/71] Input: elantech - add new icbody type Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 26/71] MIPS: Fix enabling of DEBUG_STACKOVERFLOW Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 27/71] xfrm: fix a race in xfrm_state_lookup_byspi Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 28/71] kconfig: Fix warning "‘jump’ may be used uninitialized" Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 29/71] scripts/sortextable: suppress warning: `relocs_size' may be used uninitialized Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 30/71] thermal: step_wise: Revert optimization Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 31/71] MIPS: KVM: Do not sign extend on unsigned MMIO load Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 32/71] arch/x86/kvm/mmu.c: work around gcc-4.4.4 bug Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 33/71] net: core: Correct an over-stringent device loop detection Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 34/71] net: phy: Allow EEE for all RGMII variants Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 35/71] net: dp83640: fix broken calibration routine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 36/71] net: dp83640: reinforce locking rules Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 37/71] unix/caif: sk_socket can disappear when state is unlocked Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 38/71] xen/netback: Properly initialize credit_bytes Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 39/71] udp: fix behavior of wrong checksums Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 40/71] xen: netback: read hotplug script once at start of day Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 41/71] ipv4/udp: Verify multicast group is ours in upd_v4_early_demux() Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 42/71] bridge: disable softirqs around br_fdb_update to avoid lockup Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 43/71] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 44/71] Btrfs: send, add missing check for dead clone root Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 45/71] Btrfs: send, don't leave without decrementing clone root's send_progress Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 46/71] btrfs: incorrect handling for fiemap_fill_next_extent return Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 47/71] btrfs: cleanup orphans while looking up default subvolume Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 48/71] Drivers: hv: vmbus: Add support for VMBus panic notifier handler Luis Henriques
2015-06-30 16:19   ` Luis Henriques [this message]
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 49/71] Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 50/71] iommu/vt-d: Allow RMRR on graphics devices too Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 51/71] iommu/vt-d: Fix passthrough mode with translation-disabled devices Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 52/71] ata: ahci_mvebu: Fix wrongly set base address for the MBus window setting Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 53/71] virtio_pci: Clear stale cpumask when setting irq affinity Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 54/71] irqchip: sunxi-nmi: Fix off-by-one error in irq iterator Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 55/71] pata_octeon_cf: fix broken build Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 56/71] Input: synaptics - add min/max quirk for Lenovo S540 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 57/71] drm/i915: Fix DDC probe for passive adapters Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 58/71] cfg80211: wext: clear sinfo struct before calling driver Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 59/71] mm/memory_hotplug.c: set zone->wait_table to null after freeing it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 60/71] ring-buffer-benchmark: Fix the wrong sched_priority of producer Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 61/71] block: fix ext_dev_lock lockdep report Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 62/71] iser-target: Fix variable-length response error completion Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 63/71] iser-target: release stale iser connections Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 64/71] ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 65/71] drm/mgag200: Reject non-character-cell-aligned mode widths Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 66/71] crypto: caam - fix uninitialized state->buf_dma field Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 67/71] crypto: caam - improve initalization for context state saves Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 68/71] crypto: caam - fix RNG buffer cache alignment Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 69/71] tracing: Have filter check for balanced ops Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 70/71] drm/radeon: fix freeze for laptop with Turks/Thames GPU Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 71/71] Revert "tools/vm: fix page-flags build" Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150630161947.GA1865@ares \
    --to=luis.henriques@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joseph.salisbury@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nmeier@microsoft.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).