Skip to contentSkip to conversation

KVM: s390: add function unlink_gib_alert_list()

PATCH Michael Mueller 1 participant 1 message Nov 20, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20181119194707.GB3793@osiris

#1 lore raw
Quoted 30 lines · Heiko Carstens
Quoted 9 lines · Michael Mueller

The function atomically returns the address of the first GISA of this list and stores a zero address in the origin list field of the GIB instead.

The GIB alert list contains all GISAs that have pending adapter interruptions.

...

Quoted 7 lines
(quoted diff) +7 -0
+static struct kvm_s390_gisa __maybe_unused *unlink_gib_alert_list(void)
+{
+	u32 gisa;
+
+	if (!gib)
+		return NULL;
+

...

Review

Quoted 6 lines
(quoted diff) +6 -0
+	do {
+		gisa = READ_ONCE(gib->alert_list_origin);
+	} while (cmpxchg(&gib->alert_list_origin, gisa, 0) != gisa);
+
+	return (void *)(u64) gisa;
+}

Please make this shorter:

Quoted 2 lines
	return (void *)(u64) xchg(&gib->alert_list_origin, gisa, 0);

Unbelievable... just one macro further down. Thanks for pointing me to.