Re: [PATCH 07/13] KVM: PPC: Book3S HV: Adjust host/guest context switch for POWER9
From: Paul Mackerras <hidden>
Date: 2016-11-19 04:23:24
Also in:
kvm
On Fri, Nov 18, 2016 at 08:05:47PM +0530, Aneesh Kumar K.V wrote:
Paul Mackerras [off-list ref] writes:quoted
Some special-purpose registers that were present and accessible by guests on POWER8 no longer exist on POWER9, so this adds feature sections to ensure that we don't try to context-switch them when going into or out of a guest on POWER9. These are all relatively obscure, rarely-used registers, but we had to context-switch them on POWER8 to avoid creating a covert channel. They are: SPMC1, SPMC2, MMCRS, CSIGR, TACR, TCSCR, and ACOP.We don't need to context-switch them even when running a power8 compat guest ?
They physically don't exist on the P9 chip, so how could we context-switch them? They certainly can't be used as a covert channel. Accesses to them will be a no-op for the guest in privileged (supervisor) mode (i.e., mfspr won't modify the destination register), which could be confusing for the guest if it was expecting to use them. SPMC1/2 and MMCRS are part of the "supervisor" PMU, which we have never used. I think CSIGR, TACR and TCSCR are part of a facility that was never completely implemented or usable on P8, so nothing uses them. ACOP is used in arch/powerpc/mm/icswx.c in conjunction with accelerators. There might be a problem there, but in any case, with no physical ACOP register present there's no way to save/restore it. Paul.