public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Janis Schoetterl-Glausch <scgl@linux.vnet.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>,
	Janis Schoetterl-Glausch <scgl@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: s390: gaccess: Refactor access address range check
Date: Fri, 19 Nov 2021 11:01:59 +0100	[thread overview]
Message-ID: <075d5505-33aa-3354-4ac0-4545dd51fc56@linux.vnet.ibm.com> (raw)
In-Reply-To: <c0f5143c-24cd-e40b-f797-23d67a22c2c6@linux.ibm.com>

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@linux.ibm.com>
> 
> Reviewed-by: Janosch Frank <frankja@linux.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


  reply	other threads:[~2021-11-19 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 13:55 [PATCH v2 0/3] KVM: s390: Some gaccess cleanup Janis Schoetterl-Glausch
2021-10-28 13:55 ` [PATCH v2 1/3] KVM: s390: gaccess: Refactor gpa and length calculation Janis Schoetterl-Glausch
2021-11-19  8:27   ` Janosch Frank
2021-11-23 12:38   ` Janosch Frank
2021-10-28 13:55 ` [PATCH v2] KVM: s390: gaccess: Refactor access address range check Janis Schoetterl-Glausch
2021-11-19  8:56   ` Janosch Frank
2021-11-19 10:01     ` Janis Schoetterl-Glausch [this message]
2021-10-28 13:55 ` [PATCH v2 3/3] KVM: s390: gaccess: Cleanup access to guest frames Janis Schoetterl-Glausch
2021-10-28 14:25   ` David Hildenbrand
2021-10-28 14:48     ` Janis Schoetterl-Glausch
2021-11-19  9:00       ` Janosch Frank
2021-11-22 11:13         ` David Hildenbrand
2021-11-23 12:39 ` [PATCH v2 0/3] KVM: s390: Some gaccess cleanup Janosch Frank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=075d5505-33aa-3354-4ac0-4545dd51fc56@linux.vnet.ibm.com \
    --to=scgl@linux.vnet.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=scgl@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox