* [PATCH 0/1] css: SCHIB measurement block origin must be aligned
@ 2021-02-18 17:33 Pierre Morel
2021-02-18 17:33 ` [PATCH 1/1] " Pierre Morel
0 siblings, 1 reply; 2+ messages in thread
From: Pierre Morel @ 2021-02-18 17:33 UTC (permalink / raw)
To: kvm; +Cc: frankja, david, thuth, cohuck, imbrenda, pasic
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(+)
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] css: SCHIB measurement block origin must be aligned
2021-02-18 17:33 [PATCH 0/1] css: SCHIB measurement block origin must be aligned Pierre Morel
@ 2021-02-18 17:33 ` Pierre Morel
0 siblings, 0 replies; 2+ messages in thread
From: Pierre Morel @ 2021-02-18 17:33 UTC (permalink / raw)
To: kvm; +Cc: frankja, david, thuth, cohuck, imbrenda, pasic
The Measurement Block Origin inside the SCHIB is used when
Mesurement Block format 1 is in used and must be aligned
on 128bits.
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
target/s390x/ioinst.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c
index a412926d27..1ee11522e1 100644
--- a/target/s390x/ioinst.c
+++ b/target/s390x/ioinst.c
@@ -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;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-18 18:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 17:33 [PATCH 0/1] css: SCHIB measurement block origin must be aligned Pierre Morel
2021-02-18 17:33 ` [PATCH 1/1] " Pierre Morel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox