Re: [PATCH v2] drivers: hv: vmbus: Add missing check for dma_set_mask in vmbus_device_register()

2024-07-03 Thread Wei Liu
On Wed, Jul 03, 2024 at 04:42:21PM +0800, Haoxiang Li wrote: > child_device_obj->device cannot perform DMA properly if dma_set_mask() > returns non-zero. Add check for dma_set_mask() and return the error if it > fails. To do the right cleanup, call dma_set_mask() after device_register() > so that

Re: [PATCH v3] PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN

2024-07-03 Thread Wei Liu
On Wed, Jul 03, 2024 at 05:12:47PM +0900, Krzysztof Wilczyński wrote: > Hello, > > > > The intent of the code snippet is to always return 0 for both > > > PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN. > > > > > > The check misses PCI_INTERRUPT_PIN. This patch fixes that. > > > > > > This is

Re: [PATCH v3] PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN

2024-07-02 Thread Wei Liu
On Mon, Jul 01, 2024 at 08:26:05PM +, Wei Liu wrote: > The intent of the code snippet is to always return 0 for both > PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN. > > The check misses PCI_INTERRUPT_PIN. This patch fixes that. > > This is discovered by

Re: [PATCH] tools: hv: lsvmbus: change shebang to use python3

2024-07-01 Thread Wei Liu
On Mon, Jul 01, 2024 at 08:35:55AM +, Anthony Nandaa wrote: > This patch updates the shebang in the lsvmbus tool to use python3 > instead of python. The change is necessary because Python 2 has > reached its end of life as of January 1, 2020, and is no longer > maintained[1]. Many modern

[PATCH v3] PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN

2024-07-01 Thread Wei Liu
val to 0 because it misses the check for PCI_INTERRUPT_PIN. Garbage is returned in that case. Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Cc: sta...@kernel.org Signed-off-by: Wei Liu Reviewed-by: Michael Kelley --- v3: * Change commit

Re: [PATCH v2] PCI: hv: fix reading of PCI_INTERRUPT_PIN

2024-07-01 Thread Wei Liu
On Mon, Jul 01, 2024 at 12:20:53PM -0500, Bjorn Helgaas wrote: > On Mon, Jul 01, 2024 at 06:16:18AM +0000, Wei Liu wrote: > > On Wed, Jun 26, 2024 at 10:10:39AM -0500, Bjorn Helgaas wrote: > > > 1) Capitalize subject to match history > > > > What do you mean here? I

Re: [PATCH v2] PCI: hv: fix reading of PCI_INTERRUPT_PIN

2024-07-01 Thread Wei Liu
pdev, PCI_INTERRUPT_PIN, ); The old code does not set *val to 0 because it misses the check for PCI_INTERRUPT_PIN. Garbage is returned in this case. Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Cc: sta...@kernel.org Signed

Re: [RFC 01/12] Drivers: hv: vmbus: Drop unsupported VMBus devices earlier

2024-06-24 Thread Wei Liu
ces are dropped early, the check for unsupported > devices in hv_get_dev_type() is redundant. Remove it. > > Signed-off-by: Michael Kelley Acked-by: Wei Liu

Re: [PATCH v2] clocksource: hyper-v: Use lapic timer in a TDX VM without paravisor

2024-06-24 Thread Wei Liu
On Thu, Jun 20, 2024 at 11:16:14PM -0700, Dexuan Cui wrote: > In a TDX VM without paravisor, currently the default timer is the Hyper-V > timer, which depends on the slow VM Reference Counter MSR: the Hyper-V TSC > page is not enabled in such a VM because the VM uses Invariant TSC as a > better

Re: [PATCH] Drivers: hv: Remove deprecated hv_fcopy declarations

2024-06-24 Thread Wei Liu
On Thu, Jun 20, 2024 at 06:50:40PM -0400, Rachel Menge wrote: > There are lingering hv_fcopy declarations which do not have definitions. > The fcopy driver was removed in commit ec314f61e4fc ("Drivers: hv: Remove > fcopy driver"). > > Therefore, remove the hv_fcopy declarations which are no

[PATCH v2] PCI: hv: fix reading of PCI_INTERRUPT_PIN

2024-06-21 Thread Wei Liu
val to 0 because it misses the check for PCI_INTERRUPT_PIN. Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Cc: sta...@kernel.org Signed-off-by: Wei Liu --- v2: * Change the commit subject line and message * Change the code according to feedback

Re: [PATCH] PCI: hv: fix reading of PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN

2024-06-21 Thread Wei Liu
On Fri, Jun 21, 2024 at 04:03:27AM -0700, Saurabh Singh Sengar wrote: > On Fri, Jun 21, 2024 at 06:19:05AM +0000, Wei Liu wrote: > > On Fri, Jun 21, 2024 at 03:15:19AM +, Michael Kelley wrote: > > > From: Wei Liu Sent: Thursday, June 20, 2024 6:48 PM > > > >

Re: [PATCH] PCI: hv: fix reading of PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN

2024-06-21 Thread Wei Liu
On Fri, Jun 21, 2024 at 06:41:04PM +, Dexuan Cui wrote: > From: Jake Oshins > Sent: Friday, June 21, 2024 9:51 AM > > [...] > >On Fri, Jun 21, 2024 at 06:19:05AM +, Wei Liu wrote: > > On Fri, Jun 21, 2024 at 03:15:19AM +, Michael Kelley wrote: > &g

Re: [PATCH] PCI: hv: fix reading of PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN

2024-06-21 Thread Wei Liu
On Fri, Jun 21, 2024 at 03:15:19AM +, Michael Kelley wrote: > From: Wei Liu Sent: Thursday, June 20, 2024 6:48 PM > > > > The intent of the code snippet is to always return 0 for both fields. > > The check is wrong though. Fix that. > > > > This i

[PATCH] PCI: hv: fix reading of PCI_INTERRUPT_LINE and PCI_INTERRUPT_PIN

2024-06-20 Thread Wei Liu
ect. Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Cc: sta...@kernel.org Signed-off-by: Wei Liu --- drivers/pci/controller/pci-hyperv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c

[GIT PULL] Hyper-V fixes for v6.10-rc5

2024-06-17 Thread Wei Liu
Hi Linus, The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-fixes-signed-20240616 for you to

Re: [PATCH net-next] net: mana: Use mana_cleanup_port_context() for rxq cleanup

2024-06-17 Thread Wei Liu
On Fri, Jun 14, 2024 at 12:19:08AM -0700, Shradha Gupta wrote: > > To cleanup rxqs in port context structures, instead of duplicating the > code, use existing function mana_cleanup_port_context() which does > the exact cleanup that's needed. > > Signed-off-by: Shradha Gupta

Re: [PATCH v6] Drivers: hv: Cosmetic changes for hv.c and balloon.c

2024-06-06 Thread Wei Liu
On Sat, Jun 01, 2024 at 04:11:32AM +, Michael Kelley wrote: > From: Aditya Nagesh Sent: Friday, May 31, > 2024 3:49 AM > > > > Fix issues reported by checkpatch.pl script in hv.c and > > balloon.c > > - Remove unnecessary parentheses > > - Remove extra newlines > > - Remove extra spaces

Re: [PATCH v5] Drivers: hv: Cosmetic changes for hv.c and balloon.c

2024-05-29 Thread Wei Liu
On Wed, May 29, 2024 at 04:29:17PM +, Michael Kelley wrote: > From: Aditya Nagesh Sent: Wednesday, May > 29, 2024 9:05 AM > > > > Fix issues reported by checkpatch.pl script in hv.c and > > balloon.c > > - Remove unnecessary parentheses > > - Remove extra newlines > > - Remove extra

Re: [PATCH v4] Drivers: hv: Cosmetic changes for hv.c and balloon.c

2024-05-27 Thread Wei Liu
On Tue, May 28, 2024 at 05:17:29AM +, Wei Liu wrote: > On Mon, Apr 22, 2024 at 08:18:46PM -0700, Aditya Nagesh wrote: > > Fix issues reported by checkpatch.pl script in hv.c and > > balloon.c > > - Remove unnecessary parentheses > > - Remove extra newlines

Re: [PATCH 06/20] x86/tdx: Convert MSR write handling to use new TDVMCALL_0()

2024-05-27 Thread Wei Liu
ld new delta > tdx_handle_virt_exception 19471819-128 > > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/coco/tdx/tdx.c | 9 ++--- > arch/x86/hyperv/ivm.c | 9 ++--- Acked-by: Wei Liu

Re: [PATCH 05/20] x86/tdx: Convert MSR read handling to use new TDVMCALL_1()

2024-05-27 Thread Wei Liu
ld new delta > tdx_handle_virt_exception 20521947-105 > > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/coco/tdx/tdx.c | 15 +++ > arch/x86/hyperv/ivm.c | 10 ++ Acked-by: Wei Liu

Re: [PATCH v2] tools: hv: suppress the invalid warning for packed member alignment

2024-05-27 Thread Wei Liu
On Sun, May 05, 2024 at 10:38:58PM -0700, Saurabh Sengar wrote: > Packed struct vmbus_bufring is 4096 byte aligned and the reporting > warning is for the first member of that struct which shouldn't add > any offset to create alignment issue. > > Suppress the warning by adding

Re: [PATCH v3 1/2] hv_balloon: Use kernel macros to simplify open coded sequences

2024-05-27 Thread Wei Liu
On Fri, May 03, 2024 at 08:43:11AM -0700, mhkelle...@gmail.com wrote: > From: Michael Kelley > > Code sequences equivalent to ALIGN(), ALIGN_DOWN(), and umin() are > currently open coded. Change these to use the kernel macro to > improve code clarity. ALIGN() and ALIGN_DOWN() require the >

Re: [PATCH v4] Drivers: hv: Cosmetic changes for hv.c and balloon.c

2024-05-27 Thread Wei Liu
On Mon, Apr 22, 2024 at 08:18:46PM -0700, Aditya Nagesh wrote: > Fix issues reported by checkpatch.pl script in hv.c and > balloon.c > - Remove unnecessary parentheses > - Remove extra newlines > - Remove extra spaces > - Add spaces between comparison operators > - Remove comparison with NULL

Re: [PATCH 2/6] drivers/hv: Enable VTL mode for arm64

2024-05-15 Thread Wei Liu
On Fri, May 10, 2024 at 09:05:01AM -0700, rom...@linux.microsoft.com wrote: > From: Roman Kisel > > This change removes dependency on ACPI when buidling the hv drivers to > allow Virtual Trust Level boot with DeviceTree. > > Signed-off-by: Roman Kisel > --- > drivers/hv/Kconfig | 6 +++--- >

Re: [PATCH] hv/vmbus_drv: rename hv_acpi_init() to vmbus_init()

2024-04-22 Thread Wei Liu
On Thu, Apr 18, 2024 at 10:56:49PM -0700, Erni Sri Satya Vennela wrote: > As the driver now supports both ACPI and DeviceTree, > rename hv_acpi_init() to vmbus_init() and > change comments accordingly. > > Signed-off-by: Erni Sri Satya Vennela Applied. Thanks.

Re: [PATCH] x86/hyperv: Consider NUMA affinity when allocating memory for per-CPU vmsa

2024-04-22 Thread Wei Liu
On Mon, Apr 15, 2024 at 04:57:12PM +0800, Li RongQing wrote: > per-CPU vmsa are dominantly accessed from their own local CPUs, > so allocate them node-local to improve performance. > > And reorganized variables to be reverse christmas tree order > > Signed-off-by: Li RongQing Applied. Thanks.

Re: [PATCH v2] Add a header in ifcfg and nm keyfiles describing the owner of the files

2024-04-22 Thread Wei Liu
On Thu, Apr 18, 2024 at 05:35:49PM +0530, Ani Sinha wrote: > A comment describing the source of writing the contents of the ifcfg and > network manager keyfiles (hyperv kvp daemon) is useful. It is valuable both > for debugging as well as for preventing users from modifying them. > > CC:

Re: Early kernel panic in dmi_decode when running 32-bit kernel on Hyper-V on Windows 11

2024-04-15 Thread Wei Liu
On Sat, Apr 13, 2024 at 03:06:05PM +0200, Michael Schierl wrote: > [please cc: me as I am not subscribed to either mailing list] > [...] > [Slightly off-topic: As 64-bit kernels work fine, if there are ways to > run a 32-bit userland containerized or chrooted in a 64-bit kernel so > that the

[GIT PULL] Hyper-V fixes for 6.9-rc4

2024-04-11 Thread Wei Liu
Hi Linus, The following changes since commit e8f897f4afef0031fe618a8e94127a0934896aba: Linux 6.8 (2024-03-10 13:38:09 -0700) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-fixes-signed-20240411 for you to fetch

Re: [PATCH 0/5] Handle set_memory_XXcrypted() errors in Hyper-V

2024-04-10 Thread Wei Liu
On Mon, Mar 11, 2024 at 09:15:53AM -0700, mhkelle...@gmail.com wrote: > From: Michael Kelley > > Shared (decrypted) pages should never be returned to the page allocator, > lest future usage of the pages store data that should not be exposed to > the host. They may also cause the guest to crash

Re: [PATCH v2] Drivers: hv: Cosmetic changes for hv.c and balloon.c

2024-04-10 Thread Wei Liu
On Mon, Apr 01, 2024 at 09:06:21PM -0700, Aditya Nagesh wrote: > Fix issues reported by checkpatch.pl script in hv.c and > balloon.c > - Remove unnecessary parentheses > - Remove extra newlines > - Remove extra spaces > - Add spaces between comparison operators > - Remove comparison with NULL

Re: [PATCH v5] hv/hv_kvp_daemon: Handle IPv4 and Ipv6 combination for keyfile format

2024-04-10 Thread Wei Liu
On Fri, Mar 22, 2024 at 06:46:02AM -0700, Shradha Gupta wrote: > If the network configuration strings are passed as a combination of IPv4 > and IPv6 addresses, the current KVP daemon does not handle processing for > the keyfile configuration format. > With these changes, the keyfile config

Re: [PATCH] hv: vmbus: Convert sprintf() family to sysfs_emit() family

2024-04-10 Thread Wei Liu
On Mon, Mar 25, 2024 at 05:49:47PM +, Wei Liu wrote: > On Mon, Mar 25, 2024 at 09:39:52AM +, Zhijian Li (Fujitsu) wrote: > > > > > > On 23/03/2024 07:37, Wei Liu wrote: > > > Hi Zhijian, > > > > > > On Tue, Mar 19, 2024 at 11:43:50AM

Re: [PATCH v2 1/4] x86/hyperv/vtl: Correct parse_smp_cfg assignment

2024-04-04 Thread Wei Liu
for separate mpparse callbacks") > Signed-off-by: Saurabh Sengar Acked-by: Wei Liu

Re: [PATCH] hv: vmbus: Convert sprintf() family to sysfs_emit() family

2024-03-25 Thread Wei Liu
On Mon, Mar 25, 2024 at 09:39:52AM +, Zhijian Li (Fujitsu) wrote: > > > On 23/03/2024 07:37, Wei Liu wrote: > > Hi Zhijian, > > > > On Tue, Mar 19, 2024 at 11:43:50AM +0800, Li Zhijian wrote: > >> Per filesystems/sysfs.rst, show() should only use sysfs

Re: [GIT PULL] Hyper-V commits for 6.9

2024-03-22 Thread Wei Liu
On Fri, Mar 22, 2024 at 04:42:50PM -0700, Linus Torvalds wrote: > On Fri, 22 Mar 2024 at 16:25, Wei Liu wrote: > > > > Hmm... I thought I refreshed it right before the expiration date. I > > pushed it to Ubuntu's keyserver. > > Ok, I can find it there. > > &g

Re: [PATCH v3] mshyperv: Introduce hv_numa_node_to_pxm_info()

2024-03-22 Thread Wei Liu
rocessor_* structs to the correct > hv_input_/hv_output_ prefix, and remove the flags field which is not > present in the ABI. > > Signed-off-by: Nuno Das Neves > Reviewed-by: Wei Liu > Queued for hyperv-fixes. Thanks.

Re: [PATCH] x86/hyperv: Cosmetic changes for hv_apic.c

2024-03-22 Thread Wei Liu
On Thu, Mar 21, 2024 at 01:22:05AM -0700, Erni Sri Satya Vennela wrote: > Fix issues reported by checkpatch.pl script for hv_apic.c file > - Alignment should match open parenthesis > - Remove unnecessary parenthesis > > No functional changes intended. > > Signed-off-by: Erni Sri Satya Vennela

Re: [PATCH] hv: vmbus: Convert sprintf() family to sysfs_emit() family

2024-03-22 Thread Wei Liu
Hi Zhijian, On Tue, Mar 19, 2024 at 11:43:50AM +0800, Li Zhijian wrote: > Per filesystems/sysfs.rst, show() should only use sysfs_emit() > or sysfs_emit_at() when formatting the value to be returned to user space. > > coccinelle complains that there are still a couple of functions that use >

Re: [GIT PULL] Hyper-V commits for 6.9

2024-03-22 Thread Wei Liu
On Thu, Mar 21, 2024 at 10:06:53AM -0700, Linus Torvalds wrote: > On Wed, 20 Mar 2024 at 21:09, Wei Liu wrote: > > > > ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git > > tags/hyperv-next-signed-20240320 > > Pulled, but... > > Y

[GIT PULL] Hyper-V commits for 6.9

2024-03-20 Thread Wei Liu
Hi Linus, The following changes since commit d206a76d7d2726f3b096037f2079ce0bd3ba329b: Linux 6.8-rc6 (2024-02-25 15:46:06 -0800) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-next-signed-20240320 for you to

Re: [PATCH v3 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random number generator

2024-03-18 Thread Wei Liu
On Mon, Mar 18, 2024 at 08:54:08AM -0700, mhkelle...@gmail.com wrote: > From: Michael Kelley > > A Hyper-V host provides its guest VMs with entropy in a custom ACPI > table named "OEM0". The entropy bits are updated each time Hyper-V > boots the VM, and are suitable for seeding the Linux guest

Re: [PATCH] x86/hyperv: Cosmetic changes for hv_spinlock.c

2024-03-18 Thread Wei Liu
On Mon, Mar 18, 2024 at 09:21:28AM -0700, Saurabh Singh Sengar wrote: > On Mon, Mar 18, 2024 at 05:09:11AM -0700, Purna Pavan Chandra Aekkaladevi > wrote: > > Fix issues reported by checkpatch.pl script for hv_spinlock.c file. > > - Place __initdata after variable name > > - Add missing blank

Re: [PATCH] hyperv-tlfs: Rename some HV_REGISTER_* defines for consistency

2024-03-17 Thread Wei Liu
On Tue, Mar 12, 2024 at 04:21:27PM -0700, Nuno Das Neves wrote: > Rename HV_REGISTER_GUEST_OSID to HV_REGISTER_GUEST_OS_ID. This matches > the existing HV_X64_MSR_GUEST_OS_ID. > > Rename HV_REGISTER_CRASH_* to HV_REGISTER_GUEST_CRASH_*. Including > GUEST_ is consistent with other #defines such as

Re: [PATCH 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random number generator

2024-03-08 Thread Wei Liu
On Wed, Mar 06, 2024 at 05:43:41PM +, Michael Kelley wrote: > From: wei@kernel.org @ 2024-03-04 6:57 UTC > > > > > +void __init ms_hyperv_late_init(void) > > > +{ > > > + struct acpi_table_header *header; > > > + acpi_status status; > > > + u8 *randomdata; > > > + u32 length, i; > > > +

Re: [PATCH] hv: vmbus: Convert to platform remove callback returning void

2024-03-08 Thread Wei Liu
On Fri, Mar 08, 2024 at 09:51:08AM +0100, Uwe Kleine-König wrote: > The .remove() callback for a platform driver returns an int which makes > many driver authors wrongly assume it's possible to do error handling by > returning an error code. However the value returned is ignored (apart > from

Re: [PATCH v2] mshyperv: Introduce hv_get_hypervisor_version function

2024-03-08 Thread Wei Liu
ng. > > > > Use the new function to get and parse the version at boot time. While at > > it, move the printing code to hv_common_init() so it is not duplicated. > > > > Signed-off-by: Nuno Das Neves > > Acked-by: Wei Liu > > Reviewed-by: Michael Kelley > Applied to hyperv-next. Thanks.

Re: [PATCH v3] x86/hyperv: Use per cpu initial stack for vtl context

2024-03-08 Thread Wei Liu
On Tue, Mar 05, 2024 at 12:26:50AM +, Wei Liu wrote: > On Sun, Mar 03, 2024 at 11:08:17PM -0800, Saurabh Singh Sengar wrote: > > On Mon, Mar 04, 2024 at 06:24:27AM +0000, Wei Liu wrote: > > > On Sun, Mar 03, 2024 at 12:01:36AM -0800, Saurabh Sengar wrote: > > > >

Re: [PATCH v3] x86/hyperv: Use per cpu initial stack for vtl context

2024-03-04 Thread Wei Liu
On Sun, Mar 03, 2024 at 11:08:17PM -0800, Saurabh Singh Sengar wrote: > On Mon, Mar 04, 2024 at 06:24:27AM +0000, Wei Liu wrote: > > On Sun, Mar 03, 2024 at 12:01:36AM -0800, Saurabh Sengar wrote: > > > Currently, the secondary CPUs in Hyper-V VTL context lack support for >

Re: [PATCH v2] hyperv-tlfs: Change prefix of generic HV_REGISTER_* MSRs to HV_MSR_*

2024-03-03 Thread Wei Liu
rm64. On arm64, the generic HV_MSR_'s > point to the corresponding HV_REGISTER_. > > While at it, rename hv_get/set_registers() and related functions to > hv_get/set_msr(), hv_get/set_nested_msr(), etc. These are only used for > Hyper-V MSRs and this naming makes that clear. > &g

Re: [PATCH 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random number generator

2024-03-03 Thread Wei Liu
On Mon, Jan 22, 2024 at 08:00:03AM -0800, mhkelle...@gmail.com wrote: > From: Michael Kelley > > A Hyper-V host provides its guest VMs with entropy in a custom ACPI > table named "OEM0". The entropy bits are updated each time Hyper-V > boots the VM, and are suitable for seeding the Linux guest

Re: [PATCH v3] x86/hyperv: Use per cpu initial stack for vtl context

2024-03-03 Thread Wei Liu
On Sun, Mar 03, 2024 at 12:01:36AM -0800, Saurabh Sengar wrote: > Currently, the secondary CPUs in Hyper-V VTL context lack support for > parallel startup. Therefore, relying on the single initial_stack fetched > from the current task structure suffices for all vCPUs. > > However, common

[GIT PULL] Hyper-V fixes for 6.8-rc8

2024-03-03 Thread Wei Liu
Hi Linus, The following changes since commit d206a76d7d2726f3b096037f2079ce0bd3ba329b: Linux 6.8-rc6 (2024-02-25 15:46:06 -0800) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-fixes-signed-20240303 for you to

Re: [RFC RFT PATCH 1/4] hv: Leak pages if set_memory_encrypted() fails

2024-03-01 Thread Wei Liu
> Only compile tested. > > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Wei Liu > Cc: Dexuan Cui > Cc: linux-hyperv@vger.kernel.org > Signed-off-by: Rick Edgecombe > --- > drivers/hv/connection.c | 11 +++ > 1 file changed, 7 inse

Re: [PATCH v2] x86/hyperv: Use per cpu initial stack for vtl context

2024-03-01 Thread Wei Liu
On Mon, Feb 05, 2024 at 04:36:42PM +, Michael Kelley wrote: > From: Saurabh Sengar Sent: Thursday, February > 1, 2024 11:13 PM > > > > Currently, the secondary CPUs in Hyper-V VTL context lack support for > > parallel startup. Therefore, relying on the single initial_stack fetched > > from

Re: [PATCH v2] x86/hyperv: Allow 15-bit APIC IDs for VTL platforms

2024-03-01 Thread Wei Liu
On Tue, Jan 16, 2024 at 03:25:47PM +, Michael Kelley wrote: > From: Saurabh Sengar Sent: Monday, January 15, > 2024 9:58 AM > > > > The current method for signaling the compatibility of a Hyper-V host > > with MSIs featuring 15-bit APIC IDs relies on a synthetic cpuid leaf. > > However, for

Re: [PATCH v4 0/3] x86/hyperv: Mark CoCo VM pages not present when changing encrypted state

2024-03-01 Thread Wei Liu
On Mon, Jan 15, 2024 at 06:20:05PM -0800, mhkelle...@gmail.com wrote: > From: Michael Kelley > > In a CoCo VM, when transitioning memory from encrypted to decrypted, or > vice versa, the caller of set_memory_encrypted() or set_memory_decrypted() > is responsible for ensuring the memory isn't in

Re: [PATCH 1/2] Drivers: hv: vmbus: Remove duplication and cleanup code in create_gpadl_header()

2024-03-01 Thread Wei Liu
hould probably > > break out the change to memory allocation errors in the same > > way. Then we would have three patches, plus the patch to > > separately handle the indentation so the changes are reviewable. > > To me, that's overkill for updates to a single function that have > &

Re: [PATCH v2 1/1] Drivers: hv: vmbus: Calculate ring buffer size for more efficient use of memory

2024-03-01 Thread Wei Liu
On Wed, Feb 28, 2024 at 04:45:33PM -0800, mhkelle...@gmail.com wrote: > From: Michael Kelley > > The VMBUS_RING_SIZE macro adds space for a ring buffer header to the > requested ring buffer size. The header size is always 1 page, and so > its size varies based on the PAGE_SIZE for which the

Re: [PATCH] hv: vmbus: make hv_bus const

2024-03-01 Thread Wei Liu
On Mon, Feb 05, 2024 at 02:34:12PM -0300, Ricardo B. Marliere wrote: > Hi Michael, > > On 5 Feb 16:40, Michael Kelley wrote: > > From: Ricardo B. Marliere Sent: Sunday, February 4, > > 2024 8:38 AM > > > > > > > NIT: For consistency, we try to use "Drivers: hv: vmbus:" as the prefix on > >

Re: [PATCH] drivers: hv: dxgkrnl: Allow user to specify CPU VA for device allocation

2024-01-16 Thread Wei Liu
On Wed, Jan 17, 2024 at 02:59:55AM +, Yu, Lang wrote: > [Public] > > >-Original Message----- > >From: Wei Liu > >Sent: Wednesday, January 17, 2024 10:53 AM > >To: Yu, Lang > >Cc: Iouri Tarassov ; > >linux-hyperv@vger.kernel.org; > >Wei L

Re: [PATCH] drivers: hv: dxgkrnl: Allow user to specify CPU VA for device allocation

2024-01-16 Thread Wei Liu
On Tue, Jan 16, 2024 at 01:58:53PM +, Yu, Lang wrote: > [Public] > > ping > > >-Original Message- > >From: Yu, Lang > >Sent: Wednesday, December 27, 2023 11:50 AM > >To: Iouri Tarassov > >Cc: linux-hyperv@vger.kernel.org; Yu, Lang > >Subject: [PATCH] drivers: hv: dxgkrnl: Allow

Re: [PATCH v3 08/10] x86/hyperv: Use TDX GHCI to access some MSRs in a TDX VM with the paravisor

2024-01-16 Thread Wei Liu
Hi Dave I was away and only saw your email now. Sorry for the late reply. On Mon, Dec 04, 2023 at 07:10:29AM -0800, Dave Hansen wrote: > On 8/24/23 01:07, Dexuan Cui wrote: > > +#ifdef CONFIG_INTEL_TDX_GUEST > > +static void hv_tdx_msr_write(u64 msr, u64 val) > > +{ > > + struct

Re: [PATCH v2 14/35] PCI: hv: switch hv_get_dom_num() to use atomic find_bit()

2023-12-03 Thread Wei Liu
On Sun, Dec 03, 2023 at 11:32:46AM -0800, Yury Norov wrote: > The function traverses bitmap with for_each_clear_bit() just to allocate > a bit atomically. We can do it better with a dedicated find_and_set_bit(). > > Signed-off-by: Yury Norov > Reviewed-by: Michael Kelley Acked-by: Wei Liu

Re: [PATCH v2] hv_utils: Allow implicit ICTIMESYNCFLAG_SYNC

2023-12-03 Thread Wei Liu
On Thu, Nov 30, 2023 at 11:16:43AM -0800, Boqun Feng wrote: > On Mon, Nov 27, 2023 at 01:35:24PM -0800, pmartin...@linux.microsoft.com > wrote: > > From: Peter Martincic > > > > Hyper-V hosts can omit the _SYNC flag to due a bug on resume from modern > > suspend. In such a case, the guest may

[GIT PULL] Hyper-V fixes for 6.7-rc3

2023-11-21 Thread Wei Liu
Hi Linus, The following changes since commit ffc253263a1375a65fa6c9f62a893e9767fbebfa: Linux 6.6 (2023-10-29 16:31:08 -1000) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-fixes-signed-20231121 for you to

Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-21 Thread Wei Liu
setne %al > > > > > > to: > > > > > > 3e: 65 8b 15 00 00 00 00mov%gs:0x0(%rip),%edx > > > 45: b8 ff ff ff ff mov$0x,%eax > > > 4a: f0 0f b1 15 00 00 00lock cmpxchg %edx,0x0(%rip) > > > 51: 0

Re: [PATCH v2] x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM

2023-11-12 Thread Wei Liu
On Sat, Nov 11, 2023 at 12:37:47AM -0800, Saurabh Sengar wrote: > A Gen2 VM doesn't support legacy PCI/PCIe, so both raw_pci_ops and > raw_pci_ext_ops are NULL, and pci_subsys_init() -> pcibios_init() > doesn't call pcibios_resource_survey() -> e820__reserve_resources_late(); > as a result, any

Re: [PATCH] x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM

2023-11-10 Thread Wei Liu
On Mon, Sep 18, 2023 at 10:36:47PM -0700, Saurabh Singh Sengar wrote: > On Thu, Aug 10, 2023 at 10:31:37PM -0700, Dexuan Cui wrote: > > A Gen2 VM doesn't support legacy PCI/PCIe, so both raw_pci_ops and > > raw_pci_ext_ops are NULL, and pci_subsys_init() -> pcibios_init() > > doesn't call

Re: [PATCH] hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles

2023-11-10 Thread Wei Liu
On Fri, Nov 10, 2023 at 02:59:14PM +, Haiyang Zhang wrote: > @Wei Liu<mailto:li...@microsoft.com> Could you please add this to the hv > tree? > Applied to hyperv-fixes. Sorry for the delay. Thanks, Wei.

Re: [PATCH] hv_utils: Allow implicit ICTIMESYNCFLAG_SYNC

2023-11-05 Thread Wei Liu
On Fri, Oct 27, 2023 at 08:42:33PM +, Peter Martincic wrote: > From 529fcea5d296c22b1dc6c23d55bd6417794b3cda Mon Sep 17 00:00:00 2001 > From: Peter Martincic > Date: Mon, 16 Oct 2023 16:41:10 -0700 > Subject: [PATCH] hv_utils: Allow implicit ICTIMESYNCFLAG_SYNC > > Windows hosts can omit the

Re: [PATCH] hv_balloon: Add module parameter to configure balloon floor value

2023-10-10 Thread Wei Liu
Hi Angelina, On Tue, Oct 10, 2023 at 03:48:07PM -0700, Angelina Vu wrote: > Currently, the balloon floor value is automatically computed, but may be > too small depending on app usage of memory. This patch adds a balloon_floor > value as a module parameter that can be used to manually configure

[GIT PULL] Hyper-V fixes for 6.6-rc6

2023-10-09 Thread Wei Liu
Hi Linus, The following changes since commit ce9ecca0238b140b88f43859b211c9fdfd8e5b70: Linux 6.6-rc2 (2023-09-17 14:40:24 -0700) are available in the Git repository at: ssh://g...@gitolite.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git tags/hyperv-fixes-signed-20231009 for you to

Re: [PATCH v8] hv/hv_kvp_daemon:Support for keyfile based connection profile

2023-10-09 Thread Wei Liu
On Mon, Oct 09, 2023 at 05:32:35PM +0530, Ani Sinha wrote: > > > > On 09-Oct-2023, at 4:08 PM, Shradha Gupta > > wrote: > > > > Ifcfg config file support in NetworkManger is deprecated. This patch > > provides support for the new keyfile config format for connection > > profiles in

Re: [PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs

2023-10-04 Thread Wei Liu
On Wed, Oct 04, 2023 at 08:11:13AM +0200, Greg KH wrote: > On Tue, Oct 03, 2023 at 11:29:42PM +0000, Wei Liu wrote: > > > > > > diff --git a/include/uapi/hyperv/hvgdk.h > > > > > > b/include/uapi/hyperv/hvgdk.h > > > > > > new file

Re: [PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs

2023-10-04 Thread Wei Liu
Hi Greg On Wed, Oct 04, 2023 at 08:11:13AM +0200, Greg KH wrote: > On Tue, Oct 03, 2023 at 11:29:42PM +0000, Wei Liu wrote: > > > > > > diff --git a/include/uapi/hyperv/hvgdk.h > > > > > > b/include/uapi/hyperv/hvgdk.h > > > > > > new file

Re: [PATCH v4 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-10-03 Thread Wei Liu
On Sun, Oct 01, 2023 at 08:20:37AM +0200, Greg KH wrote: > On Sat, Sep 30, 2023 at 09:13:07PM +0000, Wei Liu wrote: > > On Sat, Sep 30, 2023 at 08:31:13PM +0200, Greg KH wrote: > > > On Sat, Sep 30, 2023 at 06:11:19PM +, Wei Liu wrote: > > > > On Sat, Sep 30, 202

Re: [PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs

2023-10-03 Thread Wei Liu
On Sun, Oct 01, 2023 at 08:19:27AM +0200, Greg KH wrote: > On Sat, Sep 30, 2023 at 10:01:58PM +0000, Wei Liu wrote: > > On Sat, Sep 30, 2023 at 08:09:19AM +0200, Greg KH wrote: > > > On Fri, Sep 29, 2023 at 11:01:39AM -0700, Nuno Das Neves wrote: > > > >

Re: [PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs

2023-09-30 Thread Wei Liu
inux.microsoft.com/T/#m3dd8035e381a1344acd7f570c3f5921b7415bedb > > Signed-off-by: Nuno Das Neves > > Acked-by: Wei Liu > > --- > > include/uapi/hyperv/hvgdk.h | 41 + > > include/uapi/hyperv/hvgdk_mini.h | 1076 > > incl

Re: [PATCH v4 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-30 Thread Wei Liu
On Sat, Sep 30, 2023 at 08:31:13PM +0200, Greg KH wrote: > On Sat, Sep 30, 2023 at 06:11:19PM +0000, Wei Liu wrote: > > On Sat, Sep 30, 2023 at 08:11:37AM +0200, Greg KH wrote: > > > On Fri, Sep 29, 2023 at 11:01:41AM -0700, Nuno Das Neves wrote: > > > > --- /dev/n

Re: [PATCH v4 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-30 Thread Wei Liu
On Sat, Sep 30, 2023 at 08:11:37AM +0200, Greg KH wrote: > On Fri, Sep 29, 2023 at 11:01:41AM -0700, Nuno Das Neves wrote: > > --- /dev/null > > +++ b/include/uapi/linux/mshv.h > > @@ -0,0 +1,306 @@ > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > > Much better. > > >

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-27 Thread Wei Liu
Hi Greg It is past midnight here, so I may not be able to articulate my thoughts very well. I want to avoid waiting for another day for another round trip of emails though. We can look at your reply in the morning and reply again. On Wed, Sep 27, 2023 at 08:01:01AM +0200, Greg KH wrote: [...] >

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-26 Thread Wei Liu
On Tue, Sep 26, 2023 at 08:31:03AM +0200, Greg KH wrote: > On Tue, Sep 26, 2023 at 05:54:34AM +0000, Wei Liu wrote: > > On Tue, Sep 26, 2023 at 06:52:46AM +0200, Greg KH wrote: > > > On Mon, Sep 25, 2023 at 05:07:24PM -0700, Nuno Das Neves wrote: > > > > On 9/2

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-25 Thread Wei Liu
On Tue, Sep 26, 2023 at 06:52:46AM +0200, Greg KH wrote: > On Mon, Sep 25, 2023 at 05:07:24PM -0700, Nuno Das Neves wrote: > > On 9/23/2023 12:58 AM, Greg KH wrote: > > > Also, drivers should never call pr_*() calls, always use the proper > > > dev_*() calls instead. > > > > > > > We only use

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-23 Thread Wei Liu
Greg, thank you for looking at the code. On Sat, Sep 23, 2023 at 09:56:13AM +0200, Greg KH wrote: > On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > > +static int __init mshv_vtl_init(void) > > +{ > > + int ret; > > + > > + tasklet_init(_dpc, mshv_vtl_sint_on_msg_dpc, 0); > >

Re: [PATCH v2] hyperv: reduce size of ms_hyperv_info

2023-09-22 Thread Wei Liu
On Fri, Sep 22, 2023 at 09:28:40PM +0200, Olaf Hering wrote: > Use the hole prior shared_gpa_boundary to store the result of get_vtl. > This reduces the size by 8 bytes. > > Signed-off-by: Olaf Hering Applied to hyperv-fixes. Thanks.

Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V

2023-09-22 Thread Wei Liu
her trust level than the > guest, but within the same partition. This provides better isolation and > performance. > > Signed-off-by: Nuno Das Neves As far as I can tell, all my comments from the previous version are addressed. I believe Saurabh and Boqun's comments are addressed, too

Re: [PATCH v3 02/15] mshyperv: Introduce hv_get_hypervisor_version function

2023-09-22 Thread Wei Liu
version numbers at boot. > > Signed-off-by: Nuno Das Neves Acked-by: Wei Liu

Re: [PATCH v3 01/15] hyperv-tlfs: Change shared HV_REGISTER_* defines to HV_MSR_*

2023-09-22 Thread Wei Liu
ame name HyperV uses for this >purpose. HyperV -> Hyper-V. I can fix this up when I apply this patch. > > Signed-off-by: Nuno Das Neves Reviewed-by: Wei Liu

Re: [PATCH v3 12/15] Documentation: Reserve ioctl number for mshv driver

2023-09-22 Thread Wei Liu
On Fri, Sep 22, 2023 at 11:38:32AM -0700, Nuno Das Neves wrote: > Signed-off-by: Nuno Das Neves > Acked-by: Jonathan Corbet Acked-by: Wei Liu

Re: [PATCH v1] hyperv: reduce size of ms_hyperv_info

2023-09-22 Thread Wei Liu
On Tue, Sep 19, 2023 at 06:18:53AM +, Dexuan Cui wrote: > > From: Olaf Hering > > Sent: Monday, September 18, 2023 9:02 AM > > [...] > > Use the hole prior shared_gpa_boundary to store the result of get_vtl. > > This reduces the size by 8 bytes. > > [...] > > ---

Re: [PATCH] x86/hyperv: Add common print prefix "Hyper-V" in hv_init

2023-09-22 Thread Wei Liu
On Tue, Sep 19, 2023 at 04:36:01AM -0700, Saurabh Sengar wrote: > Add "#define pr_fmt()" in hv_init.c to use "Hyper-V:" as common > print prefix for all pr_*() statements in this file. > > Remove the "Hyper-V:" already prefixed in couple of prints. > > Signed-off-by: Saurabh Sengar Applied to

Re: [PATCH v2] x86/hyperv: Remove hv_vtl_early_init initcall

2023-09-22 Thread Wei Liu
On Thu, Sep 21, 2023 at 09:58:40PM -0700, Saurabh Sengar wrote: > There has been cases reported where HYPERV_VTL_MODE is enabled by mistake, > on a non Hyper-V platforms. This causes the hv_vtl_early_init function to > be called in an non Hyper-V/VTL platforms which results the memory >

Re: [PATCH v3] x86/hyperv: Restrict get_vtl to only VTL platforms

2023-09-22 Thread Wei Liu
On Tue, Sep 19, 2023 at 09:04:35PM -0700, Saurabh Sengar wrote: > When Linux runs in a non-default VTL (CONFIG_HYPERV_VTL_MODE=y), > get_vtl() must never fail as its return value is used in negotiations > with the host. In the more generic case, (CONFIG_HYPERV_VTL_MODE=n) the > VTL is always zero