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

Anton Johansson via posted 8 patches 1 year, 2 months ago
There is a newer version of this series
[PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Anton Johansson via 1 year, 2 months ago
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 cpu.c                   | 2 +-
 include/exec/exec-all.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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
-- 
2.39.1
Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Richard Henderson 1 year, 2 months ago
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~
Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
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?

Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Richard Henderson 1 year, 2 months ago
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~

Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Alex Bennée 1 year, 2 months ago
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~


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Richard Henderson 1 year, 2 months ago
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~


Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Anton Johansson via 1 year, 2 months ago
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!

-- 
Anton Johansson,
rev.ng Labs Srl.


Re: [PATCH 7/8] cpu: Replace target_ulong with vaddr in tb_invalidate_phys_addr()
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
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!
>