diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2016-10-05 13:09:33 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2016-10-06 11:47:05 +0100 |
commit | a6a198bc60e6c980a56eca24d33dc7f29139f8ea (patch) | |
tree | e2a4adc45aabc5a1cc0e5529166ab9ca15cd7fee /drivers/xen/manage.c | |
parent | 565fdc6a2afeb14e654a8d9ebc792afb9d2c0019 (diff) | |
download | linux-stable-a6a198bc60e6c980a56eca24d33dc7f29139f8ea.tar.gz linux-stable-a6a198bc60e6c980a56eca24d33dc7f29139f8ea.tar.bz2 linux-stable-a6a198bc60e6c980a56eca24d33dc7f29139f8ea.zip |
xen/x86: Update topology map for PV VCPUs
Early during boot topology_update_package_map() computes
logical_pkg_ids for all present processors.
Later, when processors are brought up, identify_cpu() updates
these values based on phys_pkg_id which is a function of
initial_apicid. On PV guests the latter may point to a
non-existing node, causing logical_pkg_ids to be set to -1.
Intel's RAPL uses logical_pkg_id (as topology_logical_package_id())
to index its arrays and therefore in this case will point to index
65535 (since logical_pkg_id is a u16). This could lead to either a
crash or may actually access random memory location.
As a workaround, we recompute topology during CPU bringup to reset
logical_pkg_id to a valid value.
(The reason for initial_apicid being bogus is because it is
initial_apicid of the processor from which the guest is launched.
This value is CPUID(1).EBX[31:24])
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/manage.c')
0 files changed, 0 insertions, 0 deletions