All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhushan Bharat-R65777 <R65777@freescale.com>
To: Alexander Graf <agraf@suse.de>, Wood Scott-B07421 <B07421@freescale.com>
Cc: "kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: RE: [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit
Date: Thu, 14 Mar 2013 14:44:19 +0000	[thread overview]
Message-ID: <6A3DF150A5B70D4F9B66A25E3F7C888D065EC8EF@039-SN2MPN1-023.039d.mgd.msft.net> (raw)
In-Reply-To: <3B534350-7069-483D-8E36-2E8D42A9F50D@suse.de>

> >> -----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.

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
> 

  reply	other threads:[~2013-03-14 14:44 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  4:13 [PATCH 0/7] KVM :PPC: Userspace Debug support Bharat Bhushan
2013-02-28  4:25 ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 1/7] KVM: PPC: booke: Added debug handler Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 14:02   ` Alexander Graf
2013-03-07 14:02     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 2/7] Added ONE_REG interface for debug instruction Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:23   ` Scott Wood
2013-02-28 16:23     ` Scott Wood
2013-02-28 16:52     ` Alexander Graf
2013-02-28 16:52       ` Alexander Graf
2013-03-01  5:28       ` Bhushan Bharat-R65777
2013-03-01  5:28         ` Bhushan Bharat-R65777
2013-03-07 13:07   ` Alexander Graf
2013-03-07 13:07     ` Alexander Graf
2013-03-14  4:30     ` Bhushan Bharat-R65777
2013-03-14 11:56       ` Alexander Graf
2013-03-14 11:56         ` Alexander Graf
2013-02-28  4:13 ` [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:20   ` Alexander Graf
2013-03-07 13:20     ` Alexander Graf
2013-03-14  4:42     ` Bhushan Bharat-R65777
2013-03-14 11:54       ` Alexander Graf
2013-03-14 11:54         ` Alexander Graf
2013-03-14 11:57         ` Jan Kiszka
2013-03-14 11:57           ` Jan Kiszka
2013-03-14 12:09           ` Alexander Graf
2013-03-14 12:09             ` Alexander Graf
2013-03-14 12:13             ` Jan Kiszka
2013-03-14 12:13               ` Jan Kiszka
2013-03-14 12:19               ` Alexander Graf
2013-03-14 12:19                 ` Alexander Graf
2013-03-14 12:22                 ` Jan Kiszka
2013-03-14 12:22                   ` Jan Kiszka
2013-03-14 12:28                   ` Alexander Graf
2013-03-14 12:28                     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:25   ` Alexander Graf
2013-03-07 13:25     ` Alexander Graf
2013-03-14  4:50     ` Bhushan Bharat-R65777
2013-03-14 11:52       ` Alexander Graf
2013-03-14 11:52         ` Alexander Graf
2013-03-14 14:44         ` Bhushan Bharat-R65777 [this message]
2013-02-28  4:13 ` [PATCH 5/7] bookehv: " Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:31   ` Scott Wood
2013-02-28 16:31     ` Scott Wood
2013-02-28 16:51     ` Alexander Graf
2013-02-28 16:51       ` Alexander Graf
2013-02-28 16:53       ` Scott Wood
2013-02-28 16:53         ` Scott Wood
2013-03-07 10:47         ` Alexander Graf
2013-03-07 10:47           ` Alexander Graf
2013-03-14  5:59           ` Bhushan Bharat-R65777
2013-02-28  4:13 ` [PATCH 7/7] KVM: PPC: Add userspace debug stub support Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:39   ` Alexander Graf
2013-03-07 13:39     ` Alexander Graf
2013-03-14  5:18     ` Bhushan Bharat-R65777
2013-03-14  5:18       ` Bhushan Bharat-R65777
2013-03-14 11:50       ` Alexander Graf
2013-03-14 11:50         ` Alexander Graf
2013-03-14 13:57         ` Bhushan Bharat-R65777
2013-03-14 13:57           ` Bhushan Bharat-R65777
2013-03-14 16:05           ` Scott Wood
2013-03-14 16:05             ` Scott Wood
2013-03-14 16:11             ` Bhushan Bharat-R65777

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6A3DF150A5B70D4F9B66A25E3F7C888D065EC8EF@039-SN2MPN1-023.039d.mgd.msft.net \
    --to=r65777@freescale.com \
    --cc=B07421@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.