[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tci: Optimize saving of TCG code address
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCH] tci: Optimize saving of TCG code address |
Date: |
Tue, 29 Apr 2014 19:33:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
Am 29.04.2014 17:20, schrieb Richard Henderson:
> On 04/28/2014 10:57 PM, Stefan Weil wrote:
>> -static tcg_target_ulong tci_reg[TCG_TARGET_NB_REGS];
>> +static inline void save_tb_ptr(void *tb_ptr)
>> +{
>> +#ifdef CONFIG_SOFTMMU
>> + tci_tb_ptr = (uintptr_t)tb_ptr;
>> +#endif
>> +}
>>
>
> Wouldn't it be better to save this always?
>
> I'm a bit confused about how the SIGSEGV path works with TCI (not at all?),
> but
> I have trouble believing that it ever could work without having this value
> available.
>
>
> r~
>
Hi,
I'm still investigating whether it's necessary to set tci_tb_ptr to 0
(as you suggested). Up to now, the TCI code did never invalidate
tci_tb_ptr, but there was no obvious indication of problems caused by
this behaviour.
The new function save_tb_ptr() is only used for the opcodes which call
helper_{ld,st}*_mmu. Those calls are only compiled for CONFIG_SOFTMMU,
so there is no need to save tci_tb_ptr if that macro is undefined. The
user mode emulation (which does not set CONFIG_SOFTMMU) is faster like that.
For the op_call opcode, tci_tb_ptr is set unconditionally.
Regards
Stefan