Re: [PATCH] selftests: kvm: Check whether SIDA memop fails for normal guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/15/22 10:59, Thomas Huth wrote:
> On 15/02/2022 10.54, Janis Schoetterl-Glausch wrote:
>> On 2/15/22 08:48, Thomas Huth wrote:
>>> Commit 2c212e1baedc ("KVM: s390: Return error on SIDA memop on normal
>>> guest") fixed the behavior of the SIDA memops for normal guests. It
>>> would be nice to have a way to test whether the current kernel has
>>> the fix applied or not. Thus add a check to the KVM selftests for
>>> these two memops.
>>>
>>> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
>>> ---
>>>   tools/testing/selftests/kvm/s390x/memop.c | 15 +++++++++++++++
>>>   1 file changed, 15 insertions(+)
>>>
>>> diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
>>> index 9f49ead380ab..d19c3ffdea3f 100644
>>> --- a/tools/testing/selftests/kvm/s390x/memop.c
>>> +++ b/tools/testing/selftests/kvm/s390x/memop.c
>>> @@ -160,6 +160,21 @@ int main(int argc, char *argv[])
>>>       run->psw_mask &= ~(3UL << (63 - 17));   /* Disable AR mode */
>>>       vcpu_run(vm, VCPU_ID);                  /* Run to sync new state */
>>>
>>> +    /* Check that the SIDA calls are rejected for non-protected guests */
>>> +    ksmo.gaddr = 0;
>>> +    ksmo.flags = 0;
>>> +    ksmo.size = 8;
>>> +    ksmo.op = KVM_S390_MEMOP_SIDA_READ;
>>> +    ksmo.buf = (uintptr_t)mem1;
>>> +    ksmo.sida_offset = 0x1c0;
>>
>> What is the rational for that constant?
>> Any would do, as long as size + offset < PAGE_SIZE, correct?
> 
> Right, it's rather a random value.

Ah, ok.

Reviewed-by: Janis Schoetterl-Glausch <scgl@xxxxxxxxxxxxx>
> 
>  Thomas
> 




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux