linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings
@ 2015-02-19 10:54 Ard Biesheuvel
  2015-02-19 10:54 ` [RFC/RFT PATCH 1/3] arm64: KVM: handle some sysreg writes in EL2 Ard Biesheuvel
                   ` (6 more replies)
  0 siblings, 7 replies; 55+ messages in thread
From: Ard Biesheuvel @ 2015-02-19 10:54 UTC (permalink / raw)
  To: linux-arm-kernel

This is a 0th order approximation of how we could potentially force the guest
to avoid uncached mappings, at least from the moment the MMU is on. (Before
that, all of memory is implicitly classified as Device-nGnRnE)

The idea (patch #2) is to trap writes to MAIR_EL1, and replace uncached mappings
with cached ones. This way, there is no need to mangle any guest page tables.

The downside is that, to do this correctly, we need to always trap writes to
the VM sysreg group, which includes registers that the guest may write to very
often. To reduce the associated performance hit, patch #1 introduces a fast path
for EL2 to perform trivial sysreg writes on behalf of the guest, without the
need for a full world switch to the host and back.

The main purpose of these patches is to quantify the performance hit, and
verify whether the MAIR_EL1 handling works correctly. 

Ard Biesheuvel (3):
  arm64: KVM: handle some sysreg writes in EL2
  arm64: KVM: mangle MAIR register to prevent uncached guest mappings
  arm64: KVM: keep trapping of VM sysreg writes enabled

 arch/arm/kvm/mmu.c               |   2 +-
 arch/arm64/include/asm/kvm_arm.h |   2 +-
 arch/arm64/kvm/hyp.S             | 101 +++++++++++++++++++++++++++++++++++++++
 arch/arm64/kvm/sys_regs.c        |  63 ++++++++++++++++++++----
 4 files changed, 156 insertions(+), 12 deletions(-)

-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2015-03-09 15:33 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-19 10:54 [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings Ard Biesheuvel
2015-02-19 10:54 ` [RFC/RFT PATCH 1/3] arm64: KVM: handle some sysreg writes in EL2 Ard Biesheuvel
2015-03-03 17:59   ` Mario Smarduch
2015-02-19 10:54 ` [RFC/RFT PATCH 2/3] arm64: KVM: mangle MAIR register to prevent uncached guest mappings Ard Biesheuvel
2015-02-19 10:54 ` [RFC/RFT PATCH 3/3] arm64: KVM: keep trapping of VM sysreg writes enabled Ard Biesheuvel
2015-02-19 13:40   ` Marc Zyngier
2015-02-19 13:44     ` Ard Biesheuvel
2015-02-19 15:19       ` Marc Zyngier
2015-02-19 15:22         ` Ard Biesheuvel
2015-02-19 14:50 ` [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings Alexander Graf
2015-02-19 14:56   ` Ard Biesheuvel
2015-02-19 15:27     ` Alexander Graf
2015-02-19 15:31       ` Ard Biesheuvel
2015-02-19 16:57 ` Andrew Jones
2015-02-19 17:19   ` Ard Biesheuvel
2015-02-19 17:55     ` Andrew Jones
2015-02-19 17:57       ` Paolo Bonzini
2015-02-20 14:29         ` Andrew Jones
2015-02-20 14:37           ` Ard Biesheuvel
2015-02-20 15:36             ` Andrew Jones
2015-02-24 14:55               ` Andrew Jones
2015-02-24 17:47                 ` Ard Biesheuvel
2015-02-24 19:12                   ` Andrew Jones
2015-03-02 16:31                   ` Christoffer Dall
2015-03-02 16:47                     ` Paolo Bonzini
2015-03-02 16:55                       ` Laszlo Ersek
2015-03-02 17:05                         ` Andrew Jones
2015-03-02 16:48                     ` Andrew Jones
2015-03-03  2:20                     ` Mario Smarduch
2015-03-04 11:35                       ` Catalin Marinas
2015-03-04 11:50                         ` Ard Biesheuvel
2015-03-04 12:29                           ` Catalin Marinas
2015-03-04 12:43                             ` Ard Biesheuvel
2015-03-04 14:12                               ` Andrew Jones
2015-03-04 14:29                                 ` Catalin Marinas
2015-03-04 14:34                                   ` Peter Maydell
2015-03-04 17:03                                   ` Paolo Bonzini
2015-03-04 17:28                                     ` Catalin Marinas
2015-03-05 10:12                                       ` Paolo Bonzini
2015-03-05 11:04                                         ` Catalin Marinas
2015-03-05 11:52                                           ` Peter Maydell
2015-03-05 12:03                                             ` Catalin Marinas
2015-03-05 12:26                                               ` Paolo Bonzini
2015-03-05 14:58                                                 ` Catalin Marinas
2015-03-05 17:43                                                   ` Paolo Bonzini
2015-03-06 21:08                                                     ` Mario Smarduch
2015-03-09 14:26                                                       ` Andrew Jones
2015-03-09 15:33                                                         ` Mario Smarduch
2015-03-05 19:13                                                   ` Ard Biesheuvel
2015-03-06 20:33                         ` Mario Smarduch
2015-02-19 18:44       ` Ard Biesheuvel
2015-03-03 17:34 ` Alexander Graf
2015-03-03 18:13   ` Laszlo Ersek
2015-03-03 20:58     ` Andrew Jones
2015-03-03 18:32 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).