From: Alexander Graf <agraf@suse.de>
To: "Bharat.Bhushan@freescale.com" <Bharat.Bhushan@freescale.com>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/3 v2] ppc debug: Add debug stub support
Date: Tue, 24 Jun 2014 13:34:04 +0200 [thread overview]
Message-ID: <53A9622C.8010403@suse.de> (raw)
In-Reply-To: <bb2c0ed2802a4224b526131238de12c6@BLUPR03MB566.namprd03.prod.outlook.com>
On 24.06.14 13:32, Bharat.Bhushan@freescale.com wrote:
>
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Tuesday, June 24, 2014 5:02 PM
>> To: Bhushan Bharat-R65777; qemu-ppc@nongnu.org; qemu-devel@nongnu.org
>> Subject: Re: [PATCH 3/3 v2] ppc debug: Add debug stub support
>>
>>
>> On 18.06.14 06:39, Bharat.Bhushan@freescale.com wrote:
>>>> -----Original Message-----
>>>> From: Alexander Graf [mailto:agraf@suse.de]
>>>> Sent: Tuesday, June 17, 2014 4:14 PM
>>>> To: Bhushan Bharat-R65777; qemu-ppc@nongnu.org; qemu-devel@nongnu.org
>>>> Subject: Re: [PATCH 3/3 v2] ppc debug: Add debug stub support
>>>>
>>>>
>>>> On 17.06.14 12:40, Bharat.Bhushan@freescale.com wrote:
>>>>>> -----Original Message-----
>>>>>> From: Alexander Graf [mailto:agraf@suse.de]
>>>>>> Sent: Tuesday, June 17, 2014 3:20 PM
>>>>>> To: Bhushan Bharat-R65777; qemu-ppc@nongnu.org;
>>>>>> qemu-devel@nongnu.org
>>>>>> Subject: Re: [PATCH 3/3 v2] ppc debug: Add debug stub support
>>>>>>
>>>>>>
>>>>>> On 17.06.14 11:14, Bharat.Bhushan@freescale.com wrote:
>>>>>>>> -----Original Message-----
>>>>>>>> From: Alexander Graf [mailto:agraf@suse.de]
>>>>>>>> Sent: Tuesday, June 17, 2014 1:46 PM
>>>>>>>> To: Bhushan Bharat-R65777; qemu-ppc@nongnu.org;
>>>>>>>> qemu-devel@nongnu.org
>>>>>>>> Subject: Re: [PATCH 3/3 v2] ppc debug: Add debug stub support
>>>>>>>>
>>>>>>>>
>>>>>>>> On 17.06.14 09:08, Bharat Bhushan wrote:
>>>>>>>>> This patch adds software breakpoint, hardware breakpoint and
>>>>>>>>> hardware watchpoint support for ppc. If the debug interrupt is
>>>>>>>>> not handled then this is injected to guest.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
>>>>>>>>> ---
>>>>>>>>> v1->v2:
>>>>>>>>> - factored out e500 specific code based on exception model
>>>>>>>> POWERPC_EXCP_BOOKE.
>>>>>>>>> - Not supporting ppc440
>>>>>>>>>
>>>>>>>>> hw/ppc/e500.c | 3 +
>>>>>>>>> target-ppc/kvm.c | 355
>>>>>> ++++++++++++++++++++++++++++++++++++++++++++++---
>>>>>>>> --
>>>>>>>>> target-ppc/kvm_ppc.h | 1 +
>>>>>>>>> 3 files changed, 330 insertions(+), 29 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index
>>>>>>>>> a973c18..47caa84
>>>>>>>>> 100644
>>>>>>>>> --- a/hw/ppc/e500.c
>>>>>>>>> +++ b/hw/ppc/e500.c
>>>>>>>>> @@ -853,6 +853,9 @@ void ppce500_init(MachineState *machine,
>>>>>>>>> PPCE500Params
>>>>>>>> *params)
>>>>>>>>> if (kvm_enabled()) {
>>>>>>>>> kvmppc_init();
>>>>>>>>> }
>>>>>>>>> +
>>>>>>>>> + /* E500 supports 2 h/w breakpoints and 2 watchpoints */
>>>>>>>>> + kvmppc_hw_breakpoint_init(2, 2);
>>>>>>>> This does not belong into the machine file.
>>>>>>> What about calling this from init_proc_e500() in
>>>>>>> target-ppc/translate_init.c
>>>> ?
>>>>>> I think it makes sense to leave it in KVM land. Why not do it
>>>>>> lazily on insert_hw_breakpoint?
>>>>> You mean setting in kvm_arch_insert_hw_breakpoint() when called
>>>>> first time;
>>>> something like:
>>>>> static bool init = 0;
>>>>>
>>>>> if (!init) {
>>>>> if (env->excp_model == POWERPC_EXCP_BOOKE) {
>>>>> max_hw_breakpoint = 2;
>>>>> max_hw_watchpoint = 2;
>>>>> } else
>>>>> // Add for book3s max_hw_watchpoint = 1;
>>>>> }
>>>>> init = 1;
>>>>> }
>>>> I would probably reuse max_hw_breakpoint as a hint whether it's
>>>> initialized and put all of this into a small function, but yes :).
>>> Ahh, we cannot do this in kvm_arch_insert_hw_breakpoint() as we can not get
>> "env" reference in this function. Prototype of this is:
>>> int kvm_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len,
>>> int type);
>> Just use first_cpu? :)
>>
>>> I will suggest that we initialize this from kvm_arch_init_vcpu(). This way we
>> are still in KVM zone.
>>
>> That works too, yes.
> V3 version of path is based on this :)
Uh, I don't see a v3 yet? :)
Alex
prev parent reply other threads:[~2014-06-24 11:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1402988887-30418-1-git-send-email-Bharat.Bhushan@freescale.com>
[not found] ` <1402988887-30418-4-git-send-email-Bharat.Bhushan@freescale.com>
2014-06-17 8:15 ` [Qemu-devel] [PATCH 3/3 v2] ppc debug: Add debug stub support Alexander Graf
2014-06-17 9:14 ` Bharat.Bhushan
2014-06-17 9:49 ` Alexander Graf
2014-06-17 10:40 ` Bharat.Bhushan
2014-06-17 10:43 ` Alexander Graf
2014-06-17 11:01 ` Bharat.Bhushan
2014-06-17 11:03 ` Alexander Graf
2014-06-17 11:05 ` Bharat.Bhushan
2014-06-17 11:07 ` Alexander Graf
2014-06-18 4:39 ` Bharat.Bhushan
2014-06-24 11:31 ` Alexander Graf
2014-06-24 11:32 ` Bharat.Bhushan
2014-06-24 11:34 ` Alexander Graf [this message]
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=53A9622C.8010403@suse.de \
--to=agraf@suse.de \
--cc=Bharat.Bhushan@freescale.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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.