All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes
@ 2017-10-06  0:33 kys
  2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
  2017-10-20 13:28 ` [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes Greg KH
  0 siblings, 2 replies; 9+ messages in thread
From: kys @ 2017-10-06  0:33 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin
  Cc: K. Y. Srinivasan

From: "K. Y. Srinivasan" <kys@microsoft.com>

Miscellaneous enhancements and fixes.

K. Y. Srinivasan (1):
  Drivers: hv: vmbus: Make pannic reporting to be more useful

Stephen Hemminger (2):
  Drivers: hv: vmbus: Expose per-channel interrupts and events counters
  vmbus: initialize reserved fields in messages

 Documentation/ABI/stable/sysfs-bus-vmbus | 14 ++++++++++++++
 arch/x86/hyperv/hv_init.c                | 11 +++++++----
 arch/x86/include/asm/mshyperv.h          |  2 +-
 drivers/hv/channel.c                     |  2 ++
 drivers/hv/connection.c                  |  2 ++
 drivers/hv/vmbus_drv.c                   | 22 ++++++++++++++++++++--
 include/linux/hyperv.h                   |  4 ++++
 7 files changed, 50 insertions(+), 7 deletions(-)

-- 
2.14.1

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

* [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters
  2017-10-06  0:33 [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes kys
@ 2017-10-06  0:35 ` kys
  2017-10-06  0:35   ` [PATCH 2/3] vmbus: initialize reserved fields in messages kys
                     ` (2 more replies)
  2017-10-20 13:28 ` [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes Greg KH
  1 sibling, 3 replies; 9+ messages in thread
From: kys @ 2017-10-06  0:35 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin
  Cc: Stephen Hemminger, K . Y . Srinivasan

From: Stephen Hemminger <stephen@networkplumber.org>

When investigating performance, it is useful to be able to look at
the number of host and guest events per-channel. This is equivalent
to per-device interrupt statistics.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 Documentation/ABI/stable/sysfs-bus-vmbus | 14 ++++++++++++++
 drivers/hv/connection.c                  |  2 ++
 drivers/hv/vmbus_drv.c                   | 18 ++++++++++++++++++
 include/linux/hyperv.h                   |  4 ++++
 4 files changed, 38 insertions(+)

diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus b/Documentation/ABI/stable/sysfs-bus-vmbus
index 0ebd8a1537a0..d4eca1717adb 100644
--- a/Documentation/ABI/stable/sysfs-bus-vmbus
+++ b/Documentation/ABI/stable/sysfs-bus-vmbus
@@ -97,3 +97,17 @@ KernelVersion:	4.14
 Contact:	Stephen Hemminger <sthemmin@microsoft.com>
 Description:	Bytes availabble to write
 Users:		Debuggig tools
+
+What:		/sys/bus/vmbus/devices/vmbus_*/channels/relid/events
+Date:		September. 2017
+KernelVersion:	4.14
+Contact:	Stephen Hemminger <sthemmin@microsoft.com>
+Description:	Number of times we have signaled the host
+Users:		Debuggig tools
+
+What:		/sys/bus/vmbus/devices/vmbus_*/channels/relid/interrupts
+Date:		September. 2017
+KernelVersion:	4.14
+Contact:	Stephen Hemminger <sthemmin@microsoft.com>
+Description:	Number of times we have taken an interrupt (incoming)
+Users:		Debuggig tools
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index f41901f80b64..b06a6b796819 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -409,6 +409,8 @@ void vmbus_set_event(struct vmbus_channel *channel)
 	if (!channel->is_dedicated_interrupt)
 		vmbus_send_interrupt(child_relid);
 
+	++channel->sig_events;
+
 	hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event);
 }
 EXPORT_SYMBOL_GPL(vmbus_set_event);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index a209527b09f5..e8cd19095212 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -945,6 +945,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu)
 			if (channel->rescind)
 				continue;
 
+			++channel->interrupts;
+
 			switch (channel->callback_mode) {
 			case HV_CALL_ISR:
 				vmbus_channel_isr(channel);
@@ -1238,6 +1240,20 @@ static ssize_t channel_latency_show(const struct vmbus_channel *channel,
 }
 VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL);
 
+static ssize_t channel_interrupts_show(const struct vmbus_channel *channel, char *buf)
+{
+	return sprintf(buf, "%u\n", channel->interrupts);
+}
+VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL);
+
+static ssize_t channel_events_show(const struct vmbus_channel *channel, char *buf)
+{
+	return sprintf(buf, "%u\n", channel->sig_events);
+}
+VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
+
+
+
 static struct attribute *vmbus_chan_attrs[] = {
 	&chan_attr_out_mask.attr,
 	&chan_attr_in_mask.attr,
@@ -1246,6 +1262,8 @@ static struct attribute *vmbus_chan_attrs[] = {
 	&chan_attr_cpu.attr,
 	&chan_attr_pending.attr,
 	&chan_attr_latency.attr,
+	&chan_attr_interrupts.attr,
+	&chan_attr_events.attr,
 	NULL
 };
 
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index ef16ee039850..1b7e15d22f58 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -719,6 +719,10 @@ struct vmbus_channel {
 
 	struct vmbus_close_msg close_msg;
 
+	/* Statistics */
+	unsigned int	interrupts;	/* Host to Guest interrupts */
+	unsigned int	sig_events;	/* Guest to Host events */
+
 	/* Channel callback's invoked in softirq context */
 	struct tasklet_struct callback_event;
 	void (*onchannel_callback)(void *context);
-- 
2.14.1

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

* [PATCH 2/3] vmbus: initialize reserved fields in messages
  2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
@ 2017-10-06  0:35   ` kys
  2017-10-06  0:35   ` [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful kys
  2017-10-20 13:27   ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters Greg KH
  2 siblings, 0 replies; 9+ messages in thread
From: kys @ 2017-10-06  0:35 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin
  Cc: Stephen Hemminger, K . Y . Srinivasan

From: Stephen Hemminger <stephen@networkplumber.org>

Make sure and initialize reserved fields in messages to host,
rather than passing stack junk.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/channel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index efd5db743319..9f48f454bde0 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -745,6 +745,7 @@ int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
 	desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
 	desc.length8 = (u16)(packetlen_aligned >> 3);
 	desc.transactionid = requestid;
+	desc.reserved = 0;
 	desc.rangecount = pagecount;
 
 	for (i = 0; i < pagecount; i++) {
@@ -788,6 +789,7 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
 	desc->dataoffset8 = desc_size >> 3; /* in 8-bytes granularity */
 	desc->length8 = (u16)(packetlen_aligned >> 3);
 	desc->transactionid = requestid;
+	desc->reserved = 0;
 	desc->rangecount = 1;
 
 	bufferlist[0].iov_base = desc;
-- 
2.14.1

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

* [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful
  2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
  2017-10-06  0:35   ` [PATCH 2/3] vmbus: initialize reserved fields in messages kys
@ 2017-10-06  0:35   ` kys
  2017-10-12 13:39     ` Vitaly Kuznetsov
  2017-10-20 13:27   ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters Greg KH
  2 siblings, 1 reply; 9+ messages in thread
From: kys @ 2017-10-06  0:35 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin
  Cc: K. Y. Srinivasan

From: "K. Y. Srinivasan" <kys@microsoft.com>

Hyper-V allows the guest to report panic and the guest can pass additional
information. All this is logged on the host. Currently Linux is passing back
information that is not particularly useful. Make the following changes:

1. Windows uses crash MSR P0 to report bugcheck code. Follow the same
convention for Linux as well.
2. It will be useful to know the gust ID of the Linux guest that has
paniced. Pass back this information.

These changes will help in better supporting Linux on Hyper-V

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 arch/x86/hyperv/hv_init.c       | 11 +++++++----
 arch/x86/include/asm/mshyperv.h |  2 +-
 drivers/hv/vmbus_drv.c          |  4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 1a8eb550c40f..cc30a094fb7c 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -205,9 +205,10 @@ void hyperv_cleanup(void)
 }
 EXPORT_SYMBOL_GPL(hyperv_cleanup);
 
-void hyperv_report_panic(struct pt_regs *regs)
+void hyperv_report_panic(struct pt_regs *regs, long err)
 {
 	static bool panic_reported;
+	u64 guest_id;
 
 	/*
 	 * We prefer to report panic on 'die' chain as we have proper
@@ -218,9 +219,11 @@ void hyperv_report_panic(struct pt_regs *regs)
 		return;
 	panic_reported = true;
 
-	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
-	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
-	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
+	rdmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
+
+	wrmsrl(HV_X64_MSR_CRASH_P0, err);
+	wrmsrl(HV_X64_MSR_CRASH_P1, guest_id);
+	wrmsrl(HV_X64_MSR_CRASH_P2, regs->ip);
 	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
 	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
 
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 63cc96f064dc..dd2dc54ddf20 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -311,7 +311,7 @@ static inline int hv_cpu_number_to_vp_number(int cpu_number)
 void hyperv_init(void);
 void hyperv_setup_mmu_ops(void);
 void hyper_alloc_mmu(void);
-void hyperv_report_panic(struct pt_regs *regs);
+void hyperv_report_panic(struct pt_regs *regs, long err);
 bool hv_is_hypercall_page_setup(void);
 void hyperv_cleanup(void);
 #else /* CONFIG_HYPERV */
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index e8cd19095212..852f6c628836 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -65,7 +65,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
 
 	regs = current_pt_regs();
 
-	hyperv_report_panic(regs);
+	hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
 
@@ -75,7 +75,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
 	struct die_args *die = (struct die_args *)args;
 	struct pt_regs *regs = die->regs;
 
-	hyperv_report_panic(regs);
+	hyperv_report_panic(regs, val);
 	return NOTIFY_DONE;
 }
 
-- 
2.14.1

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

* Re: [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful
  2017-10-06  0:35   ` [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful kys
@ 2017-10-12 13:39     ` Vitaly Kuznetsov
  2017-10-12 15:06       ` KY Srinivasan
  0 siblings, 1 reply; 9+ messages in thread
From: Vitaly Kuznetsov @ 2017-10-12 13:39 UTC (permalink / raw)
  To: kys
  Cc: gregkh, linux-kernel, devel, olaf, apw, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin, kys

kys@exchange.microsoft.com writes:

> From: "K. Y. Srinivasan" <kys@microsoft.com>
>
> Hyper-V allows the guest to report panic and the guest can pass additional
> information. All this is logged on the host. Currently Linux is passing back
> information that is not particularly useful. Make the following changes:
>
> 1. Windows uses crash MSR P0 to report bugcheck code. Follow the same
> convention for Linux as well.
> 2. It will be useful to know the gust ID of the Linux guest that has
> paniced. Pass back this information.
>
> These changes will help in better supporting Linux on Hyper-V
>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  arch/x86/hyperv/hv_init.c       | 11 +++++++----
>  arch/x86/include/asm/mshyperv.h |  2 +-
>  drivers/hv/vmbus_drv.c          |  4 ++--
>  3 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index 1a8eb550c40f..cc30a094fb7c 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -205,9 +205,10 @@ void hyperv_cleanup(void)
>  }
>  EXPORT_SYMBOL_GPL(hyperv_cleanup);
>
> -void hyperv_report_panic(struct pt_regs *regs)
> +void hyperv_report_panic(struct pt_regs *regs, long err)
>  {
>  	static bool panic_reported;
> +	u64 guest_id;
>
>  	/*
>  	 * We prefer to report panic on 'die' chain as we have proper
> @@ -218,9 +219,11 @@ void hyperv_report_panic(struct pt_regs *regs)
>  		return;
>  	panic_reported = true;
>
> -	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
> -	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
> -	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
> +	rdmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
> +
> +	wrmsrl(HV_X64_MSR_CRASH_P0, err);
> +	wrmsrl(HV_X64_MSR_CRASH_P1, guest_id);

This is a constant we write in hyperv_init() (0x810000040e000000 for
Linux guests). Do I get it right that we need this to basically
distinguigh Windows guests crashes from Linux guest crashes in the log?

> +	wrmsrl(HV_X64_MSR_CRASH_P2, regs->ip);
>  	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
>  	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);

We don't write ax and bx any more but write cx and dx. Not that I see
these regs really useful in the log but I'd change these to ax and bx
for consistency. Or mayme make it sp and ax?

>
> diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
> index 63cc96f064dc..dd2dc54ddf20 100644
> --- a/arch/x86/include/asm/mshyperv.h
> +++ b/arch/x86/include/asm/mshyperv.h
> @@ -311,7 +311,7 @@ static inline int hv_cpu_number_to_vp_number(int cpu_number)
>  void hyperv_init(void);
>  void hyperv_setup_mmu_ops(void);
>  void hyper_alloc_mmu(void);
> -void hyperv_report_panic(struct pt_regs *regs);
> +void hyperv_report_panic(struct pt_regs *regs, long err);
>  bool hv_is_hypercall_page_setup(void);
>  void hyperv_cleanup(void);
>  #else /* CONFIG_HYPERV */
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index e8cd19095212..852f6c628836 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -65,7 +65,7 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val,
>
>  	regs = current_pt_regs();
>
> -	hyperv_report_panic(regs);
> +	hyperv_report_panic(regs, val);
>  	return NOTIFY_DONE;
>  }
>
> @@ -75,7 +75,7 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
>  	struct die_args *die = (struct die_args *)args;
>  	struct pt_regs *regs = die->regs;
>
> -	hyperv_report_panic(regs);
> +	hyperv_report_panic(regs, val);
>  	return NOTIFY_DONE;
>  }

-- 
  Vitaly

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

* RE: [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful
  2017-10-12 13:39     ` Vitaly Kuznetsov
@ 2017-10-12 15:06       ` KY Srinivasan
  0 siblings, 0 replies; 9+ messages in thread
From: KY Srinivasan @ 2017-10-12 15:06 UTC (permalink / raw)
  To: Vitaly Kuznetsov, kys
  Cc: gregkh, linux-kernel, devel, olaf, apw, jasowang,
	leann.ogasawara, marcelo.cerri, Stephen Hemminger



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Thursday, October 12, 2017 6:40 AM
> To: kys@exchange.microsoft.com
> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; leann.ogasawara@canonical.com;
> marcelo.cerri@canonical.com; Stephen Hemminger
> <sthemmin@microsoft.com>; KY Srinivasan <kys@microsoft.com>
> Subject: Re: [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be
> more useful
> 
> kys@exchange.microsoft.com writes:
> 
> > From: "K. Y. Srinivasan" <kys@microsoft.com>
> >
> > Hyper-V allows the guest to report panic and the guest can pass additional
> > information. All this is logged on the host. Currently Linux is passing back
> > information that is not particularly useful. Make the following changes:
> >
> > 1. Windows uses crash MSR P0 to report bugcheck code. Follow the same
> > convention for Linux as well.
> > 2. It will be useful to know the gust ID of the Linux guest that has
> > paniced. Pass back this information.
> >
> > These changes will help in better supporting Linux on Hyper-V
> >
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > ---
> >  arch/x86/hyperv/hv_init.c       | 11 +++++++----
> >  arch/x86/include/asm/mshyperv.h |  2 +-
> >  drivers/hv/vmbus_drv.c          |  4 ++--
> >  3 files changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> > index 1a8eb550c40f..cc30a094fb7c 100644
> > --- a/arch/x86/hyperv/hv_init.c
> > +++ b/arch/x86/hyperv/hv_init.c
> > @@ -205,9 +205,10 @@ void hyperv_cleanup(void)
> >  }
> >  EXPORT_SYMBOL_GPL(hyperv_cleanup);
> >
> > -void hyperv_report_panic(struct pt_regs *regs)
> > +void hyperv_report_panic(struct pt_regs *regs, long err)
> >  {
> >  	static bool panic_reported;
> > +	u64 guest_id;
> >
> >  	/*
> >  	 * We prefer to report panic on 'die' chain as we have proper
> > @@ -218,9 +219,11 @@ void hyperv_report_panic(struct pt_regs *regs)
> >  		return;
> >  	panic_reported = true;
> >
> > -	wrmsrl(HV_X64_MSR_CRASH_P0, regs->ip);
> > -	wrmsrl(HV_X64_MSR_CRASH_P1, regs->ax);
> > -	wrmsrl(HV_X64_MSR_CRASH_P2, regs->bx);
> > +	rdmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
> > +
> > +	wrmsrl(HV_X64_MSR_CRASH_P0, err);
> > +	wrmsrl(HV_X64_MSR_CRASH_P1, guest_id);
> 
> This is a constant we write in hyperv_init() (0x810000040e000000 for
> Linux guests). Do I get it right that we need this to basically
> distinguigh Windows guests crashes from Linux guest crashes in the log?

Yes; we have a huge infrastructure for analyzing the event logs on Azure hosts and guest panics
are logged into this pipeline. Unfortunately, there is not a simple way to distinguish between
Windows and Linux in this information stream.
> 
> > +	wrmsrl(HV_X64_MSR_CRASH_P2, regs->ip);
> >  	wrmsrl(HV_X64_MSR_CRASH_P3, regs->cx);
> >  	wrmsrl(HV_X64_MSR_CRASH_P4, regs->dx);
> 
> We don't write ax and bx any more but write cx and dx. Not that I see
> these regs really useful in the log but I'd change these to ax and bx
> for consistency. Or mayme make it sp and ax?

I will make it sp and ax.

Thanks,

K. Y
> 
> >
> > diff --git a/arch/x86/include/asm/mshyperv.h
> b/arch/x86/include/asm/mshyperv.h
> > index 63cc96f064dc..dd2dc54ddf20 100644
> > --- a/arch/x86/include/asm/mshyperv.h
> > +++ b/arch/x86/include/asm/mshyperv.h
> > @@ -311,7 +311,7 @@ static inline int hv_cpu_number_to_vp_number(int
> cpu_number)
> >  void hyperv_init(void);
> >  void hyperv_setup_mmu_ops(void);
> >  void hyper_alloc_mmu(void);
> > -void hyperv_report_panic(struct pt_regs *regs);
> > +void hyperv_report_panic(struct pt_regs *regs, long err);
> >  bool hv_is_hypercall_page_setup(void);
> >  void hyperv_cleanup(void);
> >  #else /* CONFIG_HYPERV */
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index e8cd19095212..852f6c628836 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -65,7 +65,7 @@ static int hyperv_panic_event(struct notifier_block
> *nb, unsigned long val,
> >
> >  	regs = current_pt_regs();
> >
> > -	hyperv_report_panic(regs);
> > +	hyperv_report_panic(regs, val);
> >  	return NOTIFY_DONE;
> >  }
> >
> > @@ -75,7 +75,7 @@ static int hyperv_die_event(struct notifier_block *nb,
> unsigned long val,
> >  	struct die_args *die = (struct die_args *)args;
> >  	struct pt_regs *regs = die->regs;
> >
> > -	hyperv_report_panic(regs);
> > +	hyperv_report_panic(regs, val);
> >  	return NOTIFY_DONE;
> >  }
> 
> --
>   Vitaly

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

* Re: [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters
  2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
  2017-10-06  0:35   ` [PATCH 2/3] vmbus: initialize reserved fields in messages kys
  2017-10-06  0:35   ` [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful kys
@ 2017-10-20 13:27   ` Greg KH
  2 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2017-10-20 13:27 UTC (permalink / raw)
  To: kys
  Cc: linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin

On Thu, Oct 05, 2017 at 05:35:04PM -0700, kys@exchange.microsoft.com wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> 
> When investigating performance, it is useful to be able to look at
> the number of host and guest events per-channel. This is equivalent
> to per-device interrupt statistics.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  Documentation/ABI/stable/sysfs-bus-vmbus | 14 ++++++++++++++
>  drivers/hv/connection.c                  |  2 ++
>  drivers/hv/vmbus_drv.c                   | 18 ++++++++++++++++++
>  include/linux/hyperv.h                   |  4 ++++
>  4 files changed, 38 insertions(+)
> 
> diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus b/Documentation/ABI/stable/sysfs-bus-vmbus
> index 0ebd8a1537a0..d4eca1717adb 100644
> --- a/Documentation/ABI/stable/sysfs-bus-vmbus
> +++ b/Documentation/ABI/stable/sysfs-bus-vmbus
> @@ -97,3 +97,17 @@ KernelVersion:	4.14
>  Contact:	Stephen Hemminger <sthemmin@microsoft.com>
>  Description:	Bytes availabble to write
>  Users:		Debuggig tools
> +
> +What:		/sys/bus/vmbus/devices/vmbus_*/channels/relid/events
> +Date:		September. 2017
> +KernelVersion:	4.14
> +Contact:	Stephen Hemminger <sthemmin@microsoft.com>
> +Description:	Number of times we have signaled the host
> +Users:		Debuggig tools

Odd spelling :)

> +
> +What:		/sys/bus/vmbus/devices/vmbus_*/channels/relid/interrupts
> +Date:		September. 2017
> +KernelVersion:	4.14
> +Contact:	Stephen Hemminger <sthemmin@microsoft.com>
> +Description:	Number of times we have taken an interrupt (incoming)
> +Users:		Debuggig tools

Same odd spelling :(

> diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> index f41901f80b64..b06a6b796819 100644
> --- a/drivers/hv/connection.c
> +++ b/drivers/hv/connection.c
> @@ -409,6 +409,8 @@ void vmbus_set_event(struct vmbus_channel *channel)
>  	if (!channel->is_dedicated_interrupt)
>  		vmbus_send_interrupt(child_relid);
>  
> +	++channel->sig_events;
> +
>  	hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event);
>  }
>  EXPORT_SYMBOL_GPL(vmbus_set_event);
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index a209527b09f5..e8cd19095212 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -945,6 +945,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu)
>  			if (channel->rescind)
>  				continue;
>  
> +			++channel->interrupts;
> +
>  			switch (channel->callback_mode) {
>  			case HV_CALL_ISR:
>  				vmbus_channel_isr(channel);
> @@ -1238,6 +1240,20 @@ static ssize_t channel_latency_show(const struct vmbus_channel *channel,
>  }
>  VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL);
>  
> +static ssize_t channel_interrupts_show(const struct vmbus_channel *channel, char *buf)
> +{
> +	return sprintf(buf, "%u\n", channel->interrupts);
> +}
> +VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL);
> +
> +static ssize_t channel_events_show(const struct vmbus_channel *channel, char *buf)
> +{
> +	return sprintf(buf, "%u\n", channel->sig_events);
> +}
> +VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
> +
> +
> +

Why so many blank lines?

>  static struct attribute *vmbus_chan_attrs[] = {
>  	&chan_attr_out_mask.attr,
>  	&chan_attr_in_mask.attr,
> @@ -1246,6 +1262,8 @@ static struct attribute *vmbus_chan_attrs[] = {
>  	&chan_attr_cpu.attr,
>  	&chan_attr_pending.attr,
>  	&chan_attr_latency.attr,
> +	&chan_attr_interrupts.attr,
> +	&chan_attr_events.attr,
>  	NULL
>  };
>  
> diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> index ef16ee039850..1b7e15d22f58 100644
> --- a/include/linux/hyperv.h
> +++ b/include/linux/hyperv.h
> @@ -719,6 +719,10 @@ struct vmbus_channel {
>  
>  	struct vmbus_close_msg close_msg;
>  
> +	/* Statistics */
> +	unsigned int	interrupts;	/* Host to Guest interrupts */
> +	unsigned int	sig_events;	/* Guest to Host events */

u32 or u64 here?  How is userspace going to handle these overflowing?

thanks,

greg k-h

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

* Re: [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes
  2017-10-06  0:33 [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes kys
  2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
@ 2017-10-20 13:28 ` Greg KH
  2017-10-20 21:35   ` KY Srinivasan
  1 sibling, 1 reply; 9+ messages in thread
From: Greg KH @ 2017-10-20 13:28 UTC (permalink / raw)
  To: kys
  Cc: linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin

On Thu, Oct 05, 2017 at 05:33:59PM -0700, kys@exchange.microsoft.com wrote:
> From: "K. Y. Srinivasan" <kys@microsoft.com>
> 
> Miscellaneous enhancements and fixes.
> 
> K. Y. Srinivasan (1):
>   Drivers: hv: vmbus: Make pannic reporting to be more useful
> 
> Stephen Hemminger (2):
>   Drivers: hv: vmbus: Expose per-channel interrupts and events counters
>   vmbus: initialize reserved fields in messages
> 

Patch 2 of this series applied, the rest I'll expect a new version of.

thanks,

greg k-h

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

* RE: [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes
  2017-10-20 13:28 ` [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes Greg KH
@ 2017-10-20 21:35   ` KY Srinivasan
  0 siblings, 0 replies; 9+ messages in thread
From: KY Srinivasan @ 2017-10-20 21:35 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, Stephen Hemminger



> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Friday, October 20, 2017 3:28 PM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com;
> jasowang@redhat.com; leann.ogasawara@canonical.com;
> marcelo.cerri@canonical.com; Stephen Hemminger
> <sthemmin@microsoft.com>
> Subject: Re: [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements
> and fixes
> 
> On Thu, Oct 05, 2017 at 05:33:59PM -0700, kys@exchange.microsoft.com
> wrote:
> > From: "K. Y. Srinivasan" <kys@microsoft.com>
> >
> > Miscellaneous enhancements and fixes.
> >
> > K. Y. Srinivasan (1):
> >   Drivers: hv: vmbus: Make pannic reporting to be more useful
> >
> > Stephen Hemminger (2):
> >   Drivers: hv: vmbus: Expose per-channel interrupts and events counters
> >   vmbus: initialize reserved fields in messages
> >
> 
> Patch 2 of this series applied, the rest I'll expect a new version of.

Will send.

K. Y
> 
> thanks,
> 
> greg k-h

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

end of thread, other threads:[~2017-10-20 21:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06  0:33 [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes kys
2017-10-06  0:35 ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters kys
2017-10-06  0:35   ` [PATCH 2/3] vmbus: initialize reserved fields in messages kys
2017-10-06  0:35   ` [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful kys
2017-10-12 13:39     ` Vitaly Kuznetsov
2017-10-12 15:06       ` KY Srinivasan
2017-10-20 13:27   ` [PATCH 1/3] Drivers: hv: vmbus: Expose per-channel interrupts and events counters Greg KH
2017-10-20 13:28 ` [PATCH 0/3] Drivers: hv: vmbus: Miscellaneous enhancements and fixes Greg KH
2017-10-20 21:35   ` KY Srinivasan

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.