[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C8C946C.80106@redhat.com>
Date: Sun, 12 Sep 2010 10:50:52 +0200
From: Avi Kivity <avi@...hat.com>
To: Joerg Roedel <joerg.roedel@....com>
CC: Marcelo Tosatti <mtosatti@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 18/29] KVM: MMU: Propagate the right fault back to the
guest after gva_to_gpa
On 09/10/2010 06:30 PM, Joerg Roedel wrote:
> This patch implements logic to make sure that either a
> page-fault/page-fault-vmexit or a nested-page-fault-vmexit
> is propagated back to the guest.
>
> @@ -338,6 +338,22 @@ void kvm_inject_page_fault(struct kvm_vcpu *vcpu)
> kvm_queue_exception_e(vcpu, PF_VECTOR, error_code);
> }
>
> +void kvm_propagate_fault(struct kvm_vcpu *vcpu)
> +{
> + u32 nested, error;
> +
> + error = vcpu->arch.fault.error_code;
> + nested = error& PFERR_NESTED_MASK;
> + error = error& ~PFERR_NESTED_MASK;
> +
> + vcpu->arch.fault.error_code = error;
> +
> + if (mmu_is_nested(vcpu)&& !nested)
> + vcpu->arch.nested_mmu.inject_page_fault(vcpu);
> + else
> + vcpu->arch.mmu.inject_page_fault(vcpu);
> +}
> +
Tacking a non-architectural bit on top of the error code is not very
nice. Can you move it to a separate vcpu->arch.fault.nested?
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists