* ARM KVM guest virtual address to host virtual address Look up
@ 2016-01-15 9:33 hiwu
2016-01-15 10:02 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: hiwu @ 2016-01-15 9:33 UTC (permalink / raw)
To: kvmarm
Hi:
How to lookup host virtual address by guest virtual address ?
Is there any function to do guest page table walk?
Thank you
-Jack
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ARM KVM guest virtual address to host virtual address Look up
2016-01-15 9:33 ARM KVM guest virtual address to host virtual address Look up hiwu
@ 2016-01-15 10:02 ` Peter Maydell
2016-01-15 11:14 ` hiwu
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2016-01-15 10:02 UTC (permalink / raw)
To: hiwu; +Cc: kvmarm@lists.cs.columbia.edu
On 15 January 2016 at 09:33, <hiwu@derytech.com.tw> wrote:
> How to lookup host virtual address by guest virtual address ?
> Is there any function to do guest page table walk?
There is no single function to do this (depending on what
bit of QEMU this is, we might either try a TLB access to
see if we can get guest-virtual to host-virtual, with a
slow-path fallback for TLB misses, or we might do guest
virtual to guest physical and then look up whether that
is RAM or a device and behave accordingly). What are you
actually trying to do?
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ARM KVM guest virtual address to host virtual address Look up
2016-01-15 10:02 ` Peter Maydell
@ 2016-01-15 11:14 ` hiwu
2016-01-15 12:17 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: hiwu @ 2016-01-15 11:14 UTC (permalink / raw)
To: Peter Maydell; +Cc: kvmarm@lists.cs.columbia.edu
[-- Attachment #1.1: Type: text/plain, Size: 1065 bytes --]
Hi Peter:
I want to trap some ldr,str instruction in guest VM for debug. Therefore, I have to emulate guest ldr,str in host. Without guest VA to host VA, I cannot emulate ldr,str instruction in host.
Thank you
-Jack
-------- 原始郵件 --------
寄件者:Peter Maydell <peter.maydell@linaro.org>
傳送日期:Fri, 15 Jan 2016 18:02:23 +0800
收件者:hiwu@derytech.com.tw
副本:kvmarm@lists.cs.columbia.edu
主旨:Re: ARM KVM guest virtual address to host virtual address Look up
>On 15 January 2016 at 09:33, <hiwu@derytech.com.tw> wrote:
>> How to lookup host virtual address by guest virtual address ?
>> Is there any function to do guest page table walk?
>
>There is no single function to do this (depending on what
>bit of QEMU this is, we might either try a TLB access to
>see if we can get guest-virtual to host-virtual, with a
>slow-path fallback for TLB misses, or we might do guest
>virtual to guest physical and then look up whether that
>is RAM or a device and behave accordingly). What are you
>actually trying to do?
>
>thanks
>-- PMM
[-- Attachment #1.2: Type: text/html, Size: 1232 bytes --]
[-- Attachment #2: Type: text/plain, Size: 151 bytes --]
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ARM KVM guest virtual address to host virtual address Look up
2016-01-15 11:14 ` hiwu
@ 2016-01-15 12:17 ` Peter Maydell
2016-01-15 15:35 ` hiwu
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2016-01-15 12:17 UTC (permalink / raw)
To: hiwu; +Cc: kvmarm@lists.cs.columbia.edu
On 15 January 2016 at 11:14, hiwu <hiwu@derytech.com.tw> wrote:
> I want to trap some ldr,str instruction in guest VM for debug. Therefore, I
> have to emulate guest ldr,str in host. Without guest VA to host VA, I cannot
> emulate ldr,str instruction in host.
That sounds like you want "load/store value from guest VA", not "translate
guest VA to host VA". Try cpu_ldl_data and friends (though note that
if you use them to access an invalid address they'll cause a guest
exception).
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ARM KVM guest virtual address to host virtual address Look up
2016-01-15 12:17 ` Peter Maydell
@ 2016-01-15 15:35 ` hiwu
2016-01-15 15:38 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: hiwu @ 2016-01-15 15:35 UTC (permalink / raw)
To: Peter Maydell; +Cc: kvmarm@lists.cs.columbia.edu
Hi Peter:
The guest's load/store instructions, which I want to debug, do not cause
a guest exception.
ARM KVM only provides the guest' r15 register (pc) value. To get the
guest instruction for
emulating in host, "translate guest VA to host VA" is required. How to
implement
"translate guest VA to host VA" in host ?
Thank you
-Jack
Peter Maydell 於 2016/1/15 下午 08:17 寫道:
> On 15 January 2016 at 11:14, hiwu <hiwu@derytech.com.tw> wrote:
>> I want to trap some ldr,str instruction in guest VM for debug. Therefore, I
>> have to emulate guest ldr,str in host. Without guest VA to host VA, I cannot
>> emulate ldr,str instruction in host.
> That sounds like you want "load/store value from guest VA", not "translate
> guest VA to host VA". Try cpu_ldl_data and friends (though note that
> if you use them to access an invalid address they'll cause a guest
> exception).
>
> thanks
> -- PMM
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ARM KVM guest virtual address to host virtual address Look up
2016-01-15 15:35 ` hiwu
@ 2016-01-15 15:38 ` Peter Maydell
0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2016-01-15 15:38 UTC (permalink / raw)
To: hiwu; +Cc: kvmarm@lists.cs.columbia.edu
On 15 January 2016 at 15:35, hiwu <hiwu@derytech.com.tw> wrote:
> Hi Peter:
>
> The guest's load/store instructions, which I want to debug, do not cause a
> guest exception.
> ARM KVM only provides the guest' r15 register (pc) value. To get the guest
> instruction for
> emulating in host, "translate guest VA to host VA" is required. How to
> implement
> "translate guest VA to host VA" in host ?
It occurs to me that I've been assuming you're doing this in
userspace in QEMU, but are you doing this in the kernel itself?
(If so, my previous answers are not relevant.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-15 15:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 9:33 ARM KVM guest virtual address to host virtual address Look up hiwu
2016-01-15 10:02 ` Peter Maydell
2016-01-15 11:14 ` hiwu
2016-01-15 12:17 ` Peter Maydell
2016-01-15 15:35 ` hiwu
2016-01-15 15:38 ` Peter Maydell
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.