css: SCHIB measurement block origin must be aligned
v2 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 last 6 bits of the MBO must be null, i.e. an aligned on 64 bytes of the MBO, otherwise an operand exception is recognized when issuing a msch instruction.
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
PATCH v2 1/1 css: SCHIB measurement block origin must be aligned
The Measurement Block Origin inside the SCHIB is used when Measurement Block format 1 is in used and must be aligned on 64 bytes otherwise an operand exception is recognized when issuing the Modify Sub CHannel (MSCH) instruction.
--- target/s390x/ioinst.c | 6 ++++++ 1 file changed, 6 insertions(+)
target/s390x/ioinst.c +6 -0
@@ -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
Quoted 16 lines · Pierre Morel
The Measurement Block Origin inside the SCHIB is used when Measurement Block format 1 is in used and must be aligned on 64 bytes otherwise an operand exception is recognized when issuing the Modify Sub CHannel (MSCH) instruction.
Signed-off-by Pierre Morel <[email protected]>--- target/s390x/ioinst.c | 6 ++++++ 1 file changed, 6 insertions(+)target/s390x/ioinst.c +0
-0@@ -121,6 +121,12 @@ static int ioinst_schib_valid(SCHIB *schib)if (be32_to_cpu (schib->pmcw.chars) &PMCW_CHARS_MASK_XMWME ) {
target/s390x/ioinst.c static int ioinst_schib_valid(SCHIB *schib) · line 131
Quoted 10 lines
target/s390x/ioinst.c +6
-0return 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 ; }
Quoted 21 lines · Thomas Huth
Quoted 20 lines · Pierre Morel
The Measurement Block Origin inside the SCHIB is used when Measurement Block format 1 is in used and must be aligned on 64 bytes otherwise an operand exception is recognized when issuing the Modify Sub CHannel (MSCH) instruction.
Signed-off-by Pierre Morel <[email protected]>---
target/s390x/ioinst.c| 6 ++++++1 file changed, 6 insertions(+)target/s390x/ioinst.c +2
-0@@ -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 */
Quoted 9 lines
target/s390x/ioinst.c static int ioinst_schib_valid(SCHIB *schib) · line 131
Quoted 6 lines
target/s390x/ioinst.c +4
-0+ if ((be16_to_cpu(schib->pmcw.chars) & PMCW_CHARS_MASK_MBFC) && + (be64_to_cpu(schib->mba) & 0x03fUL)) { + return 0; + } return 1; }Reviewed-by Thomas Huth <[email protected]>
Thanks,
Pierre
Signature · 2 lines
Pierre Morel IBM Lab Boeblingen
Cornelia Huck
AppliedQuoted 13 lines · On Fri, 19 Feb 2021 14:39:32 +0100 Pierre Morel <[email protected]> wrote:
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 last 6 bits of the MBO must be null, i.e. an aligned on 64 bytes of the MBO, otherwise an operand exception is recognized when issuing a msch instruction.
Regards,
Pierre
Quoted 6 lines
Pierre Morel (1):
css: SCHIB measurement block origin must be alignedtarget/s390x/ioinst.c | 6 ++++++ 1 file changed, 6 insertions(+)
Thanks, applied.