[PATCH v3 3/4] fbdev/deferred-io: Support contiguous kernel memory framebuffers

2025-05-23 Thread mhkelley58
From: Michael Kelley Current defio code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, including freeing the page if the refcount goes to 0. This ap

[PATCH v3 4/4] fbdev: hyperv_fb: Fix mmap of framebuffers allocated using alloc_pages()

2025-05-23 Thread mhkelley58
From: Michael Kelley Framebuffer memory allocated using alloc_pages() was added to hyperv_fb in commit 3a6fb6c4255c ("video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.") in kernel version 5.6. But mmap'ing such framebuffers into user space has never worked due to limitatio

[PATCH v3 2/4] fbdev: Add flag indicating framebuffer is allocated from kernel memory

2025-05-23 Thread mhkelley58
From: Michael Kelley Add a flag that fbdev drivers can set to indicate that the framebuffer memory comes from alloc_pages() or similar as opposed to vmalloc() memory. The flag is to be used by fbdev deferred I/O. Signed-off-by: Michael Kelley --- Changes in v3: * This patch is new in v3. The de

[PATCH v3 0/4] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers

2025-05-23 Thread mhkelley58
From: Michael Kelley Current deferred I/O code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, which is consistent with vmalloc'ed memory, but not wi

[PATCH v3 1/4] mm: Export vmf_insert_mixed_mkwrite()

2025-05-23 Thread mhkelley58
From: Michael Kelley Export vmf_insert_mixed_mkwrite() for use by fbdev deferred I/O code, which can be built as a module. Commit cd1e0dac3a3e ("mm: unexport vmf_insert_mixed_mkwrite") is effectively reverted. Signed-off-by: Michael Kelley --- Changes in v2: * Exported as GPL symbol [Christoph

[PATCH v2 1/3] mm: Export vmf_insert_mixed_mkwrite()

2025-05-01 Thread mhkelley58
From: Michael Kelley Export vmf_insert_mixed_mkwrite() for use by fbdev deferred I/O code, which can be built as a module. Commit cd1e0dac3a3e ("mm: unexport vmf_insert_mixed_mkwrite") is effectively reverted. Signed-off-by: Michael Kelley --- Changes in v2: * Exported as GPL symbol [Christoph

[PATCH v2 3/3] fbdev: hyperv_fb: Fix mmap of framebuffers allocated using alloc_pages()

2025-05-01 Thread mhkelley58
From: Michael Kelley Framebuffer memory allocated using alloc_pages() was added to hyperv_fb in commit 3a6fb6c4255c ("video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.") in kernel version 5.6. But mmap'ing such framebuffers into user space has never worked due to limitatio

[PATCH v2 0/3] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers

2025-05-01 Thread mhkelley58
From: Michael Kelley Current deferred I/O code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, which is consistent with vmalloc'ed memory, but not wi

[PATCH v2 2/3] fbdev/deferred-io: Support contiguous kernel memory framebuffers

2025-05-01 Thread mhkelley58
From: Michael Kelley Current defio code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, including freeing the page if the refcount goes to 0. This ap

[PATCH 3/3] fbdev: hyperv_fb: Fix mmap of framebuffers allocated using alloc_pages()

2025-04-08 Thread mhkelley58
From: Michael Kelley Framebuffer memory allocated using alloc_pages() was added to hyperv_fb in commit 3a6fb6c4255c ("video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.") in kernel version 5.6. But mmap'ing such framebuffers into user space has never worked due to limitatio

[PATCH 2/3] fbdev/deferred-io: Support contiguous kernel memory framebuffers

2025-04-08 Thread mhkelley58
From: Michael Kelley Current defio code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, including freeing the page if the refcount goes to 0. This ap

[PATCH 1/3] mm: Export vmf_insert_mixed_mkwrite()

2025-04-08 Thread mhkelley58
From: Michael Kelley Export vmf_insert_mixed_mkwrite() for use by fbdev deferred I/O code, which can be built as a module. For consistency with the related function vmf_insert_mixed(), export without the GPL qualifier. Commit cd1e0dac3a3e ("mm: unexport vmf_insert_mixed_mkwrite") is effectively

[PATCH 0/3] fbdev: Add deferred I/O support for contiguous kernel memory framebuffers

2025-04-08 Thread mhkelley58
From: Michael Kelley Current deferred I/O code works only for framebuffer memory that is allocated with vmalloc(). The code assumes that the underlying page refcount can be used by the mm subsystem to manage each framebuffer page's lifecycle, which is consistent with vmalloc'ed memory, but not wi

[PATCH 1/1] fbdev: hyperv_fb: Fix hang in kdump kernel when on Hyper-V Gen 2 VMs

2025-02-18 Thread mhkelley58
From: Michael Kelley Gen 2 Hyper-V VMs boot via EFI and have a standard EFI framebuffer device. When the kdump kernel runs in such a VM, loading the efifb driver may hang because of accessing the framebuffer at the wrong memory address. The scenario occurs when the hyperv_fb driver in the origin

[PATCH 1/1] drm/hyperv: Fix address space leak when Hyper-V DRM device is removed

2025-02-10 Thread mhkelley58
From: Michael Kelley When a Hyper-V DRM device is probed, the driver allocates MMIO space for the vram, and maps it cacheable. If the device removed, or in the error path for device probing, the MMIO space is released but no unmap is done. Consequently the kernel address space for the mapping is

[PATCH 1/1] fbdev: hyperv_fb: iounmap() the correct memory when removing a device

2025-02-09 Thread mhkelley58
From: Michael Kelley When a Hyper-V framebuffer device is removed, or the driver is unbound from a device, any allocated and/or mapped memory must be released. In particular, MMIO address space that was mapped to the framebuffer must be unmapped. Current code unmaps the wrong address, resulting i

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

2024-01-31 Thread mhkelley58
From: Michael Kelley A recent commit removing the use of screen_info introduced a logic error. The error causes hvfb_getmem() to always return -ENOMEM for Generation 2 VMs. As a result, the Hyper-V frame buffer device fails to initialize. The error was introduced by removing an "else if" clause,