[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Xtensa misuse of tb_invalidate_phys_page_range()?
From: |
Avi Kivity |
Subject: |
Re: [Qemu-devel] Xtensa misuse of tb_invalidate_phys_page_range()? |
Date: |
Mon, 19 Mar 2012 16:08:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 |
On 03/19/2012 03:51 PM, Max Filippov wrote:
> > void HELPER(wsr_ibreaka)(uint32_t i, uint32_t v)
> > {
> > if (env->sregs[IBREAKENABLE] & (1 << i) && env->sregs[IBREAKA + i]
> > != v) {
> > tb_invalidate_phys_page_range(
> > env->sregs[IBREAKA + i], env->sregs[IBREAKA + i] + 1, 0);
> > tb_invalidate_phys_page_range(v, v + 1, 0);
> > }
> > env->sregs[IBREAKA + i] = v;
> > }
> >
> > tb_invalidate_phys_page_range() expects a virtual address in user mode,
> > and a ram_addr_t in system mode. I'm guessing that v is a virtual address?
>
> Yes, it's a virtual address here, as well as in wsr_lbeg/wsr_lend helpers.
> I made a test for it and it actually fails. I wonder how could it stay
> unnoticed
> that long :()
There are many silent breakages like that, don't worry.
> > This needs to be fixed for system mode if so (and in any case - even if
> > it's a physical address, it needs to be translated to a ram_addr_t).
>
> Sure. Will try to fix it, though it's completely unclear to me now
> how to do it efficiently.
Since I'm rewriting this area, don't worry about efficiency. Let's get
it correct and after the rewrite we can reexamine efficiency.
I imagine you'll need something like breakpoint_invalidate().
--
error compiling committee.c: too many arguments to function