From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753589AbdASQNw convert rfc822-to-8bit (ORCPT ); Thu, 19 Jan 2017 11:13:52 -0500 Received: from mout.gmx.net ([212.227.15.19]:59448 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753455AbdASQNe (ORCPT ); Thu, 19 Jan 2017 11:13:34 -0500 Message-ID: <1484842335.1250.7.camel@gmx.de> Subject: Re: [PATCH v10 3/4] console: Add persistent scrollback buffers for all VGA consoles From: Manuel =?ISO-8859-1?Q?Sch=F6lling?= To: Greg KH Cc: jslaby@suse.com, kilobyte@angband.pl, lkml14@scotdoyle.com, rdunlap@infradead.org, shorne@gmail.com, andrey_utkin@fastmail.com, akpm@linux-foundation.org, paul.burton@imgtec.com, daniel.vetter@ffwll.ch, tj@kernel.org, hdegoede@redhat.com, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Date: Thu, 19 Jan 2017 17:12:15 +0100 In-Reply-To: <20170119132352.GB29998@kroah.com> References: <201701112105.R6Zog6jw%fengguang.wu@intel.com> <20170113200758.9880-4-manuel.schoelling@gmx.de> <20170119132352.GB29998@kroah.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:432YTZ1rVhKX8DnH2UkTCoqweTYiNfxJrMIsVw0dUgj2JDM3FYz hUPyahkG7EvoywJUoPUGPjXNW2EaiKZejVWRGxMWlEvyA8iMijYk2bEpo4xs/pnE6mNzsm2 3hg4ZhIzHuoBMiTE0XEO71mb/ZMmC2gXSB+Jk0GmJYdui/sfCl/HMqLfv4RPHdnfWJt/N7+ 1gIXY0AOv/RigvMuJPLjg== X-UI-Out-Filterresults: notjunk:1;V01:K0:YiCnr5kSEgg=:RnBBnsEXgULfrBp8SVaytz /kBD30oC5LEJrHkKJul4/lRwYtIgUlcBRJsSMEqT1psRLCR1SmB3cRs/TymMgXZmxOfGpCZgd 3pnKqs5GwIfTTOV5Uk4lWQ1ny+/uA0Rhshq0Y5S2fVc2BLBOfHypTvqmDlpluSi1NOVwz99db KDMq+efGAd+qdkhUPxHR38auZ1ZV92U3/ImKbH4hbbXmDoOVQ6SQec/gGQQbrMiepLSu9zprb Idk70o9iQ7PZW2kQcUCYI9kx7wUPx0onEWOhFEOX22eZZfDkwvuSs5vhFC8Vw44e+u1H7Wmf9 6MmbglhsFG29vx3Fyh0ToIzynK8ndsO58L1771G7aBk2vp1RSY085gW0BiBTBvzOzsSlSnxPq 8r4h8qEMiPie1KtBSdM5TPN6ngtjjBnvR/LH0AUo2mGxI5osCxgyiELvXDXyXvVO0Ub8kMeSF eqNx6UBgkZNYiwzAeO1/Ds+OXvZyUCtOcLcmZWCjANP/74xmC5z6Xik5V2735GoYg/k/SNNzT C1E+OpJN5IgRT3PXhg90vK2WAxppfn+nk0cFFlLeaRnWhRjgOuFB/p8d7Ah0JbsEPTC3uX268 WwyeWDpVtBMy+/y60Px6Y/6a0RRHJfi7INdEsNxYJb7DIyhmqFp3xtpmlgvUaIbRNwdBRqetU bcOAQ0WBMsalNGhoqtqWVqMiZe5t81/xOV3ZlySIuE47TYTfQDuTsEs1HPkQ26MWw3JQ8IqYq CHcLFUOcsOeWvQRV0Kcfr9tiWU6r6uNw02kSYO2qD+4SY8MaaMTzdR592dUXDO7iJRcZ7BSgX lKb+M9k Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-01-19 at 14:23 +0100, Greg KH wrote: > On Fri, Jan 13, 2017 at 09:07:57PM +0100, Manuel Schölling wrote: > > Add a scrollback buffers for each VGA console. The benefit is that > > the scrollback history is not flushed when switching between > > consoles > > but is persistent. > > The buffers are allocated on demand when a new console is opened. > > > > This breaks tools like clear_console that rely on flushing the > > scrollback history by switching back and forth between consoles > > which is why this feature is disabled by default. > > Use the escape sequence \e[3J instead for flushing the buffer. > > > > Signed-off-by: Manuel Schölling > > Reviewed-by: Andrey Utkin > > Tested-by: Andrey Utkin > > Tested-by: Adam Borowski > > --- > >  drivers/video/console/Kconfig  |  25 +++++++- > >  drivers/video/console/vgacon.c | 142 ++++++++++++++++++++++++++--- > > ------------ > >  2 files changed, 111 insertions(+), 56 deletions(-) > > > > diff --git a/drivers/video/console/Kconfig > > b/drivers/video/console/Kconfig > > index c3f1fb9ee820..f500e58f7636 100644 > > --- a/drivers/video/console/Kconfig > > +++ b/drivers/video/console/Kconfig > > @@ -43,9 +43,28 @@ config VGACON_SOFT_SCROLLBACK_SIZE > >         range 1 1024 > >         default "64" > >         help > > -         Enter the amount of System RAM to allocate for the > > scrollback > > -  buffer.  Each 64KB will give you approximately 16 80x25 > > -  screenfuls of scrollback buffer > > +   Enter the amount of System RAM to allocate for > > scrollback > > +   buffers of VGA consoles. Each 64KB will give you > > approximately > > +   16 80x25 screenfuls of scrollback buffer. > > + > > +config VGACON_SOFT_SCROLLBACK_PERSISTENT > > + bool "Persistent Scrollback History for each console" > > + depends on VGACON_SOFT_SCROLLBACK > > + default n > > + help > > +   Say Y here if the scrollback history should persist when > > switching > > +   between consoles. Otherwise, the scrollback history will > > be flushed > > +   each time the console is switched. > > + > > +   This feature might break your tool of choice to flush > > the scrollback > > +   buffer, e.g. clear(1) will work fine but Debian's > > clear_console(1) > > +   will be broken, which might cause security issues. > > +   You can use the escape sequence \e[3J instead if this > > feature is > > +   activated. > > This issue is the one that makes me the most worried.  Why doesn't > clear_console() work anymore?  Why doesn't it use \e[3J ? Well, clear_console() just switches from one console to another and back again. It just assumes that the scrollback buffer is flushed when switching. My plan is to make a patch for clear_console() as soon as these patches are in the kernel - it's chicken-and-egg problem. Bye, Manuel