| commit | 98b42fd75f48491ba9c8714dbedb7166e6b8ba48 | [log] [tgz] |
|---|---|---|
| author | Colin Downs-Razouk <colindr@google.com> | Wed Jul 13 12:44:41 2022 -0700 |
| committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jul 15 22:23:06 2022 +0000 |
| tree | 860cb02ce8041acf56acb65cd4769eccc3dded63 | |
| parent | 53c7515c3f1d58a736bb0fba727693264549c5ac [diff] |
devices: tsc: calibrate handle offline cores If a core is offline, we will not be able to set the cpu affinity to that core. The TSC calibration code attempts to determine the TSC offset of all cores. Determining which cores are online requires parsing the contents of /sys/devices/system/cpu/online on linux, and it's not clear how to do it on Windows. Instead, the calibration code will treat errors when calling set_cpu_affinity as legitimate reasons for a core to be offline, and will exclude that core from the offset information in the TscState. This will prevent the TSC sync mitigation logic from setting any vpu's affinity to that core. This also changes how number_of_logical_cores is implemented on linux, to count the number of configured cores instead of the number of online cores, which seems more correct. BUG=b:230372694 TEST=added a new unittest, also ran unittests with an offline core Change-Id: I12c187a7ca1dd06e25b396eaeae542628fdf563c Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764280 Tested-by: Colin Downs-Razouk <colindr@google.com> Commit-Queue: Colin Downs-Razouk <colindr@google.com> Reviewed-by: Dennis Kempin <denniskempin@google.com>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.