Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-12 Thread Si-Wei Liu
On 12/12/2023 11:21 AM, Eugenio Perez Martin wrote: On Tue, Dec 5, 2023 at 11:46 AM Dragos Tatulea wrote: Addresses get set by .set_vq_address. hw vq addresses will be updated on next modify_virtqueue. Signed-off-by: Dragos Tatulea Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez I'm

Re: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message

2021-04-20 Thread Wei Liu
On Tue, Apr 20, 2021 at 08:44:19AM -0700, Michael Kelley wrote: > Due to a full ring buffer, the driver may be unable to send updates to > the Hyper-V host. But outputing the error message can make the problem > worse because console output is also typically written to the frame > buffer. As a

Re: ** POTENTIAL FRAUD ALERT - RED HAT ** [PATCH v2 1/1] Drivers: hv: vmbus: Increase wait time for VMbus unload

2021-04-20 Thread Wei Liu
On Tue, Apr 20, 2021 at 11:31:54AM +0200, Vitaly Kuznetsov wrote: > Michael Kelley writes: > > > When running in Azure, disks may be connected to a Linux VM with > > read/write caching enabled. If a VM panics and issues a VMbus > > UNLOAD request to Hyper-V, the response is delayed until all

Re: [PATCH v2] Drivers: hv: vmbus: Initialize unload_event statically

2021-04-20 Thread Wei Liu
On Tue, Apr 20, 2021 at 04:50:56AM +, Michael Kelley wrote: > From: Andrea Parri (Microsoft) Sent: Monday, April > 19, 2021 6:44 PM > > > > If a malicious or compromised Hyper-V sends a spurious message of type > > CHANNELMSG_UNLOAD_RESPONSE, the function vmbus_unload_response() will > >

Re: [PATCH 1/2] x86/hyperv: Move hv_do_rep_hypercall to asm-generic

2021-04-18 Thread Wei Liu
On Sun, Apr 18, 2021 at 02:42:55PM +, Michael Kelley wrote: > From: Wei Liu Sent: Sunday, April 18, 2021 6:09 AM > > On Fri, Apr 16, 2021 at 05:43:02PM -0700, Joseph Salisbury wrote: > > > From: Joseph Salisbury > > > > > > This patch makes no

Re: [PATCH 1/2] x86/hyperv: Move hv_do_rep_hypercall to asm-generic

2021-04-18 Thread Wei Liu
On Fri, Apr 16, 2021 at 05:43:02PM -0700, Joseph Salisbury wrote: > From: Joseph Salisbury > > This patch makes no functional changes. It simply moves hv_do_rep_hypercall() > out of arch/x86/include/asm/mshyperv.h and into asm-generic/mshyperv.h > > hv_do_rep_hypercall() is architecture

Re: [PATCH v3 0/3] Drivers: hv: vmbus: Introduce CHANNELMSG_MODIFYCHANNEL_RESPONSE

2021-04-18 Thread Wei Liu
On Fri, Apr 16, 2021 at 04:34:46PM +0200, Andrea Parri (Microsoft) wrote: > Changes since v2[1]: > - fix VMbus protocol version name > - add Reviewed-by: tag > - refactor/simplyfy changes in hv_synic_cleanup() > > Changes since v1[2]: > - rebase on hyperv-next > - split changes into

Re: [PATCH] Drivers: hv: vmbus: Use after free in __vmbus_open()

2021-04-16 Thread Wei Liu
On Tue, Apr 13, 2021 at 05:42:21PM +0200, Andrea Parri wrote: > On Tue, Apr 13, 2021 at 01:50:04PM +0300, Dan Carpenter wrote: > > The "open_info" variable is added to the _connection.chn_msg_list, > > but the error handling frees "open_info" without removing it from the > > list. This will

Re: [PATCH RFC 01/22] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition

2021-04-16 Thread Wei Liu
On Thu, Apr 15, 2021 at 05:33:17PM +0200, Vitaly Kuznetsov wrote: > Wei Liu writes: > > > On Tue, Apr 13, 2021 at 02:26:09PM +0200, Vitaly Kuznetsov wrote: > >> From TLFSv6.0b, this status means: "The caller did not possess sufficient > >> access rights

Re: [PATCH RFC 01/22] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition

2021-04-15 Thread Wei Liu
On Tue, Apr 13, 2021 at 02:26:09PM +0200, Vitaly Kuznetsov wrote: > From TLFSv6.0b, this status means: "The caller did not possess sufficient > access rights to perform the requested operation." > > Signed-off-by: Vitaly Kuznetsov This can be applied to hyperv-next right away. Let me know what

Re: [PATCH] Drivers: hv: vmbus: remove unused function

2021-04-14 Thread Wei Liu
On Wed, Apr 14, 2021 at 02:48:17PM +, Michael Kelley wrote: > From: Jiapeng Chong Sent: Tuesday, April > 13, 2021 11:21 PM [...] > This function became unused as of commit 4226ff69a3df > ("vmbus: simplify hv_ringbuffer_read") on 7/17/2017. > > Reviewed-by: Michael Kelley Applied to

Re: [PATCH] Drivers: hv: vmbus: Use after free in __vmbus_open()

2021-04-13 Thread Wei Liu
On Tue, Apr 13, 2021 at 01:50:04PM +0300, Dan Carpenter wrote: > The "open_info" variable is added to the _connection.chn_msg_list, > but the error handling frees "open_info" without removing it from the > list. This will result in a use after free. First remove it from the > list, and then free

Re: [PATCH] Drivers: hv: vmbus: remove unused including

2021-04-13 Thread Wei Liu
On Tue, Apr 13, 2021 at 05:49:18PM +0800, Yang Li wrote: > Fix the following versioncheck warning: > ./drivers/hv/hv.c: 16 linux/version.h not needed. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Thanks for the patch. This has also been reported by Huawei's kernel bot and fixed in

Re: [PATCH v2 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-12 Thread Wei Liu
On Mon, Apr 12, 2021 at 07:00:17PM +0200, Siddharth Chandrasekaran wrote: > Now that all extant hypercalls that can use XMM registers (based on > spec) for input/outputs are patched to support them, we can start > advertising this feature to guests. > > Cc: Alexander Graf > Cc: Evgeny Iakovlev

Re: [PATCH v2 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-12 Thread Wei Liu
On Mon, Apr 12, 2021 at 07:00:16PM +0200, Siddharth Chandrasekaran wrote: > + > +static inline void kvm_hv_hypercall_read_xmm(struct kvm_hv_hcall *hc) Do you really need inline here? The compiler should be smart enough to inline this function if necessary. > +{ > + int reg; > + > +

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Wei Liu
On Thu, Apr 08, 2021 at 05:54:43PM +0200, Siddharth Chandrasekaran wrote: > On Thu, Apr 08, 2021 at 05:48:19PM +0200, Paolo Bonzini wrote: > > On 08/04/21 17:40, Siddharth Chandrasekaran wrote: > > > > > > Although the Hyper-v TLFS mentions that a guest cannot use this > > > > > > feature > > > >

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Wei Liu
On Thu, Apr 08, 2021 at 04:20:54PM +0200, Siddharth Chandrasekaran wrote: > On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote: > > Siddharth Chandrasekaran writes: > > > > > Now that all extant hypercalls that can use XMM registers (based on > > > spec) for input/outputs are

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Wei Liu
On Thu, Apr 08, 2021 at 05:30:26PM +0200, Paolo Bonzini wrote: > On 08/04/21 17:28, Wei Liu wrote: > > > Although the Hyper-v TLFS mentions that a guest cannot use this feature > > > unless the hypervisor advertises support for it, some hypercalls which > > > we plan

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Wei Liu
On Wed, Apr 07, 2021 at 11:29:26PM +0200, Siddharth Chandrasekaran wrote: > Hyper-V supports the use of XMM registers to perform fast hypercalls. > This allows guests to take advantage of the improved performance of the > fast hypercall interface even though a hypercall may require more than >

Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-07 Thread Wei Liu
On Wed, Apr 07, 2021 at 02:34:01PM +, Haiyang Zhang wrote: > > > > -Original Message- > > From: Wei Liu > > Sent: Wednesday, April 7, 2021 9:17 AM > > To: Dexuan Cui > > Cc: da...@davemloft.net; k...@kernel.org; KY Srinivasan > > ; H

Re: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-04-07 Thread Wei Liu
On Wed, Apr 07, 2021 at 04:02:56PM +0200, Vitaly Kuznetsov wrote: > Wei Liu writes: > > > On Wed, Apr 07, 2021 at 09:38:21AM +0200, Vitaly Kuznetsov wrote: > > > >> One more though: it is probably a good idea to introduce selftests for > >> /dev/mshv (simil

Re: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-04-07 Thread Wei Liu
On Wed, Apr 07, 2021 at 09:38:21AM +0200, Vitaly Kuznetsov wrote: > Nuno Das Neves writes: > > > On 3/5/2021 1:18 AM, Vitaly Kuznetsov wrote: > >> Nuno Das Neves writes: > >> > >>> On 2/9/2021 5:11 AM, Vitaly Kuznetsov wrote: > Nuno Das Neves writes: > > >> ... > > + > >

Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-07 Thread Wei Liu
On Tue, Apr 06, 2021 at 04:23:21PM -0700, Dexuan Cui wrote: [...] > +config MICROSOFT_MANA > + tristate "Microsoft Azure Network Adapter (MANA) support" > + default m > + depends on PCI_MSI > + select PCI_HYPERV OOI which part of the code requires PCI_HYPERV? Asking because I

Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-07 Thread Wei Liu
On Wed, Apr 07, 2021 at 08:08:59AM +, Dexuan Cui wrote: > > From: kernel test robot > > Sent: Tuesday, April 6, 2021 6:31 PM > > ... > > Hi Dexuan, > > I love your patch! Perhaps something to improve: > > > > All warnings (new ones prefixed by >>): > > > >

Re: [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t

2021-04-07 Thread Wei Liu
rq_info from spinlock_t > to raw_spinlock_t > > Cc: sta...@vger.kernel.org > Fixes: 25da4618af24 ("xen/events: don't unmask an event channel > when an eoi is pending") > > Signed-off-by: Luca Fancellu Reviewed-by: Wei Liu

Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers

2021-04-06 Thread Wei Liu
b folder to use new header. > Though for time being include new header back to kernel.h to avoid twisted > indirected includes for existing users. > > Signed-off-by: Andy Shevchenko Acked-by: Wei Liu

Re: [PATCH] x86/hyperv: remove unused including

2021-04-06 Thread Wei Liu
On Tue, Apr 06, 2021 at 09:56:35AM +0800, Yang Li wrote: > Fix the following versioncheck warning: > ./arch/x86/hyperv/hv_proc.c: 3 linux/version.h not needed. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Thanks for the patch. This is already reported and fixed in hyperv-next by

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

2021-04-02 Thread Wei Liu
Hi Linus, The following changes since commit fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8: Linux 5.12-rc1 (2021-02-28 16:05:19 -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-20210402 for you to

Re: [PATCH v2] video: hyperv_fb: Fix a double free in hvfb_probe

2021-03-25 Thread Wei Liu
ory and > leaving the pointer non-NULL, resulting in a double free if an error > occurs or later if hvfb_remove() is called. > > Fix this by removing all kfree(info->apertures) calls in hvfb_getmem(). > This will allow framebuffer_release() to free the memory, which follow

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

2021-03-24 Thread Wei Liu
On Tue, Mar 23, 2021 at 06:47:16PM +, Sunil Muthuswamy wrote: > Linux has support for free page reporting now (36e66c554b5c) for > virtualized environment. On Hyper-V when virtually backed VMs are > configured, Hyper-V will advertise cold memory discard capability, > when supported. This patch

Re: [PATCH -next] x86: Fix unused variable 'hi'

2021-03-24 Thread Wei Liu
On Tue, Mar 23, 2021 at 11:32:50AM +, Wei Liu wrote: > On Tue, Mar 23, 2021 at 10:50:13AM +0800, Xu Yihang wrote: > > Fixes the following W=1 kernel build warning(s): > > arch/x86/hyperv/hv_apic.c:58:15: warning: variable ‘hi’ set but not used > > [-Wunused-but-set-variab

Re: [PATCH -next] x86: Fix unused variable 'msr_val' warning

2021-03-24 Thread Wei Liu
On Tue, Mar 23, 2021 at 10:43:02AM +0800, Xu Yihang wrote: > Fixes the following W=1 kernel build warning(s): > arch/x86/hyperv/hv_spinlock.c:28:16: warning: variable ‘msr_val’ set but not > used [-Wunused-but-set-variable] > unsigned long msr_val; > > As Hypervisor Top-Level Functional

Re: [PATCH -next] x86: Fix unused variable 'msr_val' warning

2021-03-23 Thread Wei Liu
On Tue, Mar 23, 2021 at 01:13:03AM +0100, Ingo Molnar wrote: > > * Michael Kelley wrote: > > > From: Ingo Molnar Sent: Monday, March 22, 2021 > > 2:08 PM > > > > > > * Xu Yihang wrote: > > > > > > > Fixes the following W=1 kernel build warning(s): > > > >

Re: [PATCH -next] x86: Fix unused variable 'hi'

2021-03-23 Thread Wei Liu
On Tue, Mar 23, 2021 at 10:50:13AM +0800, Xu Yihang wrote: > Fixes the following W=1 kernel build warning(s): > arch/x86/hyperv/hv_apic.c:58:15: warning: variable ‘hi’ set but not used > [-Wunused-but-set-variable] > > Compiled with CONFIG_HYPERV enabled: > make allmodconfig ARCH=x86_64

Re: [PATCH] video/fbdev: Fix a double free in hvfb_probe

2021-03-23 Thread Wei Liu
Thanks for your patch. I would like to change the prefix to "video: hyperv_fb:" to be more specific. On Tue, Mar 23, 2021 at 12:33:50AM -0700, Lv Yunlong wrote: > In function hvfb_probe in hyperv_fb.c, it calls hvfb_getmem(hdev, info) > and return err when info->apertures is freed. > > In the

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

2021-03-22 Thread Wei Liu
On Fri, Mar 19, 2021 at 09:30:50PM +, Michael Kelley wrote: > From: Sunil Muthuswamy Sent: Friday, March 19, 2021 > 2:21 PM > > > > > 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

Re: [PATCH] hyperv: Few mundane typo fixes

2021-03-22 Thread Wei Liu
On Sun, Mar 21, 2021 at 04:41:53PM -0700, Randy Dunlap wrote: > On March 21, 2021 4:31:08 PM PDT, Bhaskar Chowdhury > wrote: > > > >s/sructure/structure/ > >s/extention/extension/ > >s/offerred/offered/ > >s/adversley/adversely/ > > > >Signed-off-by: Bhaskar Chowdhury > > Acked-by: Randy

Re: [PATCH -next] x86: Fix unused variable 'msr_val' warning

2021-03-22 Thread Wei Liu
On Mon, Mar 22, 2021 at 11:17:13AM +0800, Xu Yihang wrote: > Fixes the following W=1 kernel build warning(s): > arch/x86/hyperv/hv_spinlock.c:28:16: warning: variable ‘msr_val’ set but not > used [-Wunused-but-set-variable] > unsigned long msr_val; > > As Hypervisor Top-Level Functional

Re: [PATCH -next] x86: Fix unused variable 'hi'

2021-03-22 Thread Wei Liu
On Mon, Mar 22, 2021 at 11:54:26AM +0800, Xu Yihang wrote: > Fixes the following W=1 kernel build warning(s): > arch/x86/hyperv/hv_apic.c:58:15: warning: variable ‘hi’ set but not used > [-Wunused-but-set-variable] > > Compiled with CONFIG_HYPERV enabled: > make allmodconfig ARCH=x86_64

Re: [PATCH v2] drivers: hv: Fix EXPORT_SYMBOL and tab spaces issue

2021-03-22 Thread Wei Liu
On Wed, Mar 10, 2021 at 10:51:55AM +0530, Vasanth wrote: > 1.Fixed EXPORT_SYMBOL should be follow immediately function/variable. > 2.Fixed code tab spaces issue. > > Signed-off-by: Vasanth M Applied to hyperv-next.

Re: linux-next: manual merge of the hyperv tree with the tip tree

2021-03-16 Thread Wei Liu
On Tue, Mar 16, 2021 at 04:02:54PM +0100, Borislav Petkov wrote: > On Mon, Mar 15, 2021 at 02:35:05PM +1100, Stephen Rothwell wrote: > > Hi all, > > > > Today's linux-next merge of the hyperv tree got a conflict in: > > > > arch/x86/include/asm/mshyperv.h > > > > between commit: > > > >

Re: [PATCH 1/1] asm-generic/hyperv: Add missing function prototypes per -W1 warnings

2021-03-11 Thread Wei Liu
On Wed, Mar 10, 2021 at 10:47:49AM -0800, Michael Kelley wrote: > Add two function prototypes for -W1 warnings generated by the > kernel test robot. > > Reported-by: kernel test robot > Signed-off-by: Michael Kelley Applied to hyperv-next

Re: [patch 12/14] PCI: hv: Use tasklet_disable_in_atomic()

2021-03-10 Thread Wei Liu
> Signed-off-by: Thomas Gleixner Acked-by: Wei Liu

Re: [PATCH v3 00/10] Refactor arch specific Hyper-V code

2021-03-08 Thread Wei Liu
On Tue, Mar 02, 2021 at 01:38:12PM -0800, Michael Kelley wrote: [...] > Michael Kelley (10): > Drivers: hv: vmbus: Move Hyper-V page allocator to arch neutral code > x86/hyper-v: Move hv_message_type to architecture neutral module > Drivers: hv: Redo Hyper-V synthetic MSR get/set functions >

Re: [PATCH] drivers: hv: Fix no spaces issue

2021-03-08 Thread Wei Liu
On Fri, Mar 05, 2021 at 09:34:49PM +0530, Vasanth wrote: > Fixed code spaces issue. > > Signed-off-by: Vasanth M What do you mean by "Fixed no spaces issue" in the title? I can see you deleted an empty line and changed some tabs to spaces. Please be specific in the commit message. Wei.

Re: [PATCH] Drivers: hv: vmbus: Drop error message when 'No request id available'

2021-03-03 Thread Wei Liu
On Mon, Mar 01, 2021 at 08:13:48PM +0100, Andrea Parri (Microsoft) wrote: > Running out of request IDs on a channel essentially produces the same > effect as running out of space in the ring buffer, in that -EAGAIN is > returned. The error message in hv_ringbuffer_write() should either be >

Re: [PATCH v3] drivers: hv: Fix whitespace errors

2021-03-02 Thread Wei Liu
On Fri, Feb 19, 2021 at 05:30:36PM +, Michael Kelley wrote: > From: Vasanth Sent: Friday, February 19, 2021 9:13 AM > > To: KY Srinivasan > > Cc: Haiyang Zhang ; Stephen Hemminger > > ; wei@kernel.org; linux-hyp...@vger.kernel.org; > > linux- > > ker...@vger.kernel.org; Vasanth > >

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-03-01 Thread Si-Wei Liu
On 2/28/2021 1:27 PM, Michael S. Tsirkin wrote: On Thu, Feb 25, 2021 at 04:56:42PM -0800, Si-Wei Liu wrote: Hi Michael, Are you okay to live without this ioctl for now? I think QEMU is the one that needs to be fixed and will have to be made legacy guest aware. I think the kernel can just

Re: [PATCH v2 00/10] Refactor arch specific Hyper-V code

2021-03-01 Thread Wei Liu
On Sun, Feb 28, 2021 at 05:15:22PM -0800, Michael Kelley wrote: > To support Linux guests on Hyper-V on multiple architectures, the original > approach factored out all differences between Hyper-V on x86/x64 and > Hyper-V on ARM64 into functions or #defines under arch/x86 and > arch/arm64. Some of

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-25 Thread Si-Wei Liu
would proceed to reverting commit fe36cbe067 and related code in question from the kernel. Thanks, -Siwei On 2/24/2021 10:24 AM, Si-Wei Liu wrote: Detecting it isn't enough though, we will need a new ioctl to notify the kernel that it's a legacy guest. Ugh :( Well, although I think adding

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-24 Thread Si-Wei Liu
On 2/23/2021 9:04 PM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 11:35:57AM -0800, Si-Wei Liu wrote: On 2/23/2021 5:26 AM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 10:03:57AM +0800, Jason Wang wrote: On 2021/2/23 9:12 上午, Si-Wei Liu wrote: On 2/21/2021 11:34 PM, Michael S

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-23 Thread Si-Wei Liu
On 2/23/2021 5:26 AM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 10:03:57AM +0800, Jason Wang wrote: On 2021/2/23 9:12 上午, Si-Wei Liu wrote: On 2/21/2021 11:34 PM, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 12:14:17PM +0800, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-22 Thread Si-Wei Liu
On 2/21/2021 11:34 PM, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 12:14:17PM +0800, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei Liu wrote: Commit 452639a64ad8 ("vdpa: make sure set_features is invoked for legacy") made an exception for legacy guests to reset features

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-22 Thread Si-Wei Liu
On 2/21/2021 8:14 PM, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei Liu wrote: Commit 452639a64ad8 ("vdpa: make sure set_features is invoked for legacy") made an exception for legacy guests to reset features to 0, when config space is accessed before features are set. We shou

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

2021-02-22 Thread Wei Liu
associated with a virtual processor. > > Signed-off-by: Michael Kelley Reviewed-by: Wei Liu

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/19/2021 6:38 PM, Jason Wang wrote: Right now the value is exposed to userspace via GET_VRING_BASE, so only last_avail_idx is synced. If we need sync last_used_idx, we should also sync pending indices which requires more thoughts. Technically it doesn't sound right - crossing the

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-19 Thread Si-Wei Liu
On 2/17/2021 11:42 AM, Si-Wei Liu wrote: On 2/16/2021 8:20 AM, Eli Cohen wrote: When we suspend the VM, the VDPA interface will be reset. When the VM is resumed again, clear_virtqueues() will clear the available and used indices resulting in hardware virqtqueue objects becoming out of sync

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/18/2021 7:10 PM, Jason Wang wrote: On 2021/2/18 8:43 下午, Si-Wei Liu wrote: On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote

[PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-19 Thread Si-Wei Liu
rematurely causes correct MTU and link status unable to load for the very first config space access, rendering issues like guest showing inaccurate MTU value, or failure to reject out-of-range MTU. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-W

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-18 Thread Si-Wei Liu
On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20:14AM +0800

Re: [PATCH v2 3/3] vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK

2021-02-17 Thread Si-Wei Liu
On 2/16/2021 7:21 AM, Eli Cohen wrote: On Thu, Feb 11, 2021 at 09:33:14AM +0200, Eli Cohen wrote: On Wed, Feb 10, 2021 at 01:48:00PM -0800, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from device

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-17 Thread Si-Wei Liu
On 2/17/2021 1:20 PM, Michael S. Tsirkin wrote: On Wed, Feb 17, 2021 at 11:42:48AM -0800, Si-Wei Liu wrote: On 2/16/2021 8:20 AM, Eli Cohen wrote: When we suspend the VM, the VDPA interface will be reset. When the VM is resumed again, clear_virtqueues() will clear the available and used

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-17 Thread Si-Wei Liu
by set_vq_state(). In get_vq_state() we return the value of hardware used index. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen Acked-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 17 - 1 file changed, 4 inserti

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-16 Thread Si-Wei Liu
On 2/10/2021 7:45 AM, Eli Cohen wrote: On Wed, Feb 10, 2021 at 12:59:03AM -0800, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20

[GIT PULL] Hyper-V commits for 5.12

2021-02-16 Thread Wei Liu
rom Andrea Parri and Andres Beltran. - Patches to make Linux boot as the root partition on Microsoft Hypervisor from Wei Liu. - One patch to add a new sysfs interface to support hibernation on Hyper-V from Dexuan Cui. - Two miscellaneous clean-up patches from Colin a

Re: Regressions with VMBus/VSCs hardening changes

2021-02-15 Thread Wei Liu
On Fri, Feb 12, 2021 at 05:50:50PM +0100, Andrea Parri wrote: > Hi all, [...] > 2) IIUC a8c3209998afb5 could be dropped (after rebase) without further modi- >fications to hyperv-next. I've reverted the said patch from hyperv-next. Wei.

Re: [PATCH v2 4/8] xen/netback: fix spurious event detection for common event case

2021-02-11 Thread Wei Liu
e a event being spurious if no rx OR no tx requests are > pending. > > Fix that plus using local variables for rx/tx pending indicators in > order to split function calls and if condition. > > Fixes: 23025393dbeb3b ("xen/netback: use lateeoi irq binding") > Signed-off-by: Juergen Gross Reviewed-by: Wei Liu

[PATCH v2 1/3] vdpa/mlx5: should exclude header length and fcs from mtu

2021-02-10 Thread Si-Wei Liu
e Ethernet header up to the FCS altogether. Fix the MTU so packets won't get dropped silently. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang Acked-by: Eli Cohen --- drivers/vdpa/mlx5/core/mlx5_vdpa.h |

[PATCH v2 0/3] mlx5_vdpa bug fixes

2021-02-10 Thread Si-Wei Liu
->v2: move feature capability query to probing (Eli) Si-Wei Liu (3): vdpa/mlx5: should exclude header length and fcs from mtu vdpa/mlx5: fix feature negotiation across device reset vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 drivers/v

[PATCH v2 3/3] vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK

2021-02-10 Thread Si-Wei Liu
is to be started, i.e. until VIRTIO_CONFIG_S_DRIVER_OK is set again in set_status(). Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v2 2/3] vdpa/mlx5: fix feature negotiation across device reset

2021-02-10 Thread Si-Wei Liu
. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdp

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-10 Thread Si-Wei Liu
On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20:14AM +0800, Jason Wang wrote: On 2021/2/8 下午6:04, Eli Cohen wrote: On Mon, Feb 08, 2021 at 05:04

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-09 Thread Si-Wei Liu
, 2021 at 12:27:18PM +0800, Jason Wang wrote: On 2021/2/6 上午7:07, Si-Wei Liu wrote: On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new memory map. In such case, we need to restore the hardware

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-09 Thread Si-Wei Liu
On 2/8/2021 7:37 PM, Jason Wang wrote: On 2021/2/6 下午8:29, Si-Wei Liu wrote: While virtq is stopped,  get_vq_state() is supposed to be  called to  get  sync'ed  with  the latest internal avail_index from device. The saved avail_index is used to restate  the virtq  once device is started

Re: [PATCH 4/7] xen/events: link interdomain events to associated xenbus device

2021-02-09 Thread Wei Liu
aces to take the pointer to the xenbus device as a > parameter instead of the domain id of the other side. > > While at it remove the stale prototype of bind_evtchn_to_irq_lateeoi(). > > Signed-off-by: Juergen Gross Reviewed-by: Wei Liu

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:48 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:24AM -0800, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from device. The saved avail_index is used to restate the virtq once

Re: [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:35 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:23AM -0800, Si-Wei Liu wrote: The mlx_features denotes the capability for which set of virtio features is supported by device. In principle, this field needs not be cleared during virtio device reset, as this capability

[PATCH 1/3] mlx5_vdpa: should exclude header length and fcs from mtu

2021-02-06 Thread Si-Wei Liu
e Ethernet header up to the FCS altogether. Fix the MTU so packets won't get dropped silently. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 drivers/vdpa/mlx5/net/mlx5_vnet.c | 15 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dr

[PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-06 Thread Si-Wei Liu
is to be started, i.e. until VIRTIO_CONFIG_S_DRIVER_OK is set again in set_status(). Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset

2021-02-06 Thread Si-Wei Liu
. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index b8416c4..aa6f8cd 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-05 Thread Si-Wei Liu
On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new memory map. In such case, we need to restore the hardware available and used indices. The driver failed to restore the used index which is

Re: linux-next: manual merge of the hyperv tree with Linus' tree

2021-02-05 Thread Wei Liu
On Fri, Feb 05, 2021 at 07:02:02PM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the hyperv tree got a conflict in: > > arch/x86/hyperv/hv_init.c > > between commit: > > fff7b5e6ee63 ("x86/hyperv: Initialize clockevents after LAPIC is > initialized") > > from

Re: [PATCH v6 00/16] Introducing Linux root partition support for Microsoft Hypervisor

2021-02-04 Thread Wei Liu
On Wed, Feb 03, 2021 at 03:04:19PM +, Wei Liu wrote: > Wei Liu (16): > asm-generic/hyperv: change HV_CPU_POWER_MANAGEMENT to > HV_CPU_MANAGEMENT > x86/hyperv: detect if Linux is the root partition > Drivers: hv: vmbus: skip VMBus initialization if Linux is root >

Re: [PATCH v6 08/16] ACPI / NUMA: add a stub function for node_to_pxm()

2021-02-04 Thread Wei Liu
On Thu, Feb 04, 2021 at 07:45:25PM +0100, Rafael J. Wysocki wrote: > On Thu, Feb 4, 2021 at 7:41 PM Wei Liu wrote: > > > > On Wed, Feb 03, 2021 at 03:04:27PM +, Wei Liu wrote: > > > There is already a stub function for pxm_to_node but conversion to the > >

Re: [PATCH v6 15/16] x86/hyperv: implement an MSI domain for root partition

2021-02-04 Thread Wei Liu
On Thu, Feb 04, 2021 at 06:40:55PM +, Michael Kelley wrote: > From: Wei Liu Sent: Thursday, February 4, 2021 9:57 AM [...] > > I've got the following diff to fix both issues. If you're happy with the > > changes, can you give your Reviewed-by? That saves a round of posting

Re: [PATCH v6 08/16] ACPI / NUMA: add a stub function for node_to_pxm()

2021-02-04 Thread Wei Liu
On Wed, Feb 03, 2021 at 03:04:27PM +, Wei Liu wrote: > There is already a stub function for pxm_to_node but conversion to the > other direction is missing. > > It will be used by Microsoft Hypervisor code later. > > Signed-off-by: Wei Liu Hi ACPI maintainer

Re: [PATCH v6 15/16] x86/hyperv: implement an MSI domain for root partition

2021-02-04 Thread Wei Liu
On Thu, Feb 04, 2021 at 05:43:16PM +, Michael Kelley wrote: [...] > > remove_cpuhp_state: > > diff --git a/arch/x86/hyperv/irqdomain.c b/arch/x86/hyperv/irqdomain.c > > new file mode 100644 > > index ..117f17e8c88a > > --- /dev/null > > +++ b/arch/x86/hyperv/irqdomain.c > > @@

Re: [PATCH v5 16/16] iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition

2021-02-04 Thread Wei Liu
On Thu, Feb 04, 2021 at 04:41:47PM +, Michael Kelley wrote: > From: Wei Liu Sent: Wednesday, February 3, 2021 4:47 AM [...] > > > > + > > > > + if (level) > > > > + intr_desc->trigger_mode = > > > >

Re: [PATCH 08/10] clocksource/drivers/hyper-v: Handle sched_clock differences inline

2021-02-04 Thread Wei Liu
On Thu, Feb 04, 2021 at 04:28:38PM +, Michael Kelley wrote: > From: Wei Liu Sent: Monday, February 1, 2021 10:55 AM > > > > On Wed, Jan 27, 2021 at 12:23:43PM -0800, Michael Kelley wrote: > > [...] > > > +/* > > > + * Reference to pv_ops must b

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-03 Thread Si-Wei Liu
On Tue, Feb 2, 2021 at 9:16 PM Jason Wang wrote: > > > On 2021/2/3 上午1:54, Si-Wei Liu wrote: > > On Tue, Feb 2, 2021 at 1:23 AM Eli Cohen wrote: > >> On Tue, Feb 02, 2021 at 12:38:51AM -0800, Si-Wei Liu wrote: > >>> Thanks Eli and Jason for clarifications. S

Re: [PATCH] vdpa/mlx5: Restore the hardware used index after change map

2021-02-03 Thread Si-Wei Liu
On Tue, Feb 2, 2021 at 10:48 PM Eli Cohen wrote: > > On Tue, Feb 02, 2021 at 09:14:02AM -0800, Si-Wei Liu wrote: > > On Tue, Feb 2, 2021 at 6:34 AM Eli Cohen wrote: > > > > > > When a change of memory map occurs, the hardware resources are destroyed > > >

[PATCH v6 01/16] asm-generic/hyperv: change HV_CPU_POWER_MANAGEMENT to HV_CPU_MANAGEMENT

2021-02-03 Thread Wei Liu
This makes the name match Hyper-V TLFS. Signed-off-by: Wei Liu Reviewed-by: Vitaly Kuznetsov Reviewed-by: Pavel Tatashin Reviewed-by: Michael Kelley --- include/asm-generic/hyperv-tlfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/hyperv-tlfs.h b

[PATCH v6 02/16] x86/hyperv: detect if Linux is the root partition

2021-02-03 Thread Wei Liu
For now we can use the privilege flag to check. Stash the value to be used later. Put in a bunch of defines for future use when we want to have more fine-grained detection. Signed-off-by: Wei Liu Reviewed-by: Pavel Tatashin --- v3: move hv_root_partition to mshyperv.c --- arch/x86/include/asm

[PATCH v6 04/16] clocksource/hyperv: use MSR-based access if running as root

2021-02-03 Thread Wei Liu
When Linux runs as the root partition, the setup required for TSC page is different. Luckily Linux also has access to the MSR based clocksource. We can just disable the TSC page clocksource if Linux is the root partition. Signed-off-by: Wei Liu Acked-by: Daniel Lezcano Reviewed-by: Pavel

[PATCH v6 03/16] Drivers: hv: vmbus: skip VMBus initialization if Linux is root

2021-02-03 Thread Wei Liu
There is no VMBus and the other infrastructures initialized in hv_acpi_init when Linux is running as the root partition. Signed-off-by: Wei Liu Reviewed-by: Pavel Tatashin Reviewed-by: Michael Kelley --- v3: Return 0 instead of -ENODEV. --- drivers/hv/vmbus_drv.c | 3 +++ 1 file changed, 3

[PATCH v6 05/16] x86/hyperv: allocate output arg pages if required

2021-02-03 Thread Wei Liu
When Linux runs as the root partition, it will need to make hypercalls which return data from the hypervisor. Allocate pages for storing results when Linux runs as the root partition. Signed-off-by: Lillian Grassin-Drake Co-Developed-by: Lillian Grassin-Drake Signed-off-by: Wei Liu --- v3

[PATCH v6 08/16] ACPI / NUMA: add a stub function for node_to_pxm()

2021-02-03 Thread Wei Liu
There is already a stub function for pxm_to_node but conversion to the other direction is missing. It will be used by Microsoft Hypervisor code later. Signed-off-by: Wei Liu --- v6: new --- include/acpi/acpi_numa.h | 4 1 file changed, 4 insertions(+) diff --git a/include/acpi

[PATCH v6 10/16] x86/hyperv: implement and use hv_smp_prepare_cpus

2021-02-03 Thread Wei Liu
Microsoft Hypervisor requires the root partition to make a few hypercalls to setup application processors before they can be used. Signed-off-by: Lillian Grassin-Drake Signed-off-by: Sunil Muthuswamy Co-Developed-by: Lillian Grassin-Drake Co-Developed-by: Sunil Muthuswamy Signed-off-by: Wei

[PATCH v6 09/16] x86/hyperv: provide a bunch of helper functions

2021-02-03 Thread Wei Liu
-by: Nuno Das Neves Signed-off-by: Wei Liu --- v6: 1. Address Michael's comments. v4: Fix compilation issue when CONFIG_ACPI_NUMA is not set. v3: 1. Add __packed to structures. 2. Drop unnecessary exports. v2: 1. Adapt to hypervisor side changes 2. Address Vitaly's comments use u64 status pages

[PATCH v6 12/16] asm-generic/hyperv: update hv_interrupt_entry

2021-02-03 Thread Wei Liu
We will soon use the same structure to handle IO-APIC interrupts as well. Introduce an enum to identify the source and a data structure for IO-APIC RTE. While at it, update pci-hyperv.c to use the enum. No functional change. Signed-off-by: Wei Liu Acked-by: Rob Herring Reviewed-by: Michael

  1   2   3   4   5   6   7   8   >