lkml.org 
[lkml]   [2021]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: X86: Don't reset dr6 unconditionally when the vcpu being scheduled out
From
Date
On 09/08/21 18:54, Sean Christopherson wrote:
> Not directly related to this patch, but why does KVM_DEBUGREG_RELOAD exist?
> Commit ae561edeb421 ("KVM: x86: DR0-DR3 are not clear on reset") added it to
> ensure DR0-3 are fresh when they're modified through non-standard paths, but I
> don't see any reason why the new values_must_ be loaded into hardware. eff_db
> needs to be updated, but I don't see why hardware DRs need to be updated unless
> hardware breakpoints are active or DR exiting is disabled, and in those cases
> updating hardware is handled by KVM_DEBUGREG_WONT_EXIT and KVM_DEBUGREG_BP_ENABLED.

The original implementation of KVM_DEBUGREG_WONT_EXIT (by yours truly)
had a bug where it did not call kvm_update_dr7 and thus
KVM_DEBUGREG_BP_ENABLED was not set correctly. I agree that commit
70e4da7a8ff6 ("KVM: x86: fix root cause for missed hardware
breakpoints") should have gotten rid of KVM_DEBUGREG_RELOAD altogether.


Paolo

\
 
 \ /
  Last update: 2021-08-10 12:00    [W:0.073 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site