From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Date: Thu, 14 Mar 2013 12:52:42 +0100 Message-ID: <3B534350-7069-483D-8E36-2E8D42A9F50D@suse.de> References: <1362024796-4237-1-git-send-email-bharat.bhushan@freescale.com> <1362024796-4237-5-git-send-email-bharat.bhushan@freescale.com> <3EA369E7-4A07-4719-A688-B9EF4712ED4D@suse.de> <6A3DF150A5B70D4F9B66A25E3F7C888D065EBACB@039-SN2MPN1-023.039d.mgd.msft.net> Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" , Wood Scott-B07421 To: Bhushan Bharat-R65777 Return-path: In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D065EBACB@039-SN2MPN1-023.039d.mgd.msft.net> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 14.03.2013, at 05:50, Bhushan Bharat-R65777 wrote: > > >> -----Original Message----- >> From: Alexander Graf [mailto:agraf@suse.de] >> Sent: Thursday, March 07, 2013 6:56 PM >> To: Bhushan Bharat-R65777 >> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; 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. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Thu, 14 Mar 2013 11:52:42 +0000 Subject: Re: [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Message-Id: <3B534350-7069-483D-8E36-2E8D42A9F50D@suse.de> List-Id: References: <1362024796-4237-1-git-send-email-bharat.bhushan@freescale.com> <1362024796-4237-5-git-send-email-bharat.bhushan@freescale.com> <3EA369E7-4A07-4719-A688-B9EF4712ED4D@suse.de> <6A3DF150A5B70D4F9B66A25E3F7C888D065EBACB@039-SN2MPN1-023.039d.mgd.msft.net> In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D065EBACB@039-SN2MPN1-023.039d.mgd.msft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bhushan Bharat-R65777 Cc: "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" , Wood Scott-B07421 On 14.03.2013, at 05:50, Bhushan Bharat-R65777 wrote: > > >> -----Original Message----- >> From: Alexander Graf [mailto:agraf@suse.de] >> Sent: Thursday, March 07, 2013 6:56 PM >> To: Bhushan Bharat-R65777 >> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; 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. Alex