mirror of https://github.com/xemu-project/xemu.git
hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
This is a heavily used function so lets avoid the cost of CPU_GET_CLASS. On the romulus-bmc run it has a modest effect: Before: 36.812 s ± 0.506 s After: 35.912 s ± 0.168 s Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220811151413.3350684-4-alex.bennee@linaro.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20220923084803.498337-4-clg@kaod.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
6fbdff8706
commit
b404ca370e
|
@ -69,11 +69,10 @@ hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr addr)
|
||||||
|
|
||||||
int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
|
int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
|
||||||
{
|
{
|
||||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (cc->sysemu_ops->asidx_from_attrs) {
|
if (cpu->cc->sysemu_ops->asidx_from_attrs) {
|
||||||
ret = cc->sysemu_ops->asidx_from_attrs(cpu, attrs);
|
ret = cpu->cc->sysemu_ops->asidx_from_attrs(cpu, attrs);
|
||||||
assert(ret < cpu->num_ases && ret >= 0);
|
assert(ret < cpu->num_ases && ret >= 0);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue