lkml.org 
[lkml]   [2014]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] KVM: vmx: Allow the guest to run with dirty debug registers
Il 09/03/2014 19:26, Radim Krčmář ha scritto:
> > +
> > + cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> > + cpu_based_vm_exec_control &= ~CPU_BASED_MOV_DR_EXITING;
> > + vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
>
> vmcs_clear_bits() covers exactly this use-case.
> (Barring the explicit bit-width.)

Good idea.

> > +
> > + /*
> > + * No more DR vmexits; force a reload of the debug registers
> > + * and reenter on this instruction. The next vmexit will
> > + * retrieve the full state of the debug registers.
> > + */
> > + vcpu->arch.switch_db_regs |= KVM_DEBUGREG_WONT_EXIT;
> > + return 1;
> > + }
> > +
>
> We could make the code slighly uglier and move the functional part of
> this block before the previous one, so it would do both things in one
> exit.

I considered this, but decided that it's unlikely for emulation to be
faster than hardware---especially on those AMD CPUs that lack decode
assists (and it's good for VMX and SVM code to look as similar as possible).

> (Exception handler will likely access DR too.)

Which exception handler?

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-03-09 21:21    [W:0.087 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site