From 9761ad757182be663fa31af99abad959ac63b17f Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sat, 22 Jun 2013 03:53:35 +0200 Subject: PPC: Introduce an alias cache for faster lookups When running QEMU with "-cpu ?" we walk through every alias for every target CPU we know about. This takes several seconds on my very fast host system. Let's introduce a class object cache in the alias table. Using that we don't have to go through the tedious work of finding our target class. Instead, we can just go directly from the alias name to the target class pointer. This patch brings -cpu "?" to reasonable times again. Before: real 0m4.716s After: real 0m0.025s Signed-off-by: Alexander Graf --- target-ppc/cpu-models.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'target-ppc/cpu-models.h') diff --git a/target-ppc/cpu-models.h b/target-ppc/cpu-models.h index a94f835121..ae8f7c743e 100644 --- a/target-ppc/cpu-models.h +++ b/target-ppc/cpu-models.h @@ -31,9 +31,10 @@ typedef struct PowerPCCPUAlias { const char *alias; const char *model; + ObjectClass *oc; } PowerPCCPUAlias; -extern const PowerPCCPUAlias ppc_cpu_aliases[]; +extern PowerPCCPUAlias ppc_cpu_aliases[]; /*****************************************************************************/ /* PVR definitions for most known PowerPC */ -- cgit v1.2.1