]> git.proxmox.com Git - mirror_qemu.git/commit - cpu-target.c
cpu: cache CPUClass in CPUState for hot code paths
authorAlex Bennée <alex.bennee@linaro.org>
Fri, 23 Sep 2022 08:47:59 +0000 (10:47 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 4 Oct 2022 03:53:30 +0000 (20:53 -0700)
commit6fbdff870620705042a5b2d87491659487b3f4e2
tree941583f9811b98773d46ceeaa2f56740e602d44c
parentefbf38d73e5dcc4d5f8b98c6e7a12be1f3b91745
cpu: cache CPUClass in CPUState for hot code paths

The class cast checkers are quite expensive and always on (unlike the
dynamic case who's checks are gated by CONFIG_QOM_CAST_DEBUG). To
avoid the overhead of repeatedly checking something which should never
change we cache the CPUClass reference for use in the hot code paths.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220811151413.3350684-3-alex.bennee@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220923084803.498337-3-clg@kaod.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
cpu.c
include/hw/core/cpu.h