Skip to contentSkip to conversation

how to pass pcid to guest?

Qemu-devel Stefan Priebe - Profihost AG 3 participants 4 messages Jan 8, 2018 – Jan 10, 2018

lore
Share & tools
lore
#1 lore raw
Quoted 5 lines · Stefan Priebe - Profihost AG

Hello,

for meltdown mitigation and performance it's important to have the pcid flag passed down to the guest (f.e.
https://groups.google.com/forum/m/#!topic/mechanical-sympathy/L9mHTbeQLNU).

Indeed; you are still waiting on the qemu patch mentioned here:
https://www.qemu.org/2018/01/04/spectre/

which is still undergoing the review process, but should be up (in the form of 2.11.1) "in the next few days".

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#2 lore raw

Am 08.01.2018 um 23:07 schrieb Eric Blake:

Quoted 7 lines · Stefan Priebe - Profihost AG
Quoted 5 lines

Hello,

for meltdown mitigation and performance it's important to have the pcid flag passed down to the guest (f.e.
https://groups.google.com/forum/m/#!topic/mechanical-sympathy/L9mHTbeQLNU).

Quoted 5 lines

Indeed; you are still waiting on the qemu patch mentioned here:
https://www.qemu.org/2018/01/04/spectre/

which is still undergoing the review process, but should be up (in the form of 2.11.1) "in the next few days".

OK thanks as the performance difference is significant:

no pcid:

# time for i in $(seq 1 1 50); do du -sx /; done
...
real    0m26.614s
user    0m17.548s
sys     0m9.056s

kvm started with +pcid:

# time for i in $(seq 1 1 50); do du -sx /; done
...
real    0m14.734s
user    0m7.755s
sys     0m6.973s

Greets,
Stefan

#3 lore raw
In reply to Eric Blake
Quoted 7 lines · Eric Blake
Quoted 5 lines · Stefan Priebe - Profihost AG

Hello,

for meltdown mitigation and performance it's important to have the pcid flag passed down to the guest (f.e.
https://groups.google.com/forum/m/#!topic/mechanical-sympathy/L9mHTbeQLNU).

Quoted 5 lines

Indeed; you are still waiting on the qemu patch mentioned here:
https://www.qemu.org/2018/01/04/spectre/

which is still undergoing the review process, but should be up (in the form of 2.11.1) "in the next few days".

There's two different things here. The Spectre patch you mention is about exposing a new CPUID feature 'ibrs' that is added to fix Spectre. The 'pcid' feature Stefan mentions is a pre-existing feature that is not a security fix, but rather a way to improve the performance when the KAISER/KPTI patches are enabled for Meltdown.

'pcid' is available in QEMU's Haswell, Broadwell & Skylake based CPU models by default. For other named CPU models, you can turn it on using ',+pcid' after the model name. eg '-cpu Westmere,+pcid' (as long as your host supports it of course)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|