Skip to contentSkip to conversation

fces event support in cio

RFC In review Vineeth Vijayan 2 participants 4 messages Feb 18, 2020

Subsystems (2)
lore
Share & tools
lore

Vineeth Vijayan

author maintainer
#0 lore raw

v2 cover fces event support in cio

Compared to the previous version of this RFC(RFC v1 0/2] support FC-Endpoint Security events), there is a change in the information we passed to the consumer-devices using path-event.

Previously we used to share the exact event of fces, which is derived from the sei_area->ccdf[0]. In this patch, instead of sending the right event, simply inform the ccwdev about the occurance of 'fces event' using path_event. The ccwdev then query more information about the fces-event using the chsc_scud() call and notify based on the reply.

Sebastian Ott (1):
s390/cio: handle changes related to endpoint security

Vineeth Vijayan (1):
s390/cio: add support for fces status notification

 arch/s390/include/asm/ccwdev.h |  1 +
 drivers/s390/cio/chp.h         |  1 +
 drivers/s390/cio/chsc.c        | 73 ++++++++++++++++++++++++++++++++++
 drivers/s390/cio/device.c      | 19 ++++++++-
 4 files changed, 93 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

RFC v2 1/2 s390/cio: handle changes related to endpoint security

From: Sebastian Ott <[email protected]>

Reference-ID: IO1812

---
 drivers/s390/cio/chsc.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
drivers/s390/cio/chsc.c +33 -0
index b7256ea5b669..6218bcb8d21f 100644
@@ -566,6 +566,36 @@ static void chsc_process_sei_ap_cfg_chg(struct chsc_sei_nt0_area *sei_area)
 	ap_bus_cfg_chg();
 }
 
+static void chsc_process_sei_esc_change(struct chsc_sei_nt0_area *sei_area)
+{
+	struct channel_path *chp;
+	struct chp_id chpid;
+	int status;
+
+	CIO_CRW_EVENT(4, "chsc: endpoint security status notification (rs=%02x, "
+		      "rs_id=%04x, esc=%x)\n", sei_area->rs, sei_area->rsid,
+		      sei_area->ccdf[0]);
+	if (sei_area->rs != 4)
+		return;
+	chp_id_init(&chpid);
+	chpid.id = sei_area->rsid;
+	/* allocate a new channel path structure, if needed */
+	status = chp_get_status(chpid);
+	if (!status)
+		return;
+
+	if (status < 0) {
+		chp_new(chpid);
+	} else {
+		chp = chpid_to_chp(chpid);
+		mutex_lock(&chp->lock);
+		chp_update_desc(chp);
+		mutex_unlock(&chp->lock);
+	}
+
+	/* notify driver? check I/O? */
+}
+
 static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area)
 {
 	switch (sei_area->cc) {
@@ -607,6 +637,9 @@ static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area)
 	case 14: /* scm available notification */
 		chsc_process_sei_scm_avail(sei_area);
 		break;
+	case 15: /* endpoint security status update notification */
+		chsc_process_sei_esc_change(sei_area);
+		break;
 	default: /* other stuff */
 		CIO_CRW_EVENT(2, "chsc: sei nt0 unhandled cc=%d\n",
 			      sei_area->cc);
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

RFC v2 2/2 s390/cio: add support for fces status notification

In reply to Vineeth Vijayan

Fiber channel endpoint security event is received as an sei:nt0 type in the cio-chsc layer. this information needs to be shared with the ccwdev devices (dasd for instance) using path_events. Send this information to the sch layer which will internally use the path-event for this notification.

Reference-ID: IO1812

---
 arch/s390/include/asm/ccwdev.h |  1 +
 drivers/s390/cio/chp.h         |  1 +
 drivers/s390/cio/chsc.c        | 50 ++++++++++++++++++++++++++++++----
 drivers/s390/cio/device.c      | 19 ++++++++++++-
 4 files changed, 65 insertions(+), 6 deletions(-)
arch/s390/include/asm/ccwdev.h +1 -0
index 865ce1cb86d5..3662bb27bd01 100644
@@ -103,6 +103,7 @@ struct ccw_device {
 					       was successfully verified. */
 #define PE_PATHGROUP_ESTABLISHED	0x4 /* A pathgroup was reset and had
 					       to be established again. */
+#define PE_PATH_FCES_EVENT		0x8 /* An event from FCES */
 
 /*
  * Possible CIO actions triggered by the unit check handler.
drivers/s390/cio/chp.h +1 -0
index 20259f3fbf45..7ee9eba0abcb 100644
@@ -23,6 +23,7 @@
 #define CHP_OFFLINE 1
 #define CHP_VARY_ON 2
 #define CHP_VARY_OFF 3
+#define CHP_FCES_EVENT 4
 
 struct chp_link {
 	struct chp_id chpid;
drivers/s390/cio/chsc.c +45 -5

77 lines not on this page · raw message

drivers/s390/cio/device.c +18 -1
index 0c6245fc7706..518794a7fab5 100644
@@ -1165,7 +1165,8 @@ static int io_subchannel_chp_event(struct subchannel *sch,
 				   struct chp_link *link, int event)
 {
 	struct ccw_device *cdev = sch_get_cdev(sch);
-	int mask;
+	int mask, chpid, maskval;
+	int path_event[8];
 
 	mask = chp_ssd_get_mask(&sch->ssd_info, link);
 	if (!mask)
@@ -1200,6 +1201,22 @@ static int io_subchannel_chp_event(struct subchannel *sch,
 			cdev->private->path_new_mask |= mask;
 		io_subchannel_verify(sch);
 		break;
+	case CHP_FCES_EVENT:
+		/* call the path_event functionality and let the
+		 * consumer device know about the end-point security
+		 * event
+		 */
+		for (chpid = 0, maskval = 0x80; chpid < 8; chpid++,
+				maskval >>= 1) {
+			path_event[chpid] = PE_NONE;
+			if (mask == maskval)
+				path_event[chpid] = PE_PATH_FCES_EVENT;
+		}
+		spin_lock_irq(cdev->ccwlock);
+		if (cdev)
+			cdev->drv->path_event(cdev, path_event);
+		spin_unlock_irq(cdev->ccwlock);
+		break;
 	}
 	return 0;
 }
Signature · 1 line
2.17.1
#3 lore raw
In reply to Vineeth Vijayan
Quoted 13 lines · Vineeth Vijayan

Compared to the previous version of this RFC(RFC v1 0/2] support FC-Endpoint Security events), there is a change in the information we passed to the consumer-devices using path-event.

Previously we used to share the exact event of fces, which is derived from the sei_area->ccdf[0]. In this patch, instead of sending the right event, simply inform the ccwdev about the occurance of 'fces event' using path_event. The ccwdev then query more information about the fces-event using the chsc_scud() call and notify based on the reply.

Sebastian Ott (1):
s390/cio: handle changes related to endpoint security

Quoted 8 lines

Vineeth Vijayan (1):
s390/cio: add support for fces status notification

 arch/s390/include/asm/ccwdev.h |  1 +
 drivers/s390/cio/chp.h         |  1 +
 drivers/s390/cio/chsc.c        | 73 ++++++++++++++++++++++++++++++++++
 drivers/s390/cio/device.c      | 19 ++++++++-
 4 files changed, 93 insertions(+), 1 deletion(-)

Please disregard this RFC for now - the patches need some more internal discussions before they are ready for external review.

Signature · 2 lines
Peter Oberparleiter
Linux on Z Development - IBM Germany