Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698174 > unrolled thread

Re: [PATCH v2 1/3] kvm: svm: Add support for additional SVM NPF error codes

Started byPaolo Bonzini <pbonzini@redhat.com>
First post2017-07-27 18:40 +0200
Last post2017-07-27 18:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/3] kvm: svm: Add support for additional SVM NPF error  codes Paolo Bonzini <pbonzini@redhat.com> - 2017-07-27 18:40 +0200

#1698174 — Re: [PATCH v2 1/3] kvm: svm: Add support for additional SVM NPF error codes

FromPaolo Bonzini <pbonzini@redhat.com>
Date2017-07-27 18:40 +0200
SubjectRe: [PATCH v2 1/3] kvm: svm: Add support for additional SVM NPF error codes
Message-ID<u7TZn-8rK-1@gated-at.bofh.it>
On 23/11/2016 18:01, Brijesh Singh wrote:
>  
> +	/*
> +	 * Before emulating the instruction, check if the error code
> +	 * was due to a RO violation while translating the guest page.
> +	 * This can occur when using nested virtualization with nested
> +	 * paging in both guests. If true, we simply unprotect the page
> +	 * and resume the guest.
> +	 *
> +	 * Note: AMD only (since it supports the PFERR_GUEST_PAGE_MASK used
> +	 *       in PFERR_NEXT_GUEST_PAGE)
> +	 */
> +	if (error_code == PFERR_NESTED_GUEST_PAGE) {
> +		kvm_mmu_unprotect_page(vcpu->kvm, gpa_to_gfn(cr2));
> +		return 1;
> +	}


What happens if L1 is mapping some memory that is read only in L0?  That
is, the L1 nested page tables make it read-write, but the L0 shadow
nested page tables make it read-only.

Accessing it would cause an NPF, and then my guess is that the L1 guest
would loop on the failing instruction instead of just dropping the write.

Paolo

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web