linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] s390/cio: Harden pmcw/schib handling for dnv=0
@ 2026-09-10  9:32 Vineeth Vijayan
  2026-09-10  9:32 ` [PATCH 1/3] s390/cio: Fix cio_update_schib() to not cache invalid schib Vineeth Vijayan
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Vineeth Vijayan @ 2026-09-10  9:32 UTC (permalink / raw)
  To: wbezenah, cohuck, pasic, farman, mjrosato, oberpar; +Cc: linux-s390

For I/O subchannels, pmcw.dnv must be validated before relying on any
other PMCW or SCHIB fields.
Two issues exist today:
 - Some I/O entry points check pmcw.ena without first verifying that
   pmcw.dnv is set.
 - cio_update_schib() updates the cached SCHIB before validating
   pmcw.dnv, allowing an stsch result with dnv=0 to leave stale or
   undefined data in sch->schib.
 
This can trigger spurious, non-fatal error messages in the guest kernel
log when a virtio device is being detached.
 
Fix this by validating pmcw.dnv before updating the cached SCHIB. Also
clear the cached SCHIB when stsch succeeds but returns dnv=0, ensuring
that stale state is not retained.
 
Additionally, add pmcw.dnv checks before pmcw.ena checks in I/O entry
points and return -ENODEV when no device is present. Guard remaining
direct accesses to cached PMCW fields, such as chpid[] and pam, to
ensure they are only evaluated when the SCHIB contents are valid.
 
This was reported and discussed at:
 
Link: https://lore.kernel.org/linux-s390/20260612155407.199218-1-wbezenah@linux.ibm.com/ 

Vineeth Vijayan (3):
  s390/cio: Fix cio_update_schib() to not cache invalid schib
  s390/cio: Check pmcw.dnv before pmcw.ena in I/O entry points
  s390/cio: Guard PMCW field accesses with dnv check

 drivers/s390/cio/chp.c          |  3 +++
 drivers/s390/cio/cio.c          | 11 +++++++----
 drivers/s390/cio/device.c       |  9 +++++----
 drivers/s390/cio/device_fsm.c   |  3 +++
 drivers/s390/cio/device_ops.c   | 21 +++++++++++++++++++++
 drivers/s390/cio/vfio_ccw_fsm.c |  2 +-
 6 files changed, 40 insertions(+), 9 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-09-14 16:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10  9:32 [PATCH 0/3] s390/cio: Harden pmcw/schib handling for dnv=0 Vineeth Vijayan
2026-09-10  9:32 ` [PATCH 1/3] s390/cio: Fix cio_update_schib() to not cache invalid schib Vineeth Vijayan
2026-09-10  9:41   ` sashiko-bot
2026-09-10  9:32 ` [PATCH 2/3] s390/cio: Check pmcw.dnv before pmcw.ena in I/O entry points Vineeth Vijayan
2026-09-10  9:43   ` sashiko-bot
2026-09-10  9:32 ` [PATCH 3/3] s390/cio: Guard PMCW field accesses with dnv check Vineeth Vijayan
2026-09-10  9:48   ` sashiko-bot
2026-09-14 12:17 ` [PATCH 0/3] s390/cio: Harden pmcw/schib handling for dnv=0 Heiko Carstens
2026-09-14 12:50   ` Vineeth Vijayan
2026-09-14 16:43 ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).