diff mbox series

[4.19,66/78] fbcon: remove soft scrollback code

Message ID 20200915140636.861676717@linuxfoundation.org
State New
Headers show
Series None | expand

Commit Message

Greg Kroah-Hartman Sept. 15, 2020, 2:13 p.m. UTC
From: Linus Torvalds <torvalds@linux-foundation.org>

commit 50145474f6ef4a9c19205b173da6264a644c7489 upstream.

This (and the VGA soft scrollback) turns out to have various nasty small
special cases that nobody really is willing to fight.  The soft
scrollback code was really useful a few decades ago when you typically
used the console interactively as the main way to interact with the
machine, but that just isn't the case any more.

So it's not worth dragging along.

Tested-by: Yuan Ming <yuanmingbuaa@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/video/fbdev/core/fbcon.c |  334 ---------------------------------------
 1 file changed, 4 insertions(+), 330 deletions(-)

Comments

Pavel Machek Sept. 16, 2020, 7:57 a.m. UTC | #1
Hi!

> From: Linus Torvalds <torvalds@linux-foundation.org>

> 

> commit 50145474f6ef4a9c19205b173da6264a644c7489 upstream.

> 

> This (and the VGA soft scrollback) turns out to have various nasty small

> special cases that nobody really is willing to fight.  The soft

> scrollback code was really useful a few decades ago when you typically

> used the console interactively as the main way to interact with the

> machine, but that just isn't the case any more.

> 

> So it's not worth dragging along.


It is still useful.

In particular, kernel is now very verbose, so important messages
during bootup scroll away. It is way bigger deal when you can no
longer get to them using shift-pageup.

fsck is rather verbose, too, and there's no easy way to run that under
X terminal... and yes, that makes scrollback very useful, too.

So, I believe we'll need to fix this. I guess I could do it. I also
guess I'll not have to, because SuSE or RedHat will want to fix it.

Anyway, this really should not be merged into stable.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Greg Kroah-Hartman Sept. 16, 2020, 8:25 a.m. UTC | #2
On Wed, Sep 16, 2020 at 09:57:59AM +0200, Pavel Machek wrote:
> Hi!

> 

> > From: Linus Torvalds <torvalds@linux-foundation.org>

> > 

> > commit 50145474f6ef4a9c19205b173da6264a644c7489 upstream.

> > 

> > This (and the VGA soft scrollback) turns out to have various nasty small

> > special cases that nobody really is willing to fight.  The soft

> > scrollback code was really useful a few decades ago when you typically

> > used the console interactively as the main way to interact with the

> > machine, but that just isn't the case any more.

> > 

> > So it's not worth dragging along.

> 

> It is still useful.

> 

> In particular, kernel is now very verbose, so important messages

> during bootup scroll away. It is way bigger deal when you can no

> longer get to them using shift-pageup.

> 

> fsck is rather verbose, too, and there's no easy way to run that under

> X terminal... and yes, that makes scrollback very useful, too.

> 

> So, I believe we'll need to fix this. I guess I could do it. I also

> guess I'll not have to, because SuSE or RedHat will want to fix it.

> 

> Anyway, this really should not be merged into stable.


It's merged into the stable trees that _I_ have to maintain.  If you
want to revert it for trees you maintain and wish to keep secure, that's
up to you.  But it's something that I _STRONGLY_ do not advise doing.

See the email recently on oss-devel for one such reason why this was
removed...

good luck!

greg k-h
Pavel Machek Sept. 16, 2020, 9:07 a.m. UTC | #3
Hi!

> > > From: Linus Torvalds <torvalds@linux-foundation.org>

> > > 

> > > commit 50145474f6ef4a9c19205b173da6264a644c7489 upstream.

> > > 

> > > This (and the VGA soft scrollback) turns out to have various nasty small

> > > special cases that nobody really is willing to fight.  The soft

> > > scrollback code was really useful a few decades ago when you typically

> > > used the console interactively as the main way to interact with the

> > > machine, but that just isn't the case any more.

> > > 

> > > So it's not worth dragging along.

> > 

> > It is still useful.

> > 

> > In particular, kernel is now very verbose, so important messages

> > during bootup scroll away. It is way bigger deal when you can no

> > longer get to them using shift-pageup.

> > 

> > fsck is rather verbose, too, and there's no easy way to run that under

> > X terminal... and yes, that makes scrollback very useful, too.

> > 

> > So, I believe we'll need to fix this. I guess I could do it. I also

> > guess I'll not have to, because SuSE or RedHat will want to fix it.

> > 

> > Anyway, this really should not be merged into stable.

> 

> It's merged into the stable trees that _I_ have to maintain.  If you

> want to revert it for trees you maintain and wish to keep secure, that's

> up to you.  But it's something that I _STRONGLY_ do not advise doing.


I believe it will need to be reverted in Linus' tree, too. In fact,
the patch seems to be a way for Linus to find a maintainer for the
code, and I already stated I can do it. Patch is so new it was not
even in -rc released by Linus.

> See the email recently on oss-devel for one such reason why this was

> removed...


Would you have a link for that?
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Willy Tarreau Sept. 16, 2020, 9:14 a.m. UTC | #4
Hi Pavel,

On Wed, Sep 16, 2020 at 11:07:23AM +0200, Pavel Machek wrote:
> I believe it will need to be reverted in Linus' tree, too. In fact,

> the patch seems to be a way for Linus to find a maintainer for the

> code, and I already stated I can do it. Patch is so new it was not

> even in -rc released by Linus.


I can honestly see how it can be missed from fbcon, but using vgacon
myself for cases like you described, I still benefit from the hw scroll
buffer which is OK.

> > See the email recently on oss-devel for one such reason why this was

> > removed...

> 

> Would you have a link for that?


Here it is:

  https://www.openwall.com/lists/oss-security/2020/09/15/2

Willy
Pavel Machek Sept. 23, 2020, 8:44 a.m. UTC | #5
Hi!

> > I believe it will need to be reverted in Linus' tree, too. In fact,

> > the patch seems to be a way for Linus to find a maintainer for the

> > code, and I already stated I can do it. Patch is so new it was not

> > even in -rc released by Linus.

> 

> I can honestly see how it can be missed from fbcon, but using vgacon

> myself for cases like you described, I still benefit from the hw scroll

> buffer which is OK.

> 

> > > See the email recently on oss-devel for one such reason why this was

> > > removed...

> > 

> > Would you have a link for that?

> 

> Here it is:

> 

>   https://www.openwall.com/lists/oss-security/2020/09/15/2


Thank you for the pointer!

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Linus Torvalds Sept. 23, 2020, 6:19 p.m. UTC | #6
On Wed, Sep 23, 2020 at 1:44 AM Pavel Machek <pavel@denx.de> wrote:
>

> >

> >   https://www.openwall.com/lists/oss-security/2020/09/15/2

>

> Thank you for the pointer!


Note that for me to be willing to take the softscollback code back, it
really would have to be more than just a revert and a trivial fix.

It would have to be more along the lines of "this is simplified and
verified". For example, at a minimum all the VT_RESIZE etc stuff would
have to clearly and obviously reset the soft-scrollback, so that we
simply can't have those kinds of issues.

If you look at that commit 50145474f6ef ("fbcon: remove soft
scrollback code") that removes the code, most of that code really
doesn't make much sense.

I dare anybody looking at that removed fbcon_redraw_softback()
function (or the different cases in fbcon_scrolldelta(), for that
matter) to claim they understand what it is doing. It's very odd code,
and it handles a lot of odd special cases.

So I wouldn't mind re-introducing the scrollback code, but the
reintroduced version needs to be simple and fairly _obvious_.  It
would need to not have all those odd special cases, and it would need
to clearly not have any subtle issues with things like font or screen
resizing.

I'd also suggest that it not even try to handle the multiple virtual
console case.

And yes, some of it may involve also clarifying the code in the VT
code itself, so that the interactions with the cursor and VT switching
is more obvious. Maybe instead of trying to deal with a SW cursor when
scrollback is active, just hide the cursor entirely before doing
scrollback. And make change_console (and all the resizing) explicitly
reset scrollback etc.

So the reason the code got removed was that it was just very grotty
and hasn't really been maintained for over a decade.

In order to resurrect it we'd not just have to have a maintainer, the
whole "it's grotty and incomprehensible and has these nasty
interactions with random other things" would need to be addressed too.

              Linus
Daniel Vetter Sept. 23, 2020, 6:57 p.m. UTC | #7
On Wed, Sep 23, 2020 at 8:19 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>

> On Wed, Sep 23, 2020 at 1:44 AM Pavel Machek <pavel@denx.de> wrote:

> >

> > >

> > >   https://www.openwall.com/lists/oss-security/2020/09/15/2

> >

> > Thank you for the pointer!

>

> Note that for me to be willing to take the softscollback code back, it

> really would have to be more than just a revert and a trivial fix.

>

> It would have to be more along the lines of "this is simplified and

> verified". For example, at a minimum all the VT_RESIZE etc stuff would

> have to clearly and obviously reset the soft-scrollback, so that we

> simply can't have those kinds of issues.

>

> If you look at that commit 50145474f6ef ("fbcon: remove soft

> scrollback code") that removes the code, most of that code really

> doesn't make much sense.

>

> I dare anybody looking at that removed fbcon_redraw_softback()

> function (or the different cases in fbcon_scrolldelta(), for that

> matter) to claim they understand what it is doing. It's very odd code,

> and it handles a lot of odd special cases.

>

> So I wouldn't mind re-introducing the scrollback code, but the

> reintroduced version needs to be simple and fairly _obvious_.  It

> would need to not have all those odd special cases, and it would need

> to clearly not have any subtle issues with things like font or screen

> resizing.

>

> I'd also suggest that it not even try to handle the multiple virtual

> console case.

>

> And yes, some of it may involve also clarifying the code in the VT

> code itself, so that the interactions with the cursor and VT switching

> is more obvious. Maybe instead of trying to deal with a SW cursor when

> scrollback is active, just hide the cursor entirely before doing

> scrollback. And make change_console (and all the resizing) explicitly

> reset scrollback etc.

>

> So the reason the code got removed was that it was just very grotty

> and hasn't really been maintained for over a decade.

>

> In order to resurrect it we'd not just have to have a maintainer, the

> whole "it's grotty and incomprehensible and has these nasty

> interactions with random other things" would need to be addressed too.


fbcon has the additional issue that the locking is completely busted,
because fbcon is both accessed through vt, protected by console_lock,
and through the fbdev chardev, protected by the fb_info lock. Ofc both
sides call into the other side, so atm a few operations are just not
protected by locks to avoid deadlock issues. I ripped out the notifier
in the middle that was angering lockdep completely, so not it's at
least fixable. But this still needs someone to sit down and come up
with something that works.

Locking is one, but in general there's all kinds of resizing fun when
you switch modes through the fbdev chardev. Not looking forward to
when syzbot figures out how to race fbcon/vt against fbdev. It's all a
rather big mess.

Oh and add in hotunplug for additional fun.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
diff mbox series

Patch

--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -102,12 +102,6 @@  static int logo_lines;
 /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO
    enums.  */
 static int logo_shown = FBCON_LOGO_CANSHOW;
-/* Software scrollback */
-static int fbcon_softback_size = 32768;
-static unsigned long softback_buf, softback_curr;
-static unsigned long softback_in;
-static unsigned long softback_top, softback_end;
-static int softback_lines;
 /* console mappings */
 static int first_fb_vc;
 static int last_fb_vc = MAX_NR_CONSOLES - 1;
@@ -148,8 +142,6 @@  static int margin_color;
 
 static const struct consw fb_con;
 
-#define CM_SOFTBACK	(8)
-
 #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row)
 
 static int fbcon_set_origin(struct vc_data *);
@@ -355,18 +347,6 @@  static int get_color(struct vc_data *vc,
 	return color;
 }
 
-static void fbcon_update_softback(struct vc_data *vc)
-{
-	int l = fbcon_softback_size / vc->vc_size_row;
-
-	if (l > 5)
-		softback_end = softback_buf + l * vc->vc_size_row;
-	else
-		/* Smaller scrollback makes no sense, and 0 would screw
-		   the operation totally */
-		softback_top = 0;
-}
-
 static void fb_flashcursor(struct work_struct *work)
 {
 	struct fb_info *info = container_of(work, struct fb_info, queue);
@@ -396,7 +376,7 @@  static void fb_flashcursor(struct work_s
 	c = scr_readw((u16 *) vc->vc_pos);
 	mode = (!ops->cursor_flash || ops->cursor_state.enable) ?
 		CM_ERASE : CM_DRAW;
-	ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
+	ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1),
 		    get_color(vc, info, c, 0));
 	console_unlock();
 }
@@ -453,13 +433,7 @@  static int __init fb_console_setup(char
 		}
 		
 		if (!strncmp(options, "scrollback:", 11)) {
-			options += 11;
-			if (*options) {
-				fbcon_softback_size = simple_strtoul(options, &options, 0);
-				if (*options == 'k' || *options == 'K') {
-					fbcon_softback_size *= 1024;
-				}
-			}
+			pr_warn("Ignoring scrollback size option\n");
 			continue;
 		}
 		
@@ -988,31 +962,6 @@  static const char *fbcon_startup(void)
 
 	set_blitting_type(vc, info);
 
-	if (info->fix.type != FB_TYPE_TEXT) {
-		if (fbcon_softback_size) {
-			if (!softback_buf) {
-				softback_buf =
-				    (unsigned long)
-				    kmalloc(fbcon_softback_size,
-					    GFP_KERNEL);
-				if (!softback_buf) {
-					fbcon_softback_size = 0;
-					softback_top = 0;
-				}
-			}
-		} else {
-			if (softback_buf) {
-				kfree((void *) softback_buf);
-				softback_buf = 0;
-				softback_top = 0;
-			}
-		}
-		if (softback_buf)
-			softback_in = softback_top = softback_curr =
-			    softback_buf;
-		softback_lines = 0;
-	}
-
 	/* Setup default font */
 	if (!p->fontdata && !vc->vc_font.data) {
 		if (!fontname[0] || !(font = find_font(fontname)))
@@ -1181,9 +1130,6 @@  static void fbcon_init(struct vc_data *v
 	if (logo)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
-	if (vc == svc && softback_buf)
-		fbcon_update_softback(vc);
-
 	if (ops->rotate_font && ops->rotate_font(info, vc)) {
 		ops->rotate = FB_ROTATE_UR;
 		set_blitting_type(vc, info);
@@ -1346,7 +1292,6 @@  static void fbcon_cursor(struct vc_data
 {
 	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
 	struct fbcon_ops *ops = info->fbcon_par;
-	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);
 
 	ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
@@ -1360,16 +1305,8 @@  static void fbcon_cursor(struct vc_data
 		fbcon_add_cursor_timer(info);
 
 	ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
-	if (mode & CM_SOFTBACK) {
-		mode &= ~CM_SOFTBACK;
-		y = softback_lines;
-	} else {
-		if (softback_lines)
-			fbcon_set_origin(vc);
-		y = 0;
-	}
 
-	ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
+	ops->cursor(vc, info, mode, 0, get_color(vc, info, c, 1),
 		    get_color(vc, info, c, 0));
 }
 
@@ -1440,8 +1377,6 @@  static void fbcon_set_disp(struct fb_inf
 
 	if (con_is_visible(vc)) {
 		update_screen(vc);
-		if (softback_buf)
-			fbcon_update_softback(vc);
 	}
 }
 
@@ -1579,99 +1514,6 @@  static __inline__ void ypan_down_redraw(
 	scrollback_current = 0;
 }
 
-static void fbcon_redraw_softback(struct vc_data *vc, struct display *p,
-				  long delta)
-{
-	int count = vc->vc_rows;
-	unsigned short *d, *s;
-	unsigned long n;
-	int line = 0;
-
-	d = (u16 *) softback_curr;
-	if (d == (u16 *) softback_in)
-		d = (u16 *) vc->vc_origin;
-	n = softback_curr + delta * vc->vc_size_row;
-	softback_lines -= delta;
-	if (delta < 0) {
-		if (softback_curr < softback_top && n < softback_buf) {
-			n += softback_end - softback_buf;
-			if (n < softback_top) {
-				softback_lines -=
-				    (softback_top - n) / vc->vc_size_row;
-				n = softback_top;
-			}
-		} else if (softback_curr >= softback_top
-			   && n < softback_top) {
-			softback_lines -=
-			    (softback_top - n) / vc->vc_size_row;
-			n = softback_top;
-		}
-	} else {
-		if (softback_curr > softback_in && n >= softback_end) {
-			n += softback_buf - softback_end;
-			if (n > softback_in) {
-				n = softback_in;
-				softback_lines = 0;
-			}
-		} else if (softback_curr <= softback_in && n > softback_in) {
-			n = softback_in;
-			softback_lines = 0;
-		}
-	}
-	if (n == softback_curr)
-		return;
-	softback_curr = n;
-	s = (u16 *) softback_curr;
-	if (s == (u16 *) softback_in)
-		s = (u16 *) vc->vc_origin;
-	while (count--) {
-		unsigned short *start;
-		unsigned short *le;
-		unsigned short c;
-		int x = 0;
-		unsigned short attr = 1;
-
-		start = s;
-		le = advance_row(s, 1);
-		do {
-			c = scr_readw(s);
-			if (attr != (c & 0xff00)) {
-				attr = c & 0xff00;
-				if (s > start) {
-					fbcon_putcs(vc, start, s - start,
-						    line, x);
-					x += s - start;
-					start = s;
-				}
-			}
-			if (c == scr_readw(d)) {
-				if (s > start) {
-					fbcon_putcs(vc, start, s - start,
-						    line, x);
-					x += s - start + 1;
-					start = s + 1;
-				} else {
-					x++;
-					start++;
-				}
-			}
-			s++;
-			d++;
-		} while (s < le);
-		if (s > start)
-			fbcon_putcs(vc, start, s - start, line, x);
-		line++;
-		if (d == (u16 *) softback_end)
-			d = (u16 *) softback_buf;
-		if (d == (u16 *) softback_in)
-			d = (u16 *) vc->vc_origin;
-		if (s == (u16 *) softback_end)
-			s = (u16 *) softback_buf;
-		if (s == (u16 *) softback_in)
-			s = (u16 *) vc->vc_origin;
-	}
-}
-
 static void fbcon_redraw_move(struct vc_data *vc, struct display *p,
 			      int line, int count, int dy)
 {
@@ -1811,31 +1653,6 @@  static void fbcon_redraw(struct vc_data
 	}
 }
 
-static inline void fbcon_softback_note(struct vc_data *vc, int t,
-				       int count)
-{
-	unsigned short *p;
-
-	if (vc->vc_num != fg_console)
-		return;
-	p = (unsigned short *) (vc->vc_origin + t * vc->vc_size_row);
-
-	while (count) {
-		scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row);
-		count--;
-		p = advance_row(p, 1);
-		softback_in += vc->vc_size_row;
-		if (softback_in == softback_end)
-			softback_in = softback_buf;
-		if (softback_in == softback_top) {
-			softback_top += vc->vc_size_row;
-			if (softback_top == softback_end)
-				softback_top = softback_buf;
-		}
-	}
-	softback_curr = softback_in;
-}
-
 static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
 		enum con_scroll dir, unsigned int count)
 {
@@ -1858,8 +1675,6 @@  static bool fbcon_scroll(struct vc_data
 	case SM_UP:
 		if (count > vc->vc_rows)	/* Maximum realistic size */
 			count = vc->vc_rows;
-		if (softback_top)
-			fbcon_softback_note(vc, t, count);
 		if (logo_shown >= 0)
 			goto redraw_up;
 		switch (p->scrollmode) {
@@ -2230,14 +2045,6 @@  static int fbcon_switch(struct vc_data *
 	info = registered_fb[con2fb_map[vc->vc_num]];
 	ops = info->fbcon_par;
 
-	if (softback_top) {
-		if (softback_lines)
-			fbcon_set_origin(vc);
-		softback_top = softback_curr = softback_in = softback_buf;
-		softback_lines = 0;
-		fbcon_update_softback(vc);
-	}
-
 	if (logo_shown >= 0) {
 		struct vc_data *conp2 = vc_cons[logo_shown].d;
 
@@ -2571,9 +2378,6 @@  static int fbcon_do_set_font(struct vc_d
 	int cnt;
 	char *old_data = NULL;
 
-	if (con_is_visible(vc) && softback_lines)
-		fbcon_set_origin(vc);
-
 	resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
 	if (p->userfont)
 		old_data = vc->vc_font.data;
@@ -2599,8 +2403,6 @@  static int fbcon_do_set_font(struct vc_d
 		cols /= w;
 		rows /= h;
 		vc_resize(vc, cols, rows);
-		if (con_is_visible(vc) && softback_buf)
-			fbcon_update_softback(vc);
 	} else if (con_is_visible(vc)
 		   && vc->vc_mode == KD_TEXT) {
 		fbcon_clear_margins(vc, 0);
@@ -2759,19 +2561,7 @@  static void fbcon_set_palette(struct vc_
 
 static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
 {
-	unsigned long p;
-	int line;
-	
-	if (vc->vc_num != fg_console || !softback_lines)
-		return (u16 *) (vc->vc_origin + offset);
-	line = offset / vc->vc_size_row;
-	if (line >= softback_lines)
-		return (u16 *) (vc->vc_origin + offset -
-				softback_lines * vc->vc_size_row);
-	p = softback_curr + offset;
-	if (p >= softback_end)
-		p += softback_buf - softback_end;
-	return (u16 *) p;
+	return (u16 *) (vc->vc_origin + offset);
 }
 
 static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos,
@@ -2785,22 +2575,7 @@  static unsigned long fbcon_getxy(struct
 
 		x = offset % vc->vc_cols;
 		y = offset / vc->vc_cols;
-		if (vc->vc_num == fg_console)
-			y += softback_lines;
 		ret = pos + (vc->vc_cols - x) * 2;
-	} else if (vc->vc_num == fg_console && softback_lines) {
-		unsigned long offset = pos - softback_curr;
-
-		if (pos < softback_curr)
-			offset += softback_end - softback_buf;
-		offset /= 2;
-		x = offset % vc->vc_cols;
-		y = offset / vc->vc_cols;
-		ret = pos + (vc->vc_cols - x) * 2;
-		if (ret == softback_end)
-			ret = softback_buf;
-		if (ret == softback_in)
-			ret = vc->vc_origin;
 	} else {
 		/* Should not happen */
 		x = y = 0;
@@ -2828,106 +2603,11 @@  static void fbcon_invert_region(struct v
 			a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) |
 			    (((a) & 0x0700) << 4);
 		scr_writew(a, p++);
-		if (p == (u16 *) softback_end)
-			p = (u16 *) softback_buf;
-		if (p == (u16 *) softback_in)
-			p = (u16 *) vc->vc_origin;
 	}
 }
 
-static void fbcon_scrolldelta(struct vc_data *vc, int lines)
-{
-	struct fb_info *info = registered_fb[con2fb_map[fg_console]];
-	struct fbcon_ops *ops = info->fbcon_par;
-	struct display *disp = &fb_display[fg_console];
-	int offset, limit, scrollback_old;
-
-	if (softback_top) {
-		if (vc->vc_num != fg_console)
-			return;
-		if (vc->vc_mode != KD_TEXT || !lines)
-			return;
-		if (logo_shown >= 0) {
-			struct vc_data *conp2 = vc_cons[logo_shown].d;
-
-			if (conp2->vc_top == logo_lines
-			    && conp2->vc_bottom == conp2->vc_rows)
-				conp2->vc_top = 0;
-			if (logo_shown == vc->vc_num) {
-				unsigned long p, q;
-				int i;
-
-				p = softback_in;
-				q = vc->vc_origin +
-				    logo_lines * vc->vc_size_row;
-				for (i = 0; i < logo_lines; i++) {
-					if (p == softback_top)
-						break;
-					if (p == softback_buf)
-						p = softback_end;
-					p -= vc->vc_size_row;
-					q -= vc->vc_size_row;
-					scr_memcpyw((u16 *) q, (u16 *) p,
-						    vc->vc_size_row);
-				}
-				softback_in = softback_curr = p;
-				update_region(vc, vc->vc_origin,
-					      logo_lines * vc->vc_cols);
-			}
-			logo_shown = FBCON_LOGO_CANSHOW;
-		}
-		fbcon_cursor(vc, CM_ERASE | CM_SOFTBACK);
-		fbcon_redraw_softback(vc, disp, lines);
-		fbcon_cursor(vc, CM_DRAW | CM_SOFTBACK);
-		return;
-	}
-
-	if (!scrollback_phys_max)
-		return;
-
-	scrollback_old = scrollback_current;
-	scrollback_current -= lines;
-	if (scrollback_current < 0)
-		scrollback_current = 0;
-	else if (scrollback_current > scrollback_max)
-		scrollback_current = scrollback_max;
-	if (scrollback_current == scrollback_old)
-		return;
-
-	if (fbcon_is_inactive(vc, info))
-		return;
-
-	fbcon_cursor(vc, CM_ERASE);
-
-	offset = disp->yscroll - scrollback_current;
-	limit = disp->vrows;
-	switch (disp->scrollmode) {
-	case SCROLL_WRAP_MOVE:
-		info->var.vmode |= FB_VMODE_YWRAP;
-		break;
-	case SCROLL_PAN_MOVE:
-	case SCROLL_PAN_REDRAW:
-		limit -= vc->vc_rows;
-		info->var.vmode &= ~FB_VMODE_YWRAP;
-		break;
-	}
-	if (offset < 0)
-		offset += limit;
-	else if (offset >= limit)
-		offset -= limit;
-
-	ops->var.xoffset = 0;
-	ops->var.yoffset = offset * vc->vc_font.height;
-	ops->update_start(info);
-
-	if (!scrollback_current)
-		fbcon_cursor(vc, CM_DRAW);
-}
-
 static int fbcon_set_origin(struct vc_data *vc)
 {
-	if (softback_lines)
-		fbcon_scrolldelta(vc, softback_lines);
 	return 0;
 }
 
@@ -2991,8 +2671,6 @@  static void fbcon_modechanged(struct fb_
 
 		fbcon_set_palette(vc, color_table);
 		update_screen(vc);
-		if (softback_buf)
-			fbcon_update_softback(vc);
 	}
 }
 
@@ -3434,7 +3112,6 @@  static const struct consw fb_con = {
 	.con_font_default	= fbcon_set_def_font,
 	.con_font_copy 		= fbcon_copy_font,
 	.con_set_palette 	= fbcon_set_palette,
-	.con_scrolldelta 	= fbcon_scrolldelta,
 	.con_set_origin 	= fbcon_set_origin,
 	.con_invert_region 	= fbcon_invert_region,
 	.con_screen_pos 	= fbcon_screen_pos,
@@ -3691,9 +3368,6 @@  static void fbcon_exit(void)
 	}
 #endif
 
-	kfree((void *)softback_buf);
-	softback_buf = 0UL;
-
 	for_each_registered_fb(i) {
 		int pending = 0;