Commit graph

5866 commits

Author SHA1 Message Date
Eric Farman
c5e8083f95 vfio/ccw: replace copy_from_iova with vfio_dma_rw
It was suggested [1] that we replace the old copy_from_iova() routine
(which pins a page, does a memcpy, and unpins the page) with the
newer vfio_dma_rw() interface.

This has a modest improvement in the overall time spent through the
fsm_io_request() path, and simplifies some of the code to boot.

[1] https://lore.kernel.org/r/20220706170553.GK693670@nvidia.com/

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:07 +01:00
Eric Farman
254cb663c2 vfio/ccw: move where IDA flag is set in ORB
The output of vfio_ccw is always a Format-2 IDAL, but the code that
explicitly sets this is buried in cp_init().

In fact the input is often already a Format-2 IDAL, and would be
rejected (via the check in ccwchain_calc_length()) if it weren't,
so explicitly setting it doesn't do much. Setting it way down here
only makes it impossible to make decisions in support of other
IDAL formats.

Let's move that to where the rest of the ORB is set up, so that the
CCW processing in cp_prefetch() is performed according to the
contents of the unmodified guest ORB.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:07 +01:00
Eric Farman
155a4321c1 vfio/ccw: allow non-zero storage keys
Currently, vfio-ccw copies the ORB from the io_region to the
channel_program struct being built. It then adjusts various
pieces of that ORB to the values needed to be used by the
SSCH issued by vfio-ccw in the host.

This includes setting the subchannel key to the default,
presumably because Linux doesn't do anything with non-zero
storage keys itself. But it seems wrong to convert every I/O
to the default key if the guest itself requested a non-zero
subchannel (access) key.

Any channel program that sets a non-zero key would expect the
same key returned in the SCSW of the IRB, not zero, so best to
allow that to occur unimpeded.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:07 +01:00
Eric Farman
9fbed59fcd vfio/ccw: simplify the cp_get_orb interface
There's no need to send in both the address of the subchannel
struct, and an element within it, to populate the ORB.

Pass the whole pointer and let cp_get_orb() take the pieces
that are needed.

Suggested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:07 +01:00
Eric Farman
8a54e238ef vfio/ccw: cleanup some of the mdev commentary
There is no longer an mdev struct accessible via a channel
program struct, but there are some artifacts remaining that
mention it. Clean them up.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:06 +01:00
Sven Schnelle
ba5c2e2ae4 s390/con3270: add special output handling when oops_in_progress is set
Normally a user can scroll back with PF7/PF8 if printed messages are
outside of the visible screen area. This doesn't work when the kernel
crashes, because the scrollback handling is done by the kernel, which
is no longer alive after the kernel crash. Add code to always print
all dirty lines in the screen buffer, so the user can scroll back with
the terminal scrollback keys (Page Up/Down).

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:06 +01:00
Sven Schnelle
422a78ea35 s390/con3270: set SBA and RA addresses when converting lines
Now that lines are converted during output, the RA and SBA no longer
need to get updated as an additional step. Instead set them when
converting the line.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:06 +01:00
Sven Schnelle
da4e272e83 s390/con3270: simplify update flags
Make TTY3270_UPDATE_ALL the sum of all TTY3270_* flags, so we
don't need any special handling for it.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:06 +01:00
Sven Schnelle
9975fde09e s390/con3270: return from notifier when activate view fails
When activating the view fails (in this case because the 3270
is disconnected) return from the notifer callback. Otherwise
the system will deadlock.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:06 +01:00
Sven Schnelle
61f37f63f9 s390/fs3270: split header files
In order to use the fs3270 one would need at least the ioctl definitions
in uapi. Add two new include files in uapi, which contain:

fs3270: ioctl number declarations + returned struct for TUBGETMOD.
raw3270: all the orders, attributes and similar stuff used with 3270
terminals.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:05 +01:00
Sven Schnelle
a554dbd740 s390/fs3270: fix screen reset on activate
fs3270 uses EWRITEA to clear the screen when a user opens /dev/3270/tub.
However it misses the attribute byte after the EWRITEA, so (at least)
x3270 complains about 'Record too short, missing write flags'.
Add the missing flag byte to fix this.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:05 +01:00
Sven Schnelle
ec40213bfb s390/fs3270: fix function prototypes
fix function prototypes split over two lines like:

static void
foobar(void)

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:05 +01:00
Sven Schnelle
84a8b601ea s390/fs3270: use *ptr instead of struct in kzalloc
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:05 +01:00
Sven Schnelle
aa08b6a46b s390/fs3270: remove duplicate assignment
remove a duplicate assignment reported by checkpatch.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:05 +01:00
Sven Schnelle
945775155e s390/fs3270: add missing braces to if/else
Fix a few missing braces and wrong placement of braces
reported by checkpatch.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:04 +01:00
Sven Schnelle
a82603b0d6 s390/fs3270: fix whitespace errors
Fix a few whitespace errors reported by checkpatch, namely
superfluous whitespace, missing spaces and empty lines.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:04 +01:00
Sven Schnelle
31bc23241b s390/raw3270: fix nullpointer check
Fix the following checkpatch warning:

CHECK: Comparison to NULL could be written "!rp"
+       if (rp == NULL)

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:04 +01:00
Sven Schnelle
420105f450 s390/raw3270: split up raw3270_activate_view()
move the core processing to __raw3270_activate_view() to
reduce the required if/else blocks and indentiion levels.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:04 +01:00
Sven Schnelle
7aeeeb926c s390/raw3270: remove BUG_ON in raw3270_request_reset()
WARN_ON_ONCE if list is not empty, and return an error code
instead.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:04 +01:00
Sven Schnelle
82df96d849 s390/raw3270: use DEVICE_ATTR_RO() for sysfs attributes
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:03 +01:00
Sven Schnelle
fd2a41d07b s390/raw3270: add comment to spinlock member
Add a small comment to the lock member of struct raw3270_view
to make checkpatch happy.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:03 +01:00
Sven Schnelle
0d85d8edaf s390/raw3270: fix raw3270 declarations
checkpatch complains about missing argument names in function
declarations. Fix it.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:03 +01:00
Sven Schnelle
ff61744c97 s390/raw3270: fix indentation/whitespace errors
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:03 +01:00
Sven Schnelle
754f66b59c s390/raw3270: move EXPORT_SYMBOL() next to functions
Fixes a few checkpatch warning about EXPORT_SYMBOL being
at the end of the file instead of being next to the
functions.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:03 +01:00
Sven Schnelle
7ef213879a s390/con3270: fix minor checkpatch issues
Fix remaining checkpatch issues, like misplaced brackets,
whitespace and similar things. No functional change.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
9e1d1d8e76 s390/con3270: use msecs_to_jiffies()
Use msecs_to_jiffies() instead of HZ/10.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
f867493089 s390/con3270: fix multiple assignments in one line
fix the following and similar checkpatch warnings:

CHECK: multiple assignments should be avoided
+		       tp->cx = tp->saved_cx = 0;

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
303bac9df7 s390/con3270: fix camelcase in enum members
fix the following and similar checkpatch warnings:

CHECK: Avoid CamelCase: <ESnormal>
+       enum { ESnormal, ESesc, ESsquare, ESparen, ESgetpars };

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
525c919d5e s390/con3270: add key help to status area
To let the user know about function key bindings, print
them next to the Running/History field at the lower right
of the screen. Also print the scrollback position.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
0573fff205 s390/con3270: reduce highlight width to 3 bits
With the previous change this reduces the size of struct tty3270_attribute
from four to two bytes. As we have this struct allocated for each character
cell, this saves quite some memory.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:02 +01:00
Sven Schnelle
18fc2e93b6 s390/con3270: reduce f_color and b_color attribute size to 4 bit
As we're only supportign 8 colors, we don't need 8 bits. Reduce the
size to 4 bits to save memory.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:01 +01:00
Sven Schnelle
7648507870 s390/con3270: rewrite command line recalling
Command line recalling is the last user of the 3270 custom malloc()
like allocator. Remove this dependency by using a statically allocated
buffer for the saved command lines, and also remove the allocator.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:01 +01:00
Sven Schnelle
164eb66934 s390/tty3270: use normal char buffer for prompt/input
Preparation patch to allow removing the custom 3270 memory allocator.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:01 +01:00
Sven Schnelle
9c138af9b7 s390/tty3270: convert lines during output
The length of the screen line is variable with the 3270 protocol.
For each attribute (foreground, background color, highlighting etc)
we need 3 bytes: the set attribute order, the attribute number, and
the value of the attribute. This means that depending on screen content,
we might end up 3*3 bytes addtional data for a single character.

Allocating the maximum possible amount of memory is quite a lot, and
we cannot easily extend the lines by allocating memory because we
might get called from atomic context. Failing to extend the memory
would also be bad as that would mean that we could miss kernel messages
in oom conditions. Therefore move the conversion to a 3270 datastream
to tty3270_update(), and use only single line buffer.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:01 +01:00
Sven Schnelle
ec1b0a33a3 s390/con3270: generate status line during output
Updating the status line is almost the same as generating
it when redrawing the screen. However, the code is much easier
to read when doing so.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:01 +01:00
Sven Schnelle
ae6572445b s390/tty3270: add 3270 datastream helpers
There are lots of places adding attributes or orders to the datastream.
Add a few helpers to make that code shorter and easier to read.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:00 +01:00
Sven Schnelle
6e49017ce4 s390/tty3270: move ASCII->EBCDIC conversion to convert_line()
Instead of always converting the character set, only convert them
when the line is really displayed.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:00 +01:00
Sven Schnelle
2b62ba58b3 s390/con3270: move tty3270_convert_line()
To make the upcoming patches easier to read, move tty3270_convert_line()
before changing code. No functional change.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:00 +01:00
Sven Schnelle
f77f936afe s390/raw3270: make raw3270_buffer_address() accept x/y coordinates
All callers of raw3270_buffer_address() are calculating the offset
from some x/y coordinates. Move that calculation inside of the
function, so user can pass the x/y values directly. Note that
negative values are relative to the end-of-line or end-of-screen.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:00 +01:00
Sven Schnelle
b2057c8702 s390/tty3270: allocate screen with scrollback
No functional change (except more memory consumption), in preparation
for the line buffer rework.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:34:00 +01:00
Sven Schnelle
9eb99b941b s390/con3270: add helper to get number of tty rows
There a quite a few places using 'tp->view.rows - 2'.
Add a helper function for this. This will also be used
when a function key help line will be added.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
1fefd62fee s390/tty3270: split up tty3270_convert_line()
To make the code easier to read, split up tty3270_convertline()
into several subfunctions:

- tty3270_resize_line() to realloc the line if it doesn't have enough
  space left
- tty3270_required_length() to calculate how much space we need
- tty3270_add_attributes() to add the color and highlight attributes
- tty3270_add_reset_attributes() to reset the attributes at the end of
  the line

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
cbb36313bd s390/tty3270: resize terminal when the clear key is pressed
There's no easy way to figure out whether the user has re-connected
to the z/VM session. When the user re-connected with a different geometry
to z/VM, the screen layout is broken. Allow the user to force a resizing
by pressing the Clear Key.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
91621ba7d7 s390/tty3270: move resize work to raw3270
This change was initially made to reduce code duplication when the
con3270 and tty3270 shared the same resize code. It still makes sense
to move the resize workqueue to raw3270 in case we add some other view
later.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
f08e31558a s390/raw3270: add raw3270_start_request() helper
There are a few places (and there would be more with the following commits)
like this:

raw3270_request_reset(cp->kreset);
raw3270_request_set_cmd(cp->kreset, TC_WRITE);
raw3270_request_add_data(cp->kreset, &kreset_data, 1);
raw3270_start(&cp->view, cp->kreset);

i.e reset a request, setting the command, adding payload, and starting the
request. Add a helper raw3270_start_request() which takes a command and
the payload as argument and calls the approppriate functions.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
e22de7d791 s390/tty3270: add AID defines
Use AID_* instead of hex numbers to make the code a bit
easier to read. also convert the if/else blocks to a
switch statement in tty3270_read_tasklet().

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:59 +01:00
Sven Schnelle
970cf9a97a s390/tty3270: ignore NUL characters
With 'TERM=vt220' zsh is sending several NUL characters with
the prompt to the tty. Both xterm and the linux drm console
seem to ignore them. Ignore them in tty3270 as well.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:58 +01:00
Sven Schnelle
e4b57b9393 s390/tty3270: add support for VT100 graphics escape
Add support for ESC(B and ESC(0 to switch between character charset
and graphics charset. Used in vt100 and later terminal generations.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:58 +01:00
Sven Schnelle
94dbb0a76c s390/tty3270: add support for graphic escape
Add support for ASCII S0/S1 to switch between character
charset and graphic charset.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:58 +01:00
Sven Schnelle
4043ea2253 s390/tty3270: add support for background color
3270 terminals support 8 background colors. Add the code to utilize
them. Unfortunately the line erase code need to be adjusted: Without
background colors, it was sufficient to just set the line length to
zero. With background colors, we need to put spaces with the correct
background color.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-09 14:33:58 +01:00