lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <899e5148-8e65-8260-6f3c-546b4f5a650f@linux.ibm.com>
Date:   Wed, 13 Jul 2022 10:34:16 +0200
From:   Janosch Frank <frankja@...ux.ibm.com>
To:     Pierre Morel <pmorel@...ux.ibm.com>,
        Janis Schoetterl-Glausch <scgl@...ux.ibm.com>,
        kvm@...r.kernel.org
Cc:     linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
        borntraeger@...ibm.com, cohuck@...hat.com, david@...hat.com,
        thuth@...hat.com, imbrenda@...ux.ibm.com, hca@...ux.ibm.com,
        gor@...ux.ibm.com, wintera@...ux.ibm.com, seiden@...ux.ibm.com,
        nrb@...ux.ibm.com
Subject: Re: [PATCH v12 2/3] KVM: s390: guest support for topology function

[...]
>>>>>     +/**
>>>>> + * kvm_s390_update_topology_change_report - update CPU topology change report
>>>>> + * @kvm: guest KVM description
>>>>> + * @val: set or clear the MTCR bit
>>>>> + *
>>>>> + * Updates the Multiprocessor Topology-Change-Report bit to signal
>>>>> + * the guest with a topology change.
>>>>> + * This is only relevant if the topology facility is present.
>>>>> + *
>>>>> + * The SCA version, bsca or esca, doesn't matter as offset is the same.
>>>>> + */
>>>>> +static void kvm_s390_update_topology_change_report(struct kvm *kvm, bool val)
>>>>> +{
>>>>> +    union sca_utility new, old;
>>>>> +    struct bsca_block *sca;
>>>>> +
>>>>> +    read_lock(&kvm->arch.sca_lock);
>>>>> +    do {
>>>>> +        sca = kvm->arch.sca;
>>>>
>>>> I find this assignment being in the loop unintuitive, but it should not make a difference.
>>>
>>> The price would be an ugly cast.
>>
>> I don't get what you mean. Nothing about the types changes if you move it before the loop.
> 
> Yes right, did wrong understand.
> It is better before.
With the assignment moved one line up:
Reviewed-by: Janosch Frank <frankja@...ux.ibm.com>

> 
>>>
>>>
>>>>
>>>>> +        old = READ_ONCE(sca->utility);
>>>>> +        new = old;
>>>>> +        new.mtcr = val;
>>>>> +    } while (cmpxchg(&sca->utility.val, old.val, new.val) != old.val);
>>>>> +    read_unlock(&kvm->arch.sca_lock);
>>>>> +}
>>>>> +
>>>> [...]
>>>>
>>>
>>>
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ