[PATCH v5] x86/Hyper-V: Support for free page reporting

2021-03-23 Thread Sunil Muthuswamy
and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy Tested-by: Matheus Castello --- In V2: - Addressed feedback comments - Added page reporting config option tied to hyper-v balloon config In V3: - Addressed

RE: [PATCH v4] x86/Hyper-V: Support for free page reporting

2021-03-19 Thread Sunil Muthuswamy
> What's the strategy for this flag in the unlikely event that the hypercall > fails? > It doesn't seem right to have hv_query_ext_cap() fail, but leave the > static flag set to true. Just move that line down to after the status check > has succeeded? That call should not fail in any normal

[PATCH v4] x86/Hyper-V: Support for free page reporting

2021-03-18 Thread Sunil Muthuswamy
and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy Tested-by: Matheus Castello --- In V2: - Addressed feedback comments - Added page reporting config option tied to hyper-v balloon config In V3: - Addressed

RE: [PATCH v3] x86/Hyper-V: Support for free page reporting

2021-03-17 Thread Sunil Muthuswamy
> > + if (!(ms_hyperv.priv_high & HV_ENABLE_EXTENDED_HYPERCALLS)) > > + return 0; > > Return 'false' since the function is declared as bool? Will fix this in the next iteration. > > + if (hv_do_hypercall(HV_EXT_CALL_QUERY_CAPABILITIES, NULL, cap) == > > + HV_STATUS_SUCCESS) >

RE: [PATCH v9 2/7] arm64: hyperv: Add Hyper-V hypercall and register access utilities

2021-03-15 Thread Sunil Muthuswamy
ARM_SMCCC_STD_CALL, \ > + ARM_SMCCC_SMC_64, \ > + ARM_SMCCC_OWNER_VENDOR_HYP, \ > + HV_SMCCC_FUNC_NUMBER) > + > +#include > + > +#endif > -- > 1.8.3.1 Reviewed-by: Sunil Muthuswamy

RE: [PATCH v9 5/7] arm64: hyperv: Initialize hypervisor on boot

2021-03-15 Thread Sunil Muthuswamy
+ hyperv_early_init(); > + > bootmem_init(); > > kasan_init(); > -- > 1.8.3.1 Reviewed-by: Sunil Muthuswamy

RE: [PATCH v8 3/6] arm64: hyperv: Add kexec and panic handlers

2021-03-03 Thread Sunil Muthuswamy
> +EXPORT_SYMBOL_GPL(hv_setup_crash_handler); > + > +void hv_remove_crash_handler(void) > +{ > +} > +EXPORT_SYMBOL_GPL(hv_remove_crash_handler); > -- > 1.8.3.1 Reviewed-by: Sunil Muthuswamy

RE: [PATCH v8 2/6] arm64: hyperv: Add Hyper-V clocksource/clockevent support

2021-03-03 Thread Sunil Muthuswamy
+ > + return 0; > +} > +TIMER_ACPI_DECLARE(hyperv, ACPI_SIG_GTDT, hyperv_timer_init); > -- > 1.8.3.1 Reviewed-by: Sunil Muthuswamy

RE: [PATCH v8 4/6] arm64: hyperv: Initialize hypervisor on boot

2021-03-03 Thread Sunil Muthuswamy
> +static u64 hypercall_output __initdata; > + > +static int __init hyperv_init(void) > +{ > + struct hv_get_vpindex_from_apicid_input *input; > + u64 status; > + int i; nit: both, tabs & spaces are being used to indent variable names. Can we stick to one? > + > + /* > +

RE: [PATCH v8 6/6] Drivers: hv: Enable Hyper-V code to be built on ARM64

2021-03-03 Thread Sunil Muthuswamy
> - depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST > + depends on ACPI && ((X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \ > + || (ARM64 && !CPU_BIG_ENDIAN)) > select PARAVIRT > select X86_HV_CALLBACK_VECTOR > help > -- > 1.8.3.1 Reviewed-by: Sunil Muthuswamy

RE: [PATCH v8 1/6] arm64: hyperv: Add Hyper-V hypercall and register access utilities

2021-03-03 Thread Sunil Muthuswamy
> > + > > + /* > > +* Allocate a power of 2 size so alignment to that size is > > +* guaranteed, since the hypercall input and output areas > > +* must not cross a page boundary. > > +*/ > > + input = kzalloc(roundup_pow_of_two(sizeof(input->header) + > > +

RE: [PATCH v8 1/6] arm64: hyperv: Add Hyper-V hypercall and register access utilities

2021-03-03 Thread Sunil Muthuswamy
> +} > +EXPORT_SYMBOL_GPL(hv_do_fast_hypercall8); > + > + nit: Extra line, here and few other places > +u64 hv_get_vpreg(u32 msr) > +{ > + struct hv_get_vp_registers_input*input; > + struct hv_get_vp_registers_output *output; > + u64

RE: [EXTERNAL] Re: [RFC PATCH 12/12] HV/Storvsc: Add bounce buffer support for Storvsc

2021-03-01 Thread Sunil Muthuswamy
> Hi Christoph: > Thanks a lot for your review. There are some reasons. > 1) Vmbus drivers don't use DMA API now. What is blocking us from making the Hyper-V drivers use the DMA API's? They will be a null-op generally, when there is no bounce buffer support needed. > 2) Hyper-V

RE: [EXTERNAL] Re: [PATCH v2 1/2] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-08 Thread Sunil Muthuswamy
> At the very least you could pick one of the subject line prefixes that > has been used before for either mshyperv.h or pci-hyperv.c instead of > making up something completely new and different. > Will keep that in mind going forward.

[PATCH v2 2/2] Hyper-V: pci: x64: Moving the MSI entry definition to arch specific location

2021-01-07 Thread Sunil Muthuswamy
The Hyper-V MSI entry is architecture specific. Currently, it is defined in an arch neutral location. This patch moves it to an arch specific location. Signed-off-by: Sunil Muthuswamy --- arch/x86/include/asm/hyperv-tlfs.h | 7 +++ include/asm-generic/hyperv-tlfs.h | 8 2 files

[PATCH v2 1/2] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-07 Thread Sunil Muthuswamy
) Signed-off-by: Boqun Feng (Microsoft) Signed-off-by: Sunil Muthuswamy --- In V2: - Addressed feedback on SoB tab. - Added a second patch to move the MSI entry definition. --- arch/x86/include/asm/mshyperv.h | 24 + drivers/pci/controller/pci-hyperv.c | 33

RE: [EXTERNAL] Re: [PATCH] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-07 Thread Sunil Muthuswamy
> Do you see "Co-developed-by" in the title of that section? This is how > you express co-authorship. Yes, I do now. > > As it is now: > > Signed-off-by: Sunil Muthuswamy > Signed-off-by: Boqun Feng (Microsoft) > > it says that you authored the pa

RE: [EXTERNAL] Re: [PATCH] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-07 Thread Sunil Muthuswamy
er-V patches. Wei and other maintainers of the Hyper-V branch; do you have any suggestions? If we have already defined a format and it is me who is not following it, please forward the document my way. > On Thu, Jan 07, 2021 at 05:05:36AM +, Sunil Muthuswamy wrote: > > Currently, operatio

RE: [EXTERNAL] Re: [PATCH] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-07 Thread Sunil Muthuswamy
> What is this SoB chain supposed to say? Quoting from the link you shared: "The Signed-off-by: tag indicates that the signer was involved in the development of the patch, or that he/she was in the patch's delivery path." My intent to include Boqun in the Signed-off by tag was to indicate that

[PATCH] Hyper-V: pci: x64: Generalize irq/msi set-up and handling

2021-01-06 Thread Sunil Muthuswamy
Currently, operations related to irq/msi in Hyper-V vPCI are x86-specific code. In order to support virtual PCI on Hyper-V for other architectures, introduce generic interfaces to replace the x86-specific ones. There are no functional changes in this patch. Signed-off-by: Sunil Muthuswamy Signed

[PATCH v3] x86/Hyper-V: Support for free page reporting

2021-01-06 Thread Sunil Muthuswamy
and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy Tested-by: Matheus Castello --- In V2: - Addressed feedback comments - Added page reporting config option tied to hyper-v balloon config In V3: - Addressed

RE: [EXTERNAL] Re: [PATCH v2] x86/Hyper-V: Support for free page reporting

2021-01-06 Thread Sunil Muthuswamy
> > +// Bit mask of the extended capability to query: see HV_EXT_CAPABILITY_xxx > > Please don't use '//' comments in Linux (here and below) Will fix in v3. > > + /* > > +* Repurpose the input page arg to accept output from Hyper-V for > > +* now because this is the only call that

[PATCH v2] x86/Hyper-V: Support for free page reporting

2021-01-05 Thread Sunil Muthuswamy
and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy Tested-by: Matheus Castello --- In V2: - Addressed feedback comments - Added page reporting config option tied to hyper-v balloon config --- arch/x86/hyperv

RE: [EXTERNAL] Re: [PATCH RFC v1 08/18] x86/hyperv: handling hypercall page setup for root

2020-09-16 Thread Sunil Muthuswamy
> > On Tue, Sep 15, 2020 at 12:32:29PM +0200, Vitaly Kuznetsov wrote: > > Wei Liu writes: > > > > > When Linux is running as the root partition, the hypercall page will > > > have already been setup by Hyper-V. Copy the content over to the > > > allocated page. > > > > And we can't setup a new

RE: [EXTERNAL] Re: [PATCH] x86/Hyper-V: Support for free page reporting

2020-05-22 Thread Sunil Muthuswamy
> As the only usage of this function looks like > if (!(hv_query_ext_cap() & HV_EXT_CAPABILITY_MEMORY_COLD_DISCARD_HINT)) > > I would've change the interface to > > bool hv_query_ext_cap(u64 cap) > > so the usage would look like > > if

RE: [EXTERNAL] Re: [PATCH] x86/Hyper-V: Support for free page reporting

2020-05-22 Thread Sunil Muthuswamy
> > + if (hv_do_hypercall(HV_EXT_CALL_QUERY_CAPABILITIES, NULL, cap) == > > + HV_STATUS_SUCCESS) > > You're using the input page as the output parameter. Ideally we should > introduce hyperv_pcpu_output_arg page, but that would waste one page per > cpu just for this one call. > > So for

[PATCH] x86/Hyper-V: Support for free page reporting

2020-05-19 Thread Sunil Muthuswamy
and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy --- First patch mail bounced backed. Sending it again with the email addresses fixed. --- arch/x86/hyperv/hv_init.c | 24 arch/x86/kernel/cpu

RE: [PATCH v2 net] hv_sock: Fix hang when a connection is closed

2019-07-31 Thread Sunil Muthuswamy
> -Original Message- > From: Dexuan Cui > Sent: Tuesday, July 30, 2019 6:26 PM > To: Sunil Muthuswamy ; David Miller > ; net...@vger.kernel.org > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; Michael Kelley > ; linux-hyp...@vg

RE: [PATCH net] hv_sock: Fix hang when a connection is closed

2019-07-29 Thread Sunil Muthuswamy
> -Original Message- > From: Dexuan Cui > Sent: Sunday, July 28, 2019 11:32 AM > To: Sunil Muthuswamy ; David Miller > ; net...@vger.kernel.org > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; Michael Kelley > ; linux-hy

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-17 Thread Sunil Muthuswamy
> -Original Message- > From: David Miller > Sent: Monday, June 17, 2019 11:56 AM > To: Sunil Muthuswamy > Cc: Dexuan Cui ; KY Srinivasan ; > Haiyang Zhang ; Stephen > Hemminger ; sas...@kernel.org; Michael Kelley > ; net...@vger.kernel.org; > linux-hy

[PATCH net v2] hvsock: fix epollout hang from race condition

2019-06-17 Thread Sunil Muthuswamy
ary is crossed and not everytime. This change also reduces the cpu usage somewhat since hv_stream_has_space() is in the hotpath of send: vsock_stream_sendmsg()->hv_stream_has_space() Earlier hv_stream_has_space was setting/clearing the pending size on every call. Signed-off-by: Sunil Muthuswamy Re

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-17 Thread Sunil Muthuswamy
> -Original Message- > From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of David Miller > Sent: Sunday, June 16, 2019 1:55 PM > To: Dexuan Cui > Cc: Sunil Muthuswamy ; KY Srinivasan > ; Haiyang Zhang ; > Stephen Hemminger ; sas...@kernel.org; M

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-15 Thread Sunil Muthuswamy
> -Original Message- > From: Dexuan Cui > Sent: Friday, June 14, 2019 10:04 PM > To: David Miller ; Sunil Muthuswamy > > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; Michael Kelley > ; net...@vger.kernel.org; linux- >

RE: [PATCH net] hv_sock: Suppress bogus "may be used uninitialized" warnings

2019-06-15 Thread Sunil Muthuswamy
> -Original Message- > From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Dexuan Cui > Sent: Friday, June 14, 2019 10:01 PM > To: net...@vger.kernel.org; da...@davemloft.net; Michael Kelley > > Cc: linux-hyp...@vger.kernel.org; linux-kernel@vger.kernel.org; KY Srinivasan > ;

[PATCH net] hvsock: fix epollout hang from race condition

2019-06-13 Thread Sunil Muthuswamy
ary is crossed and not everytime. This change also reduces the cpu usage somewhat since hv_stream_has_space() is in the hotpath of send: vsock_stream_sendmsg()->hv_stream_has_space() Earlier hv_stream_has_space was setting/clearing the pending size on every call. Signed-off-by: Sunil Muthuswamy --

[PATCH net-next] hv_sock: perf: loop in send() to maximize bandwidth

2019-05-22 Thread Sunil Muthuswamy
. Signed-off-by: Sunil Muthuswamy --- - The patch has been previously submitted to net and reviewed. The feedback was to submit it to net-next. net/vmw_vsock/hyperv_transport.c | 45 +++- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/net

[PATCH net-next] hv_sock: perf: Allow the socket buffer size options to influence the actual socket buffers

2019-05-22 Thread Sunil Muthuswamy
96/494 | 830/1046/935/939 | 944/1180/1070/1100 | | 64KB | 64/70/68/69 | 467/533/501/497 | 1260/1590/1430/1431 | 1605/1819/1670/1660 | |-| Signed-off-by: Sunil Muthuswamy --- - The table above e

RE: [PATCH] hv_sock: Fix data loss upon socket close

2019-05-14 Thread Sunil Muthuswamy
> -Original Message- > From: Dexuan Cui > Sent: Friday, May 10, 2019 8:57 PM > To: Sunil Muthuswamy ; KY Srinivasan > ; Haiyang Zhang ; > Stephen Hemminger ; Sasha Levin ; > David S. Miller ; > Michael Kelley > Cc: net...@vger.kernel.org; linux-hyp..

RE: [PATCH] hv_sock: Fix data loss upon socket close

2019-05-14 Thread Sunil Muthuswamy
> -Original Message- > From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of David Miller > Sent: Thursday, May 9, 2019 1:58 PM > To: Sunil Muthuswamy > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; Dexuan Cui &g

RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic

2018-07-11 Thread Sunil Muthuswamy
n.org; linux- > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; Stephen Hemminger > ; vkuzn...@redhat.com > Cc: Sunil Muthuswamy > Subject: RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump > over Hy

RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic

2018-07-11 Thread Sunil Muthuswamy
n.org; linux- > ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; Stephen Hemminger > ; vkuzn...@redhat.com > Cc: Sunil Muthuswamy > Subject: RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump > over Hy