> >> -----Original Message----- > >> From: Alexander Graf [mailto:agraf@xxxxxxx] > >> Sent: Thursday, March 07, 2013 6:56 PM > >> To: Bhushan Bharat-R65777 > >> Cc: kvm-ppc@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; Wood Scott-B07421; > >> Bhushan > >> Bharat-R65777 > >> Subject: Re: [PATCH 4/7] booke: Save and restore debug registers on > >> guest entry and exit > >> > >> > >> On 28.02.2013, at 05:13, Bharat Bhushan wrote: > >> > >>> On Guest entry: if guest is wants to use the debug register then > >>> save h/w debug register in host_dbg_reg and load the debug registers > >>> with shadow_dbg_reg. Otherwise leave h/w debug registers as is. > >> > >> Why can't we switch the majority of registers on vcpu_put/get and > >> only enable or disable debugging on guest entry/exit? > > > > > > One of the reason for not doing this is that the KVM is a host kernel > > module and let this be debugged by host (I do not this how much useful this is > :)) So I am not able to recall the specific reason, maybe we have just coded > this like this and tried to keep overhead as low as possible by switching > registers only when they are used. > > My point is that the overhead is _higher_ this way, because we need to do checks > and switches on every guest entry/exit, which happens a _lot_ more often than a > host context switch. > > > As we discussed before, we can keep this option open for future. > > What future? Just ignore debug events in the entry/exit code path and suddenly a > lot of the code becomes a lot easier. Just to summarize what we agreed upon: - Save/restore will happen on vcpu_get()/vcpu_put(). This will happen only if guest is using debug registers. Probably using a flag to indicate guest is using debug APU. - On debug register access from QEMU, always set value in h/w debug register. - On guest access of debug register, also save xxx h/w register in vcpu->host_debug_reg.xxx and load guest provided value in h/w debug register, ensure this happen on first access only, probably all debug registers once debug events enabled in dbcr0. Direct access from guest was not part of this patchset and support for this will be done separately. Thanks -Bharat > > > Alex > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html