diff mbox series

[7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()

Message ID 20230420212850.20400-8-anjo@rev.ng (mailing list archive)
State New, archived
Headers show
Series Start replacing target_ulong with vaddr | expand

Commit Message

Anton Johansson April 20, 2023, 9:28 p.m. UTC
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 cpu.c                   | 2 +-
 include/exec/exec-all.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Henderson April 23, 2023, 9:14 a.m. UTC | #1
On 4/20/23 22:28, Anton Johansson wrote:
> -void tb_invalidate_phys_addr(target_ulong addr)
> +void tb_invalidate_phys_addr(vaddr addr)

Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
I'm sure we have something more appropriate.


r~
Philippe Mathieu-Daudé April 23, 2023, 5:29 p.m. UTC | #2
On 23/4/23 11:14, Richard Henderson wrote:
> On 4/20/23 22:28, Anton Johansson wrote:
>> -void tb_invalidate_phys_addr(target_ulong addr)
>> +void tb_invalidate_phys_addr(vaddr addr)
> 
> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
> I'm sure we have something more appropriate.

tb_page_addr_t?
Richard Henderson April 23, 2023, 6:46 p.m. UTC | #3
On 4/23/23 18:29, Philippe Mathieu-Daudé wrote:
> On 23/4/23 11:14, Richard Henderson wrote:
>> On 4/20/23 22:28, Anton Johansson wrote:
>>> -void tb_invalidate_phys_addr(target_ulong addr)
>>> +void tb_invalidate_phys_addr(vaddr addr)
>>
>> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
>> I'm sure we have something more appropriate.
> 
> tb_page_addr_t?

No, it isn't a ram_addr_t either (see exec-all.h).
Perhaps just uint64_t.


r~
Alex Bennée April 23, 2023, 7:35 p.m. UTC | #4
Richard Henderson <richard.henderson@linaro.org> writes:

> On 4/23/23 18:29, Philippe Mathieu-Daudé wrote:
>> On 23/4/23 11:14, Richard Henderson wrote:
>>> On 4/20/23 22:28, Anton Johansson wrote:
>>>> -void tb_invalidate_phys_addr(target_ulong addr)
>>>> +void tb_invalidate_phys_addr(vaddr addr)
>>>
>>> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
>>> I'm sure we have something more appropriate.
>> tb_page_addr_t?
>
> No, it isn't a ram_addr_t either (see exec-all.h).
> Perhaps just uint64_t.

Surely hwaddr?

>
>
> r~
Richard Henderson April 23, 2023, 7:42 p.m. UTC | #5
On 4/23/23 20:35, Alex Bennée wrote:
> 
> Richard Henderson <richard.henderson@linaro.org> writes:
> 
>> On 4/23/23 18:29, Philippe Mathieu-Daudé wrote:
>>> On 23/4/23 11:14, Richard Henderson wrote:
>>>> On 4/20/23 22:28, Anton Johansson wrote:
>>>>> -void tb_invalidate_phys_addr(target_ulong addr)
>>>>> +void tb_invalidate_phys_addr(vaddr addr)
>>>>
>>>> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
>>>> I'm sure we have something more appropriate.
>>> tb_page_addr_t?
>>
>> No, it isn't a ram_addr_t either (see exec-all.h).
>> Perhaps just uint64_t.
> 
> Surely hwaddr?

Duh.  Thanks,


r~
Zhijian Li (Fujitsu)" via April 24, 2023, 12:52 p.m. UTC | #6
On 4/23/23 21:42, Richard Henderson wrote:
> On 4/23/23 20:35, Alex Bennée wrote:
>>
>> Richard Henderson <richard.henderson@linaro.org> writes:
>>
>>> On 4/23/23 18:29, Philippe Mathieu-Daudé wrote:
>>>> On 23/4/23 11:14, Richard Henderson wrote:
>>>>> On 4/20/23 22:28, Anton Johansson wrote:
>>>>>> -void tb_invalidate_phys_addr(target_ulong addr)
>>>>>> +void tb_invalidate_phys_addr(vaddr addr)
>>>>>
>>>>> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
>>>>> I'm sure we have something more appropriate.
>>>> tb_page_addr_t?
>>>
>>> No, it isn't a ram_addr_t either (see exec-all.h).
>>> Perhaps just uint64_t.
>>
>> Surely hwaddr?
>
> Duh.  Thanks,

Thanks guys, and hwaddr it shall be!
Philippe Mathieu-Daudé April 24, 2023, 3:19 p.m. UTC | #7
On 24/4/23 14:52, Anton Johansson wrote:
> 
> On 4/23/23 21:42, Richard Henderson wrote:
>> On 4/23/23 20:35, Alex Bennée wrote:
>>>
>>> Richard Henderson <richard.henderson@linaro.org> writes:
>>>
>>>> On 4/23/23 18:29, Philippe Mathieu-Daudé wrote:
>>>>> On 23/4/23 11:14, Richard Henderson wrote:
>>>>>> On 4/20/23 22:28, Anton Johansson wrote:
>>>>>>> -void tb_invalidate_phys_addr(target_ulong addr)
>>>>>>> +void tb_invalidate_phys_addr(vaddr addr)
>>>>>>
>>>>>> Hmm.  This isn't a virtual address, so 'vaddr' isn't right.
>>>>>> I'm sure we have something more appropriate.
>>>>> tb_page_addr_t?
>>>>
>>>> No, it isn't a ram_addr_t either (see exec-all.h).
>>>> Perhaps just uint64_t.
>>>
>>> Surely hwaddr?

But hwaddr is only defined on system emulation...

>>
>> Duh.  Thanks,
> 
> Thanks guys, and hwaddr it shall be!
>
diff mbox series

Patch

diff --git a/cpu.c b/cpu.c
index 849bac062c..c245727ca6 100644
--- a/cpu.c
+++ b/cpu.c
@@ -293,7 +293,7 @@  void list_cpus(const char *optarg)
 }
 
 #if defined(CONFIG_USER_ONLY)
-void tb_invalidate_phys_addr(target_ulong addr)
+void tb_invalidate_phys_addr(vaddr addr)
 {
     mmap_lock();
     tb_invalidate_phys_page(addr);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index c6cb3fcb8a..a00c298e4b 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -673,7 +673,7 @@  uint32_t curr_cflags(CPUState *cpu);
 
 /* TranslationBlock invalidate API */
 #if defined(CONFIG_USER_ONLY)
-void tb_invalidate_phys_addr(target_ulong addr);
+void tb_invalidate_phys_addr(vaddr addr);
 #else
 void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs);
 #endif