Skip to contentSkip to conversation

css: SCHIB measurement block origin must be aligned

PATCH Superseded Pierre Morel 1 participant 2 messages Feb 18, 2021 KVM

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover css: SCHIB measurement block origin must be aligned

Hi,

By testing Measurement with KVM unit tests I fall on this:
we forgot to test the alignment of the MBO for measurement format 1.

The MB must be aligned on 128bits otherwise an operand exception is recognized.

Regards,
Pierre

Pierre Morel (1):
css: SCHIB measurement block origin must be aligned

 target/s390x/ioinst.c | 6 ++++++
 1 file changed, 6 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 css: SCHIB measurement block origin must be aligned

The Measurement Block Origin inside the SCHIB is used when Mesurement Block format 1 is in used and must be aligned on 128bits.

---
 target/s390x/ioinst.c | 6 ++++++
 1 file changed, 6 insertions(+)
target/s390x/ioinst.c +6 -0
index a412926d27..1ee11522e1 100644
@@ -121,6 +121,12 @@ static int ioinst_schib_valid(SCHIB *schib)
     if (be32_to_cpu(schib->pmcw.chars) & PMCW_CHARS_MASK_XMWME) {
         return 0;
     }
+    /* for MB format 1 bits 26-31 of word 11 must be 0 */
+    /* MBA uses words 10 and 11, it means align on 2**6 */
+    if ((be16_to_cpu(schib->pmcw.chars) & PMCW_CHARS_MASK_MBFC) &&
+        (be64_to_cpu(schib->mba) & 0x03fUL)) {
+        return 0;
+    }
     return 1;
 }
 
Signature · 1 line
2.25.1