2015-04-03 12:20:09

by Radim Krčmář

[permalink] [raw]
Subject: Re: [PATCH] kvm: x86: svm: remove SVM_EXIT_READ_CR* intercepts

2015-03-12 17:17-0400, Bandan Das:
> Joel Schopp <[email protected]> writes:
> > @@ -2968,29 +2964,10 @@ static int cr_interception(struct vcpu_svm *svm)
> > kvm_queue_exception(&svm->vcpu, UD_VECTOR);
> > return 1;
> > }
> > - } else { /* mov from cr */
> > - [reads of CR 0..8]
> > + } else { /* mov from cr, should never trap in svm */
> > + WARN(1, "unhandled read from CR%d", cr);
> > + kvm_queue_exception(&svm->vcpu, UD_VECTOR);
> > + return 1;
>
> Can we end up here if a nested hypervisor sets cr read interception ?

No. If the nested hypervisor sets intercept bits, we're going to detect
them in 'handle_exit -> nested_svm_exit_handled -> nested_svm_intercept'
and enter L1 before the cr_interception handler.