]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/domain: Optimise the order of actions in arch_domain_create()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 8 Mar 2018 17:25:29 +0000 (17:25 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Mar 2018 11:22:40 +0000 (11:22 +0000)
commit40ac76a6789a18629b6e66373f766af62466317d
tree0d9ff770ec0effdabf405ea273d33579aebb4b8e
parenta4ce1ae4d018dc6f2716c4c9f3383e7a9f4d9183
x86/domain: Optimise the order of actions in arch_domain_create()

The only relevent initialisation for the idle domain is the context switch and
poisoned pointers.  Collect these bits together early in the function and exit
when complete (although as a consequence, the e820 and vtsc lock
initialisation are moved forwards).  This allows us to remove subsequent
is_idle_domain() checks and unindent most of the logic.

Furthermore, we no longer call these functions for the idle domain:
 * mapcache_domain_init() and tsc_set_info() were previously guarded against
   the idle domain, and have had their guards turned into ASSERT()s.
 * pit_init() is implicitly guarded by has_vpit().
 * psr_domain_init() no longer allocates a socket array.

Finally, two changes are introduced for the benefit of the following patch:
 * For PV hardware domains, or XEN_X86_EMU_PIT into emflags rather than into
   config->emulation_flags, to facilitating config becoming const.
 * References to domcr_flags are moved until after the idle early exist, to
   facilitiate them being unavailable for system domains.

No practical change in behaviour.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/domain_page.c
xen/arch/x86/time.c