From: Paul Mackerras <paulus@ozlabs.org> To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Cc: Michael Neuling <mikey@neuling.org> Subject: [PATCH 0/4] KVM: PPC: Book3S HV: Restore host state properly on guest exit Date: Fri, 16 Jun 2017 16:42:49 +1000 [thread overview] Message-ID: <1497595373-3451-1-git-send-email-paulus@ozlabs.org> (raw) It turns out that when we added the support for loading up the new special-purpose registers on POWER8 when entering a guest, and saving them on guest exit, we forgot to load up appropriate values for the host for many of them. Some of them have the potential to disrupt the execution of the userspace program controlling the guest. The ones that could disrupt the host kernel were set to benign values by commit ccec44563b18 ("KVM: PPC: Book3S HV: Sanitize special-purpose register values on guest exit", 2016-03-05), but even with that commit we lose hardware instruction and breakpoint settings on guest exit. Also, commit 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of user space", 2016-11-15) sets the IAMR to prevent the kernel executing from user pages, but the guest exit code resets the IAMR to zero. This series fixes these problems. Because of the potential for the guest to affect the controlling userspace, these are marked for stable, and I will submit them for inclusion in 4.12. Paul. arch/powerpc/kvm/book3s_hv.c | 43 +++++++++++++++++++++++++++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 52 ++++++++++++++++++++++++--------- 2 files changed, 82 insertions(+), 13 deletions(-)
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@ozlabs.org> To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Cc: Michael Neuling <mikey@neuling.org> Subject: [PATCH 0/4] KVM: PPC: Book3S HV: Restore host state properly on guest exit Date: Fri, 16 Jun 2017 06:42:49 +0000 [thread overview] Message-ID: <1497595373-3451-1-git-send-email-paulus@ozlabs.org> (raw) It turns out that when we added the support for loading up the new special-purpose registers on POWER8 when entering a guest, and saving them on guest exit, we forgot to load up appropriate values for the host for many of them. Some of them have the potential to disrupt the execution of the userspace program controlling the guest. The ones that could disrupt the host kernel were set to benign values by commit ccec44563b18 ("KVM: PPC: Book3S HV: Sanitize special-purpose register values on guest exit", 2016-03-05), but even with that commit we lose hardware instruction and breakpoint settings on guest exit. Also, commit 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of user space", 2016-11-15) sets the IAMR to prevent the kernel executing from user pages, but the guest exit code resets the IAMR to zero. This series fixes these problems. Because of the potential for the guest to affect the controlling userspace, these are marked for stable, and I will submit them for inclusion in 4.12. Paul. arch/powerpc/kvm/book3s_hv.c | 43 +++++++++++++++++++++++++++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 52 ++++++++++++++++++++++++--------- 2 files changed, 82 insertions(+), 13 deletions(-)
next reply other threads:[~2017-06-16 6:43 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-06-16 6:42 Paul Mackerras [this message] 2017-06-16 6:42 ` [PATCH 0/4] KVM: PPC: Book3S HV: Restore host state properly on guest exit Paul Mackerras 2017-06-16 6:42 ` [PATCH 1/4] KVM: PPC: Book3S HV: Context-switch EBB registers properly Paul Mackerras 2017-06-16 6:42 ` Paul Mackerras 2017-06-16 6:42 ` [PATCH 2/4] KVM: PPC: Book3S HV: Restore critical SPRs to host values on guest exit Paul Mackerras 2017-06-16 6:42 ` Paul Mackerras 2017-06-16 6:42 ` [PATCH 3/4] KVM: PPC: Book3S HV: Preserve userspace HTM state properly Paul Mackerras 2017-06-16 6:42 ` Paul Mackerras 2017-06-16 6:42 ` [PATCH 4/4] KVM: PPC: Book3S HV: Save/restore host values of debug registers Paul Mackerras 2017-06-16 6:42 ` Paul Mackerras
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1497595373-3451-1-git-send-email-paulus@ozlabs.org \ --to=paulus@ozlabs.org \ --cc=kvm-ppc@vger.kernel.org \ --cc=kvm@vger.kernel.org \ --cc=mikey@neuling.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.