From: Zenghui Yu <yuzenghui@huawei.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
<linux-arm-kernel@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<kvmarm@lists.cs.columbia.edu>, <julien.thierry@arm.com>,
<christoffer.dall@arm.com>, <marc.zyngier@arm.com>,
<andrew.murray@arm.com>, <eric.auger@redhat.com>,
<zhengxiang9@huawei.com>, <wanghaibin.wang@huawei.com>
Subject: Re: [PATCH 1/2] kvm: arm: Clean up the checking for huge mapping
Date: Thu, 11 Apr 2019 09:48:33 +0800 [thread overview]
Message-ID: <529f8515-a069-948b-cb63-96fa35b291a6@huawei.com> (raw)
In-Reply-To: <1554909832-7169-2-git-send-email-suzuki.poulose@arm.com>
On 2019/4/10 23:23, Suzuki K Poulose wrote:
> If we are checking whether the stage2 can map PAGE_SIZE,
> we don't have to do the boundary checks as both the host
> VMA and the guest memslots are page aligned. Bail the case
> easily.
>
> Cc: Christoffer Dall <christoffer.dall@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> virt/kvm/arm/mmu.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
> index a39dcfd..6d73322 100644
> --- a/virt/kvm/arm/mmu.c
> +++ b/virt/kvm/arm/mmu.c
> @@ -1624,6 +1624,10 @@ static bool fault_supports_stage2_huge_mapping(struct kvm_memory_slot *memslot,
> hva_t uaddr_start, uaddr_end;
> size_t size;
>
> + /* The memslot and the VMA are guaranteed to be aligned to PAGE_SIZE */
> + if (map_size == PAGE_SIZE)
> + return true;
> +
> size = memslot->npages * PAGE_SIZE;
>
> gpa_start = memslot->base_gfn << PAGE_SHIFT;
>
We can do a comment clean up as well in this patch.
s/<< PAGE_SIZE/<< PAGE_SHIFT/
thanks,
zenghui
next prev parent reply other threads:[~2019-04-11 1:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 15:14 [PATCH v2] kvm: arm: Skip stage2 huge mappings for unaligned ipa backed by THP Suzuki K Poulose
2019-04-10 15:23 ` [PATCH 0/2] kvm: arm: Unify stage2 mapping for THP backed memory Suzuki K Poulose
2019-04-10 15:23 ` [PATCH 1/2] kvm: arm: Clean up the checking for huge mapping Suzuki K Poulose
2019-04-11 1:48 ` Zenghui Yu [this message]
2019-04-11 9:47 ` Suzuki K Poulose
2019-04-10 15:23 ` [PATCH 2/2] kvm: arm: Unify handling THP backed host memory Suzuki K Poulose
2019-04-11 1:59 ` Zenghui Yu
2019-04-11 15:16 ` Suzuki K Poulose
2019-04-12 9:34 ` Zenghui Yu
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=529f8515-a069-948b-cb63-96fa35b291a6@huawei.com \
--to=yuzenghui@huawei.com \
--cc=andrew.murray@arm.com \
--cc=christoffer.dall@arm.com \
--cc=eric.auger@redhat.com \
--cc=julien.thierry@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=wanghaibin.wang@huawei.com \
--cc=zhengxiang9@huawei.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;
as well as URLs for NNTP newsgroup(s).