RE: [RFC] How to test panic handlers, without crashing the kernel

2024-03-05 Thread Michael Kelley
e very simple / safe ones, while others are > destructive in nature. > > An example of a good behaving notifier that is destructive is the > Hyper-V one, that destroys an essential host-guest interface (called > "vmbus connection"). What happens if we trigger this one jus

RE: [PATCH 1/1] fbdev/hyperv_fb: Fix logic error for Gen2 VMs in hvfb_getmem()

2024-03-01 Thread Michael Kelley
From: Wei Liu Sent: Friday, March 1, 2024 1:26 AM > > On Fri, Feb 09, 2024 at 04:53:37PM +0100, Helge Deller wrote: > > On 2/9/24 16:23, Michael Kelley wrote: > > > From: Thomas Zimmermann Sent: Thursday, February 1, > > > 2024 12:17 AM > [...] >

RE: [PATCH 1/1] fbdev/hyperv_fb: Fix logic error for Gen2 VMs in hvfb_getmem()

2024-02-09 Thread Michael Kelley
From: Thomas Zimmermann Sent: Thursday, February 1, 2024 12:17 AM > > Hi > > Am 01.02.24 um 07:00 schrieb mhkelle...@gmail.com: > > From: Michael Kelley > > > > A recent commit removing the use of screen_info introduced a logic > > error. The error c

RE: [PATCH] Replace ioremap_cache() with memremap()

2023-11-05 Thread Michael Kelley
From: Nischala Yelchuri Sent: Wednesday, November 1, 2023 9:02 AM > It's customary for the patch "Subject:" line to have a prefix indicating the area of the code being modified. This patch touches on multiple Hyper-V drivers, so there's not a clear choice for prefix. I would suggest using

RE: [PATCH] drm/hyperv: Fix a compilation issue because of not including screen_info.h

2023-07-09 Thread Michael Kelley (LINUX)
+ > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > index a7d2c92d6c6a..8026118c6e03 100644 > --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > > #include > #include > -- > 2.25.1 Reviewed-by: Michael Kelley

RE: [PATCH v2 RESEND 4/7] swiotlb: Dynamically allocated bounce buffers

2023-05-15 Thread Michael Kelley (LINUX)
From: Petr Tesarik Sent: Tuesday, May 9, 2023 2:18 AM > > The software IO TLB was designed with the assumption that it is not > used much, especially on 64-bit systems, so a small fixed memory > area (currently 64 MiB) is sufficient to handle the few cases which > still require a bounce buffer.

RE: [PATCH v2 031/101] fbdev/hyperv_fb: Duplicate video-mode option string

2023-03-12 Thread Michael Kelley (LINUX)
NTHVID_FB_SIZE_WIN8)) { > pr_err("Screen resolution option is out of range: skipped\n"); > - return; > + goto out; > } > > screen_width = x; > screen_height = y; > - return; > + > +out: > + kfree(optbuf); > } > > /* > -- > 2.39.2 Reviewed-by: Michael Kelley

RE: [PATCH 08/18] fbdev/hyperv-fb: Do not set struct fb_info.apertures

2022-12-29 Thread Michael Kelley (LINUX)
nfo->apertures->ranges[0].size, > - false, KBUILD_MODNAME); > + aperture_remove_conflicting_devices(base, size, false, KBUILD_MODNAME); > > if (gen2vm) { > /* framebuffer is reallocated, clear screen_info to avoid > misuse from kexec */ > -- > 2.39.0 Reviewed-by: Michael Kelley

RE: [PATCH] drm/hyperv: Don't overwrite dirt_needed value set by host

2022-09-22 Thread Michael Kelley (LINUX)
init(hv); > if (ret) > goto err_vmbus_close; > -- > 2.31.1 Reviewed-by: Michael Kelley

RE: [PATCH] drm/hyperv: Add ratelimit on error message

2022-09-10 Thread Michael Kelley (LINUX)
ndpacket(struct hv_device > *hdev, > struct synthvid_msg > VM_PKT_DATA_INBAND, 0); > > if (ret) > - drm_err(>dev, "Unable to send packet via vmbus\n"); > + drm_err_ratelimited(>dev, "Unable to send packet via vmbus; > error %d\n", ret); > > return ret; > } > -- > 1.8.3.1 Reviewed-by: Michael Kelley

RE: [PATCH] drm/hyperv: Don't rely on screen_info.lfb_base for Gen1 VMs

2022-09-10 Thread Michael Kelley (LINUX)
r); > + pci_dev_put(pdev); > + if (ret) { > + drm_err(dev, "Not able to remove boot fb\n"); > + return ret; > + } > + } > > hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024; > > -- > 2.34.1 Reviewed-by: Michael Kelley

RE: [PATCH v2 3/3] Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region

2022-08-25 Thread Michael Kelley (LINUX)
not fb_overlap_ok */ > + if (!fb_overlap_ok && fb_mmio && > + (((start >= fb_mmio->start) && (start <= > fb_mmio->end)) || > + ((end >= fb_mmio->start) && (end <= > fb_mmio->end > + continue; > + > shadow = __request_region(iter, start, size, NULL, > IORESOURCE_BUSY); > if (!shadow) > -- > 2.37.1 Other than my musings on the commit message, Reviewed-by: Michael Kelley

RE: [PATCH v2 2/3] Drivers: hv: Always reserve framebuffer region for Gen1 VMs

2022-08-25 Thread Michael Kelley (LINUX)
>>= 1) { > - fb_mmio = __request_region(hyperv_mmio, > -screen_info.lfb_base, size, > -fb_mmio_name, 0); > - } > - } > + for (; !fb_mmio && (size >= 0x10); size >>= 1) > + fb_mmio = __request_region(hyperv_mmio, start, size, > fb_mmio_name, 0); > } > > /** > -- > 2.37.1 Reviewed-by: Michael Kelley

RE: [PATCH v2 1/3] PCI: Move PCI_VENDOR_ID_MICROSOFT/PCI_DEVICE_ID_HYPERV_VIDEO definitions to pci_ids.h

2022-08-25 Thread Michael Kelley (LINUX)
E_ID_ICE_1712 0x1712 > #define PCI_DEVICE_ID_VT1724 0x1724 > > +#define PCI_VENDOR_ID_MICROSOFT 0x1414 > +#define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353 > + > #define PCI_VENDOR_ID_OXSEMI 0x1415 > #define PCI_DEVICE_ID_OXSEMI_12PCI8400x8403 > #define PCI_DEVICE_ID_OXSEMI_PCIe840 0xC000 > -- > 2.37.1 Reviewed-by: Michael Kelley

RE: [PATCH v1 3/4] Drivers: hv: Always reserve framebuffer region for Gen1 VMs

2022-08-23 Thread Michael Kelley (LINUX)
From: Vitaly Kuznetsov Sent: Thursday, August 18, 2022 7:25 AM > > vmbus_reserve_fb() tries reserving framebuffer region iff > screen_info.lfb_base is set. Gen2 VMs seem to have it set by EFI fb > but on Gen1 VM it is observed to be zero. FWIW, in a Gen1 VM, whether screen_info.lfb_base is

RE: [PATCH v1 2/4] drm/hyperv: Don't forget to put PCI device when removing conflicting FB fails

2022-08-22 Thread Michael Kelley (LINUX)
From: Vitaly Kuznetsov Sent: Thursday, August 18, 2022 7:25 AM > > When drm_aperture_remove_conflicting_pci_framebuffers() fails, 'pdev' > needs to be released with pci_dev_put(). > > Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video > device") > Signed-off-by:

RE: [PATCH v1 1/4] Drivers: hv: Move legacy Hyper-V PCI video device's ids to linux/hyperv.h

2022-08-22 Thread Michael Kelley (LINUX)
From: Vitaly Kuznetsov Sent: Thursday, August 18, 2022 7:25 AM > > There are already two places in kernel with PCI_VENDOR_ID_MICROSOFT/ > PCI_DEVICE_ID_HYPERV_VIDEO and there's a need to use these from core > Vmbus code. Move the defines to a common header. > > No functional change. > >

RE: [PATCH] drm/hyperv: Fix an error handling path in hyperv_vmbus_probe()

2022-08-05 Thread Michael Kelley (LINUX)
b5abced55. As you noted, this patch won't apply cleanly on stable kernel versions that lack that commit, so we'll need a separate patch for stable if we want to make the fix there. > Signed-off-by: Christophe JAILLET All that said, the fix looks good, so Reviewed-by: Michael Kelley > --- >

RE: [PATCH] fbdev: Fix order of arguments to aperture_remove_conflicting_devices()

2022-07-21 Thread Michael Kelley (LINUX)
fo->apertures->ranges[0].base, > info->apertures->ranges[0].size, > - KBUILD_MODNAME, false); > + false, KBUILD_MODNAME); > > if (gen2vm) { > /* framebuffer is reallocated, clear screen_info to avoid > misuse from > kexec */ > -- > 2.36.1 For the Hyper-V frame buffer driver: Reviewed-by: Michael Kelley

RE: [PATCH 0/4] Remove support for Hyper-V 2008 and 2008R2/Win7

2022-05-08 Thread Michael Kelley (LINUX)
From: Pavel Machek Sent: Wednesday, May 4, 2022 10:23 AM > > Hi! > > > Linux code for running as a Hyper-V guest includes special cases for the > > first released versions of Hyper-V: 2008 and 2008R2/Windows 7. These > > versions were very thinly used for running Linux guests when first > >

[PATCH 1/4] Drivers: hv: vmbus: Remove support for Hyper-V 2008 and Hyper-V 2008R2/Win7

2022-05-02 Thread Michael Kelley
the code by removing the negotiation of the VMbus protocol versions required for these releases of Hyper-V, and by removing the special case code for handling these VMbus protocol versions. Signed-off-by: Michael Kelley --- drivers/hv/channel_mgmt.c | 29 +-- drivers/hv

[PATCH 2/4] scsi: storvsc: Remove support for Hyper-V 2008 and 2008R2/Win7

2022-05-02 Thread Michael Kelley
for effective production usage of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the storvsc driver. Signed-off-by: Michael Kelley --- drivers

[PATCH 3/4] video: hyperv_fb: Remove support for Hyper-V 2008 and 2008R2/Win7

2022-05-02 Thread Michael Kelley
of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the hyperv_fb driver. Signed-off-by: Michael Kelley --- drivers/video/fbdev/hyperv_fb.c | 23

[PATCH 4/4] drm/hyperv: Remove support for Hyper-V 2008 and 2008R2/Win7

2022-05-02 Thread Michael Kelley
of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the DRM Hyper-V driver. Signed-off-by: Michael Kelley --- drivers/gpu/drm/hyperv

[PATCH 0/4] Remove support for Hyper-V 2008 and 2008R2/Win7

2022-05-02 Thread Michael Kelley
-V team within Microsoft, we're already past the point that it has any value. Michael Kelley (4): Drivers: hv: vmbus: Remove support for Hyper-V 2008 and Hyper-V 2008R2/Win7 scsi: storvsc: Remove support for Hyper-V 2008 and 2008R2/Win7 video: hyperv_fb: Remove support for Hyper-V 2008

RE: [PATCH v2] hv: account for packet descriptor in maximum packet size

2022-01-27 Thread Michael Kelley (LINUX)
From: Yanming Liu Sent: Wednesday, January 19, 2022 12:14 PM > > On Thu, Jan 20, 2022 at 2:12 AM Michael Kelley (LINUX) > wrote: > > > > From: Wei Liu Sent: Friday, January 14, 2022 11:13 AM > > > > > > On Mon, Jan 10, 2022 at 01:44:19AM +0100, Andrea P

RE: [PATCH 1/1] video: hyperv_fb: Fix validation of screen resolution

2022-01-23 Thread Michael Kelley (LINUX)
From: Wei Liu Sent: Sunday, January 23, 2022 1:56 PM > > On Sun, Jan 16, 2022 at 09:53:06PM +, Haiyang Zhang wrote: > > > > > > > -Original Message- > > > From: Michael Kelley (LINUX) > > > Sent: Sunday, January 16, 2022 2:19 PM > &

RE: [PATCH v2] hv: account for packet descriptor in maximum packet size

2022-01-19 Thread Michael Kelley (LINUX)
From: Wei Liu Sent: Friday, January 14, 2022 11:13 AM > > On Mon, Jan 10, 2022 at 01:44:19AM +0100, Andrea Parri wrote: > > (Extending Cc: list,) > > > > On Sun, Jan 09, 2022 at 05:55:16PM +0800, Yanming Liu wrote: > > > Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V > >

[PATCH 1/1] video: hyperv_fb: Fix validation of screen resolution

2022-01-16 Thread Michael Kelley
creen resolution from Hyper-V host") Signed-off-by: Michael Kelley --- drivers/video/fbdev/hyperv_fb.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index 23999df..c8e0ea2 100644 --- a/dri

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

2021-04-21 Thread Michael Kelley
From: Joe Perches Sent: Tuesday, April 20, 2021 12:59 PM > > On Tue, 2021-04-20 at 08:44 -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 > &g

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

2021-04-20 Thread Michael Kelley
. Break the cycle by rate limiting the error message. Also output the error code for additional diagnosability. Signed-off-by: Michael Kelley --- drivers/video/fbdev/hyperv_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video

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

2021-03-24 Thread Michael Kelley
;apertures) calls in hvfb_getmem(). This will allow framebuffer_release() to free the memory, which follows the pattern of other fbdev drivers. Modulo this revision to the commit message, which Wei Liu can probably incorporate, Reviewed-by: Michael Kelley > > Signed-off-by: Lv Yunlong > ---

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

2021-03-23 Thread Michael Kelley
From: Lv Yunlong Sent: Tuesday, March 23, 2021 12:34 AM > > In function hvfb_probe in hyperv_fb.c, it calls hvfb_getmem(hdev, info) > and return err when info->apertures is freed. > > In the error1 label of hvfb_probe, info->apertures will be freed twice > by framebuffer_release(info). > > My

RE: [PATCH] video: hyperv_fb: Fix the cache type when mapping the VRAM

2020-11-18 Thread Michael Kelley
also required for > + * VM Connect to display properly for ARM64 Linux VM, as the host also > + * maps the VRAM cacheable. > + */ > + fb_virt = ioremap_cache(par->mem->start, screen_fb_size); > if (!fb_virt) > goto err2; > > -- > 2.19.1 Reviewed-by: Michael Kelley ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

RE: [PATCH 20/28] mm: remove the pgprot argument to __vmalloc

2020-04-11 Thread Michael Kelley
| 2 +- > mm/percpu.c| 2 +- > mm/vmalloc.c | 4 ++-- > net/bridge/netfilter/ebtables.c| 6 ++ > sound/core/memalloc.c | 2 +- > sound/core/pcm_memory.c | 2 +- >

RE: [PATCH 01/28] x86/hyperv: use vmalloc_exec for the hypercall page

2020-04-11 Thread Michael Kelley
- > arch/x86/include/asm/pgtable_types.h | 2 -- > 2 files changed, 1 insertion(+), 3 deletions(-) > Reviewed-by: Michael Kelley ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

RE: [PATCH v4] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.

2019-12-10 Thread Michael Kelley
Hu > --- > v2: Incorporated review comments form h...@lst.de, Michael Kelley and > Dexuan Cui > - Use dma_alloc_coherent to allocate large contiguous memory > - Use phys_addr_t for physical addresses > - Corrected a few spelling errors and minor cleanups

RE: [PATCH v3] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.

2019-12-09 Thread Michael Kelley
From: Wei Hu Sent: Friday, December 6, 2019 3:32 AM > > On Hyper-V, Generation 1 VMs can directly use VM's physical memory for > their framebuffers. This can improve the efficiency of framebuffer and > overall performence for VM. The physical memory assigned to framebuffer > must be contiguous.

RE: [PATCH][next] video: hyperv: hyperv_fb: fix indentation issue

2019-12-09 Thread Michael Kelley
goto out; > + ret = -ETIMEDOUT; > + goto out; > } > > if (msg->resolution_resp.resolution_count == 0) { > -- > 2.20.1 Reviewed-by: Michael Kelley ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

RE: [PATCH v2] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.

2019-11-28 Thread Michael Kelley
to CMA allocator at boot time. For > example: > cma=130m > This gives 130MB memory to CAM allocator that can be allocated to > framebuffer. If this fails, we fall back to the old way of using > mmio for framebuffer. > > Signed-off-by: Wei Hu > --- > v2: Inco

RE: [PATCH] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.

2019-11-03 Thread Michael Kelley
From: Wei Hu Sent: Tuesday, October 22, 2019 4:11 AM > > On Hyper-V, Generation 1 VMs can directly use VM's physical memory for > their framebuffers. This can improve the efficiency of framebuffer and > overall performence for VM. The physical memory assigned to framebuffer > must be contiguous.

RE: [PATHC v6] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-09-20 Thread Michael Kelley
From: Michael Kelley Sent: Wednesday, September 18, 2019 2:48 PM > > > > Without deferred IO support, hyperv_fb driver informs the host to refresh > > the entire guest frame buffer at fixed rate, e.g. at 20Hz, no matter there > > is screen update or not. This pa

RE: [PATHC v6] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-09-18 Thread Michael Kelley
when doing the on-demand refresh. This can be optimized in the > future with help from host. For now the host performance gain from deferred > IO outweighs the shadow copy impact in the guest. > > Signed-off-by: Wei Hu > --- > v2: Incorporated review comments from Michael Kelley

RE: [PATCH v5] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-09-13 Thread Michael Kelley
when doing the on-demand refresh. This can be optimized in the > future with help from host. For now the host performance gain from deferred > IO outweighs the shadow copy impact in the guest. > > Signed-off-by: Wei Hu > --- > v2: Incorporated review comments from Michael Kelley

RE: [PATCH v3] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-09-05 Thread Michael Kelley
when doing the on-demand refresh. This can be optimized in the > future with help from host. For now the host performance gain from deferred > IO outweighs the shadow copy impact in the guest. > > Signed-off-by: Wei Hu > --- > v2: Incorporated review comments from Michael Kelley

RE: [PATCH v4] video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host

2019-09-05 Thread Michael Kelley
array. > > v3: > - Corrected the synthvid major and minor version comparison problem. > > v4: > - Changed function name to synthvid_ver_ge(). > > drivers/video/fbdev/hyperv_fb.c | 159 +--- > 1 file changed, 147 insertions(+), 12 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATHC v2] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-08-27 Thread Michael Kelley
when doing the on-demand refresh. This can be optimized in the > future with help from host. For now the host performance gain from deferred > IO outweighs the shadow copy impact in the guest. > > v2: Incorporated review comments from Michael Kelley > - Increased dirty rectangle

RE: [PATCH v3] video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host

2019-08-27 Thread Michael Kelley
From: Wei Hu Sent: Tuesday, August 27, 2019 4:09 AM > > Beginning from Windows 10 RS5+, VM screen resolution is obtained from host. > The "video=hyperv_fb" boot time option is not needed, but still can be > used to overwrite what the host specifies. The VM resolution on the host > could be set

RE: [PATCH] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-08-24 Thread Michael Kelley
From: Wei Hu Sent: Wednesday, August 21, 2019 4:59 AM > > > From: Michael Kelley > > Sent: Monday, August 19, 2019 6:41 AM > > To: Wei Hu ; rdun...@infradead.org; shc_w...@mail.ru; > > > > - msg.dirt.rect[0].x1 = 0; > > > - msg.dirt.rect[0].y1 = 0; &g

RE: [PATCH v2] video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host

2019-08-22 Thread Michael Kelley
he host > could be set by executing the powershell "set-vmvideo" command. > > v2: > - Implemented fallback when version negotiation failed. > - Defined full size for supported_resolution array. > > Signed-off-by: Iouri Tarassov > Signed-off-by: Wei Hu &

RE: [PATCH] video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host

2019-08-19 Thread Michael Kelley
From: Wei Hu Sent: Tuesday, August 13, 2019 2:55 AM > > Beginning from Windows 10 RS5+, VM screen resolution is obtained from host. > The "video=hyperv_fb" boot time option is not needed, but still can be > used to overwrite the VM resolution. The VM resolution on the host could be I would word

RE: [PATCH] video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver

2019-08-18 Thread Michael Kelley
From: Wei Hu Sent: Tuesday, August 13, 2019 3:37 AM > > Without deferred IO support, hyperv_fb driver informs the host to refresh > the entire guest frame buffer at fixed rate, e.g. at 20Hz, no matter there > is screen update or not. This patch supports defered IO for screens in