lkml.org 
[lkml]   [2015]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: svm: don't intercept CR0 TS or MP bit write
2015-02-24 15:25-0600, Joel Schopp:
>
> >> - clr_cr_intercept(svm, INTERCEPT_CR0_WRITE);
> >> } else {
> >> set_cr_intercept(svm, INTERCEPT_CR0_READ);
> > (There is no point in checking fpu_active if cr0s are equal.)
> >
> >> - set_cr_intercept(svm, INTERCEPT_CR0_WRITE);
> > KVM uses lazy FPU and the state is undefined before the first access.
> > We set cr0.ts when !svm->vcpu.fpu_active to detect the first access, but
> > if we allow the guest to clear cr0.ts without exiting, it can access FPU
> > with undefined state.
> Thanks for the valuable feedback. It's apparent I hadn't thought
> through the interaction with lazy FPU and will need to go back and
> rethink my approach here.

I don't think we can gain much without sacrificing some laziness, like:
when a guest with lazy FPU clears CR0.TS, it is going to use that FPU,
so we could pre-load FPU in this case and drop the write intercept too;
guests that unconditionally clear CR0.TS would perform worse though.

It's going to take a lot of time, but two hunks in your patch, that made
selective intercept benefit from decode assists, look useful even now.

Would you post them separately?

Thanks.


\
 
 \ /
  Last update: 2015-02-25 22:01    [W:0.104 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site