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]
Date:   Fri, 19 Nov 2021 11:01:59 +0100
From:   Janis Schoetterl-Glausch <scgl@...ux.vnet.ibm.com>
To:     Janosch Frank <frankja@...ux.ibm.com>,
        Janis Schoetterl-Glausch <scgl@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>
Cc:     David Hildenbrand <david@...hat.com>,
        Claudio Imbrenda <imbrenda@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        kvm@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] KVM: s390: gaccess: Refactor access address range
 check

On 11/19/21 09:56, Janosch Frank wrote:
> On 10/28/21 15:55, Janis Schoetterl-Glausch wrote:
>> Do not round down the first address to the page boundary, just translate
>> it normally, which gives the value we care about in the first place.
>> Given this, translating a single address is just the special case of
>> translating a range spanning a single page.
>>
>> Make the output optional, so the function can be used to just check a
>> range.
>>
>> Signed-off-by: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>
> 
> Reviewed-by: Janosch Frank <frankja@...ux.ibm.com>
> 
>> ---
>>   arch/s390/kvm/gaccess.c | 122 +++++++++++++++++++++++-----------------
>>   1 file changed, 69 insertions(+), 53 deletions(-)
>>
>> diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
>> index 0d11cea92603..7725dd7566ed 100644
>> --- a/arch/s390/kvm/gaccess.c
>> +++ b/arch/s390/kvm/gaccess.c
>> @@ -794,35 +794,74 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu,
>>       return 1;
>>   }
>>   -static int guest_page_range(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
>> -                unsigned long *pages, unsigned long nr_pages,
>> -                const union asce asce, enum gacc_mode mode)
>> +/**
>> + * guest_range_to_gpas() - Calculate guest physical addresses of page fragments
>> + * covering a logical range
> 
> I'd add an empty line here.

The guide says not to.
https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html :

> Function parameters
> 
> Each function argument should be described in order,immediately following the short function description. Do not leave a blank line between the function description and the arguments, nor between the arguments.

In this case it's a static function, so not a must,
but I'll stick to it anyway.

> Apart from that this is a very nice cleanup.
>>> + * @vcpu: virtual cpu
>> + * @ga: guest address, start of range
>> + * @ar: access register
>> + * @gpas: output argument, may be NULL
>> + * @len: length of range in bytes
>> + * @asce: address-space-control element to use for translation
>> + * @mode: access mode

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ