Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 3/5] vgacon: Use vt_cursor_{start,end}()
Date: Mon, 28 Sep 2026 09:09:49 +0000	[thread overview]
Message-ID: <20260928090949.A7BC31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928085724.41660-4-tzimmermann@suse.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] vgacon: CUR_DEF bypasses pre-VGA hardware cursor hiding workaround
--

commit d1a44aa19f5cbfffe54990d3cf6f73ab9b42b5ed
Author: Thomas Zimmermann <tzimmermann@suse.de>

vgacon: Use vt_cursor_{start,end}()
    
Replace vgacon's custom cursor metrics with the shared helpers
vc_cursor_start() and vc_font_cursor_end(). Note that the _end()
function returns the index of the scanline below the cursor, while
VGA hardware expects the cursor's final scanline. Hence vgacon
subtracts 1 from the end value.
    
The cursor shapes remain mostly unchanged, except that non-underline
cursors now also use the glyph's top-most and bottom-most scanline.
This follows the style used by fbcon.
    
v2:
- restore use of vc_cell_height (Sashiko)
    
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Helge Deller <deller@gmx.de>

> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
> index 536e7fe4d1426..b1408bb5e2656 100644
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
[ ... ]
> @@ -513,10 +514,11 @@ static void vgacon_cursor(struct vc_data *c, bool enable)
>  	vgacon_restore_screen(c);
>  
>  	c_height = c->vc_cell_height;
> +	c_size = CUR_SIZE(c->vc_cursor_type);
>  
>  	write_vga(14, (c->vc_pos - vga_vram_base) / 2);
>  
> -	if (!enable) {
> +	if (!enable || c_size == CUR_NONE) {

[Severity: Medium]
Does this check fail to intercept CUR_DEF if the default cursor is
configured as CUR_NONE?

If cur_default is set to CUR_NONE and an unprivileged user triggers a cursor
reset (\e[?0c), c_size will equal CUR_DEF. Since CUR_DEF does not equal
CUR_NONE, this bypasses the hardware-specific hide sequence below.

>  	        if (vga_video_type >= VIDEO_TYPE_VGAC)
>  			vgacon_set_cursor_size(31, 30);
>  		else
> @@ -524,33 +526,8 @@ static void vgacon_cursor(struct vc_data *c, bool enable)
>  		return;
>  	}
>  
[ ... ]
> -	default:
> -		vgacon_set_cursor_size(1, c_height);
> -		break;
> -	}
> +	vgacon_set_cursor_size(vc_cursor_start(c_height, c_size),
> +			       vc_cursor_end(c_height, c_size) - 1);

[Severity: Medium]
If c_size is CUR_DEF and the default cursor is CUR_NONE, could this
cause cursor wrapping on EGA/MDA hardware?

When vc_cursor_start() and vc_cursor_end() resolve the CUR_DEF to CUR_NONE
internally, they both return c_height. This results in
vgacon_set_cursor_size() being called with start = c_height and
end = c_height - 1.

Pre-VGA hardware (EGA/MDA/CGA 6845 CRTCs) do not support start > end for
hiding cursors, which leads to a massive wrapping block cursor instead of
hiding it.

>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928085724.41660-1-tzimmermann@suse.de?part=3

  reply	other threads:[~2026-09-28  9:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  8:55 [PATCH v3 0/5] fbcon,vgacon,vt: Share helpers for text cursors Thomas Zimmermann
2026-09-28  8:55 ` [PATCH v3 1/5] vt: Add cursor-size helpers Thomas Zimmermann
2026-09-28  9:07   ` Jani Nikula
2026-09-28 11:45     ` Thomas Zimmermann
2026-09-28  9:09   ` sashiko-bot
2026-09-28 11:14     ` Thomas Zimmermann
2026-09-28 11:41       ` Greg KH
2026-10-01  8:59   ` Greg KH
2026-09-28  8:55 ` [PATCH v3 2/5] vgacon: Remove trailing whitespaces Thomas Zimmermann
2026-09-28  8:59   ` sashiko-bot
2026-09-28  8:55 ` [PATCH v3 3/5] vgacon: Use vt_cursor_{start,end}() Thomas Zimmermann
2026-09-28  9:09   ` sashiko-bot [this message]
2026-09-28  8:55 ` [PATCH v3 4/5] lib/fonts: Add font_glyph_cursor() helper Thomas Zimmermann
2026-09-28  9:16   ` sashiko-bot
2026-09-28  8:55 ` [PATCH v3 5/5] fbcon: Replace fbcon_fill_cursor_mask() with fbcon_cursor_glyph() Thomas Zimmermann
2026-09-28  9:21   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260928090949.A7BC31F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox