qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] css: SCHIB measurement block origin must be aligned
@ 2021-02-19 13:39 Pierre Morel
  2021-02-19 13:39 ` [PATCH v2 1/1] " Pierre Morel
  2021-02-22 11:11 ` [PATCH v2 0/1] " Cornelia Huck
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre Morel @ 2021-02-19 13:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: thuth, pmorel, david, cohuck, pasic, borntraeger, qemu-s390x, rth

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(+)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/1] css: SCHIB measurement block origin must be aligned
  2021-02-19 13:39 [PATCH v2 0/1] css: SCHIB measurement block origin must be aligned Pierre Morel
@ 2021-02-19 13:39 ` Pierre Morel
  2021-02-19 13:41   ` Thomas Huth
  2021-02-22 11:11 ` [PATCH v2 0/1] " Cornelia Huck
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre Morel @ 2021-02-19 13:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: thuth, pmorel, david, cohuck, pasic, borntraeger, qemu-s390x, rth

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 <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] 5+ messages in thread

* Re: [PATCH v2 1/1] css: SCHIB measurement block origin must be aligned
  2021-02-19 13:39 ` [PATCH v2 1/1] " Pierre Morel
@ 2021-02-19 13:41   ` Thomas Huth
  2021-02-19 18:49     ` Pierre Morel
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2021-02-19 13:41 UTC (permalink / raw)
  To: Pierre Morel, qemu-devel
  Cc: david, cohuck, pasic, borntraeger, qemu-s390x, rth

On 19/02/2021 14.39, Pierre Morel wrote:
> 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 <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;
>   }

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] css: SCHIB measurement block origin must be aligned
  2021-02-19 13:41   ` Thomas Huth
@ 2021-02-19 18:49     ` Pierre Morel
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Morel @ 2021-02-19 18:49 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: david, cohuck, pasic, borntraeger, qemu-s390x, rth



On 2/19/21 2:41 PM, Thomas Huth wrote:
> On 19/02/2021 14.39, Pierre Morel wrote:
>> 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 <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;
>>   }
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 

Thanks,
Pierre

-- 
Pierre Morel
IBM Lab Boeblingen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/1] css: SCHIB measurement block origin must be aligned
  2021-02-19 13:39 [PATCH v2 0/1] css: SCHIB measurement block origin must be aligned Pierre Morel
  2021-02-19 13:39 ` [PATCH v2 1/1] " Pierre Morel
@ 2021-02-22 11:11 ` Cornelia Huck
  1 sibling, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2021-02-22 11:11 UTC (permalink / raw)
  To: Pierre Morel
  Cc: thuth, david, qemu-devel, pasic, borntraeger, qemu-s390x, rth

On Fri, 19 Feb 2021 14:39:32 +0100
Pierre Morel <pmorel@linux.ibm.com> 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
> 
> 
> Pierre Morel (1):
>   css: SCHIB measurement block origin must be aligned
> 
>  target/s390x/ioinst.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Thanks, applied.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-22 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 13:39 [PATCH v2 0/1] css: SCHIB measurement block origin must be aligned Pierre Morel
2021-02-19 13:39 ` [PATCH v2 1/1] " Pierre Morel
2021-02-19 13:41   ` Thomas Huth
2021-02-19 18:49     ` Pierre Morel
2021-02-22 11:11 ` [PATCH v2 0/1] " Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).