From: Gavin Shan <gshan@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu
Cc: maz@kernel.org
Subject: Re: [PATCH 1/2] KVM: arm64: Update page shift if stage 2 block mapping not supported
Date: Wed, 2 Sep 2020 10:57:20 +1000 [thread overview]
Message-ID: <99cba8bb-65bf-ee95-5bb9-fb084491acdb@redhat.com> (raw)
In-Reply-To: <20200901133357.52640-2-alexandru.elisei@arm.com>
On 9/1/20 11:33 PM, Alexandru Elisei wrote:
> Commit 196f878a7ac2e (" KVM: arm/arm64: Signal SIGBUS when stage2 discovers
> hwpoison memory") modifies user_mem_abort() to send a SIGBUS signal when
> the fault IPA maps to a hwpoisoned page. Commit 1559b7583ff6 ("KVM:
> arm/arm64: Re-check VMA on detecting a poisoned page") changed
> kvm_send_hwpoison_signal() to use the page shift instead of the VMA because
> at that point the code had already released the mmap lock, which means
> userspace could have modified the VMA.
>
> If userspace uses hugetlbfs for the VM memory, user_mem_abort() tries to
> map the guest fault IPA using block mappings in stage 2. That is not always
> possible, if, for example, userspace uses dirty page logging for the VM.
> Update the page shift appropriately in those cases when we downgrade the
> stage 2 entry from a block mapping to a page.
>
> Fixes: 1559b7583ff6 ("KVM: arm/arm64: Re-check VMA on detecting a poisoned page")
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
Reviewed-by: Gavin Shan <gshan@redhat.com>
> arch/arm64/kvm/mmu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index ba00bcc0c884..25e7dc52c086 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -1877,6 +1877,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> !fault_supports_stage2_huge_mapping(memslot, hva, vma_pagesize)) {
> force_pte = true;
> vma_pagesize = PAGE_SIZE;
> + vma_shift = PAGE_SHIFT;
> }
>
> /*
>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2020-09-02 0:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 13:33 [PATCH 0/2] KVM: arm64: user_mem_abort() improvements Alexandru Elisei
2020-09-01 13:33 ` [PATCH 1/2] KVM: arm64: Update page shift if stage 2 block mapping not supported Alexandru Elisei
2020-09-02 0:57 ` Gavin Shan [this message]
2020-09-01 13:33 ` [PATCH 2/2] KVM: arm64: Try PMD block mappings if PUD mappings are " Alexandru Elisei
2020-09-02 1:23 ` Gavin Shan
2020-09-02 9:01 ` Alexandru Elisei
2020-09-03 0:06 ` Gavin Shan
2020-09-04 9:58 ` Marc Zyngier
2020-09-08 12:23 ` Alexandru Elisei
2020-09-08 12:41 ` Marc Zyngier
2020-09-04 10:18 ` [PATCH 0/2] KVM: arm64: user_mem_abort() improvements Marc Zyngier
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=99cba8bb-65bf-ee95-5bb9-fb084491acdb@redhat.com \
--to=gshan@redhat.com \
--cc=alexandru.elisei@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
/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).