qom/cpu: Add copy method
Add a copy method to the QOM CPUClass, which creates a
new CPU object as a copy of an existing one. This replaces
the direct call to cpu_copy() made in linux-user when
handling creating a new pthread; the motivation is to
allow target-specific CPU subclasses to override the
copy method if there is something in their CPUState which
cannot be handled with a shallow copy.
In particular we will use this to avoid leaking the
hashtable used for ARM's new cp15 implementation.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
19 files changed