Re: [PATCH v2 2/4] vdpa: pass initial config to _vdpa_register_device()

2022-10-20 Thread Jason Wang
On Fri, Oct 21, 2022 at 2:45 AM Si-Wei Liu wrote: > > > > On 10/19/2022 10:20 PM, Jason Wang wrote: > > On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: > >> Just as _vdpa_register_device taking @nvqs as the number of queues > > I wonder if it's better to embed nvqs in the config structure. >

Re: [Bug] double ->queue_rq() because of timeout in ->queue_rq()

2022-10-20 Thread Ming Lei
On Thu, Oct 20, 2022 at 04:01:11PM -0400, Stefan Hajnoczi wrote: > On Thu, Oct 20, 2022 at 05:10:13PM +0800, Ming Lei wrote: > > Hi, > > > > David Jeffery found one double ->queue_rq() issue, so far it can > > be triggered in the following two cases: > > > > 1) scsi driver in guest kernel > > >

Re: [Bug] double ->queue_rq() because of timeout in ->queue_rq()

2022-10-20 Thread Ming Lei
On Thu, Oct 20, 2022 at 01:26:48PM -0700, Bart Van Assche wrote: > On 10/20/22 02:10, Ming Lei wrote: > > [ ... ] > > Hi Ming, > > Fixing this in the block layer seems fine to me. A few comments: > > > + /* Before walking tags, we must ensure any submit started before the > > +* current

RE: [PATCH v2 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-20 Thread Parav Pandit via Virtualization
> From: Si-Wei Liu > Sent: Thursday, October 20, 2022 2:12 PM > > > On 10/19/2022 10:25 PM, Jason Wang wrote: > > On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu > wrote: > >> Live migration of vdpa would typically require re-instate vdpa device > >> with an idential set of configs on the

Re: [Bug] double ->queue_rq() because of timeout in ->queue_rq()

2022-10-20 Thread Bart Van Assche
On 10/20/22 02:10, Ming Lei wrote: > [ ... ] Hi Ming, Fixing this in the block layer seems fine to me. A few comments: + /* Before walking tags, we must ensure any submit started before the +* current time has finished. Since the submit uses srcu or rcu, wait +* for a

Re: [Bug] double ->queue_rq() because of timeout in ->queue_rq()

2022-10-20 Thread Stefan Hajnoczi
On Thu, Oct 20, 2022 at 05:10:13PM +0800, Ming Lei wrote: > Hi, > > David Jeffery found one double ->queue_rq() issue, so far it can > be triggered in the following two cases: > > 1) scsi driver in guest kernel > > - the story could be long vmexit latency or long preempt latency of > vCPU

Re: [PATCH v2 2/4] vdpa: pass initial config to _vdpa_register_device()

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 10:20 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Just as _vdpa_register_device taking @nvqs as the number of queues I wonder if it's better to embed nvqs in the config structure. Hmmm, the config structure is mostly for containing the

Re: [PATCH v2 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 10:25 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Live migration of vdpa would typically require re-instate vdpa device with an idential set of configs on the destination node, same way as how source node created the device in the first place. In

Re: [PATCH v2 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 9:38 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: In order to allow live migration orchestration software to export the initial set of vdpa attributes with which the device was created, it will be useful if the vdpa tool can report the config on

Re: [PATCH 01/21] drm/amdgpu: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Hi Am 20.10.22 um 13:48 schrieb Christian König: Am 20.10.22 um 12:37 schrieb Thomas Zimmermann: Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the

Re: [PATCH 01/21] drm/amdgpu: Don't set struct drm_driver.lastclose

2022-10-20 Thread Christian König via Virtualization
Am 20.10.22 um 12:37 schrieb Thomas Zimmermann: Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose().

[PATCH 16/21] drm/fb-helper: Call fb_sync in I/O functions

2022-10-20 Thread Thomas Zimmermann
Call struct fb_ops.fb_sync in drm_fbdev_{read,write}() to mimic the behavior of fbdev. Fbdev implementations of fb_read and fb_write in struct fb_ops invoke fb_sync to synchronize with outstanding operations before I/O. Doing the same in DRM implementations will allow us to use them throughout DRM

[PATCH 11/21] drm/fb-helper: Cleanup include statements in header file

2022-10-20 Thread Thomas Zimmermann
Only include what we have to. Signed-off-by: Thomas Zimmermann --- include/drm/drm_fb_helper.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index fddd0d1af6891..e923089522896 100644 ---

[PATCH 17/21] drm/fb-helper: Perform all fbdev I/O with the same implementation

2022-10-20 Thread Thomas Zimmermann
Implement the fbdev's read/write helpers with the same functions. Use the generic fbdev's code as template. Convert all drivers. DRM's fb helpers must implement regular I/O functionality in struct fb_ops and possibly perform a damage update. Handle all this in the same functions and convert

[PATCH 18/21] drm/fb_helper: Minimize damage-helper overhead

2022-10-20 Thread Thomas Zimmermann
Pull the test for fb_dirty into the caller to avoid extra work if no callback has been set. In this case no damage handling is required and no damage area needs to be computed. Print a warning if the damage worker runs without getting an fb_dirty callback. Signed-off-by: Thomas Zimmermann ---

[PATCH 10/21] drm/tve200: Include

2022-10-20 Thread Thomas Zimmermann
Include for of_match_ptr(). Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tve200/tve200_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c index 04db72e3fa9c2..611785e097576 100644 ---

[PATCH 07/21] drm/rockchip: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as rockchip uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 20/21] drm/fb-helper: Move generic fbdev emulation into separate source file

2022-10-20 Thread Thomas Zimmermann
Move the generic fbdev implementation into its own source and header file. Adapt drivers. No functonal changes, but some of the internal helpers have been renamed to fit into the drm_fbdev_ naming scheme. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Makefile | 2

[PATCH 21/21] drm/fb-helper: Remove unnecessary include statements

2022-10-20 Thread Thomas Zimmermann
Remove include statements for where it is not required (i.e., most of them). In a few places include other header files that are required by the source code. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

[PATCH 15/21] drm/fb-helper: Disconnect damage worker from update logic

2022-10-20 Thread Thomas Zimmermann
The fbdev helpers implement a damage worker that forwards fbdev updates to the DRM driver. The worker's update logic depends on the generic fbdev emulation. Separate the two via function pointer. The generic fbdev emulation sets struct drm_fb_helper_funcs.fb_dirty, a new callback that hides the

[PATCH 19/21] drm/fb-helper: Always initialize generic fbdev emulation

2022-10-20 Thread Thomas Zimmermann
Initialize the generic fbdev emulation even if it has been disabled on the kernel command line. The hotplug and mode initialization will fail accordingly. The kernel parameter can still be changed at runtime and the emulation will initialize after hotplugging the connector. Signed-off-by: Thomas

[PATCH 14/21] drm/fb-helper: Rename drm_fb_helper_unregister_fbi() to use _info postfix

2022-10-20 Thread Thomas Zimmermann
Rename drm_fb_helper_unregister_fbi() to drm_fb_helper_unregister_info() as part of unifying the naming within fbdev helpers. Adapt drivers. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_helper.c

[PATCH 13/21] drm/fb-helper: Rename drm_fb_helper_alloc_fbi() to use _info postfix

2022-10-20 Thread Thomas Zimmermann
Rename drm_fb_helper_alloc_fbi() to drm_fb_helper_alloc_info() as part of unifying the naming within fbdev helpers. Adapt drivers. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_fbdev.c | 2 +- drivers/gpu/drm/drm_fb_helper.c| 8

[PATCH 04/21] drm/komeda: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as komeda uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 12/21] drm/fb_helper: Rename field fbdev to info in struct drm_fb_helper

2022-10-20 Thread Thomas Zimmermann
Rename struct drm_fb_helper.fbdev to info. The current name is misleading as it overlaps with generic fbdev naming conventions. Adapt to the usual naming in fbdev drivers by calling the field 'info'. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c

[PATCH 09/21] drm/panel-ili9341: Include

2022-10-20 Thread Thomas Zimmermann
Include for devm_of_find_backlight(). Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c index

[PATCH 06/21] drm/mcde: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as mcde uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 02/21] drm/imx: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as imx uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 05/21] drm/logicvc: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as logicvc uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 08/21] drm/vboxvideo: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as vboxvideo uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH 00/21] drm/fb-helper: Untangle fbdev emulation and helpers

2022-10-20 Thread Thomas Zimmermann
Separate generic fbdev emulation from the helper code that is shared among the various fbdev implementations within DRM. Affects many drivers. The goal of this patchset is to improve readability and streamline the fbdev helper code within DRM. In the long term, we want to get to a point where

[PATCH 03/21] drm/ingenic: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_mode_config.output_poll_changed. It's used to inform the fbdev console about conncetor changes. But as ingenic uses generic fbdev emulation, the console is being informed by the DRM client helpers already. See the calls to drm_client_dev_hotplug() in drm_probe_helper.c.

[PATCH 01/21] drm/amdgpu: Don't set struct drm_driver.lastclose

2022-10-20 Thread Thomas Zimmermann
Don't set struct drm_driver.lastclose. It's used to restore the fbdev console. But as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose(). Signed-off-by: Thomas Zimmermann ---

[PATCH] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-10-20 Thread Juergen Gross via Virtualization
There are some paravirt assembler functions which are sharing a common pattern. Introduce a macro DEFINE_PARAVIRT_ASM() for creating them. The explicit _paravirt_nop() prototype in paravirt.c isn't needed, as it is included in paravirt_types.h already. Signed-off-by: Juergen Gross ---

[Bug] double ->queue_rq() because of timeout in ->queue_rq()

2022-10-20 Thread Ming Lei
Hi, David Jeffery found one double ->queue_rq() issue, so far it can be triggered in the following two cases: 1) scsi driver in guest kernel - the story could be long vmexit latency or long preempt latency of vCPU pthread, then IO req is timed out before queuing the request to hardware but