All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/11] KVM: arm: debug infrastructure support
@ 2015-06-22 10:41 ` Zhichao Huang
  0 siblings, 0 replies; 82+ messages in thread
From: Zhichao Huang @ 2015-06-22 10:41 UTC (permalink / raw)
  To: kvm, linux-arm-kernel, kvmarm, christoffer.dall, marc.zyngier,
	alex.bennee, will.deacon
  Cc: huangzhichao, Zhichao Huang

This patch series adds debug support, a key feature missing from the
KVM/armv7 port.

The main idea is borrowed from ARM64, which is to keep track of whether 
the debug registers are "dirty" (changed by the guest) or not. In this 
case, perform the usual save/restore dance, for one run only. It means 
we only have a penalty if a guest is actively using the debug registers.

The amount of registers is properly frightening, but CPUs actually
only implement a subset of them. Also, there is a number of registers
we don't bother emulating (things having to do with external debug and
OSlock).

External debug is when you actually plug a physical JTAG into the CPU.
OSlock is a way to prevent "other software" to play with the debug
registers. My understanding is that it is only useful in combination
with the external debug. In both case, implementing support for this
is probably not worth the effort, at least for the time being.

This has been tested on a Cortex-A15 platform, running 32bit guests.

The patches for this series are based off v4.1-rc8 and can be found
at:

https://git.linaro.org/people/zhichao.huang/linux.git
branch: guest-debug/4.1-rc8-v3

>From v2 [2]:
- Delete the debug mode enabling/disabling strategy
- Add missing cp14/cp15 trace events

>From v1 [1]:
- Added missing cp14 reset functions
- Disable debug mode if we don't need it to reduce unnecessary switch

[1]: https://lists.cs.columbia.edu/pipermail/kvmarm/2015-May/014729.html
[2]: https://lists.cs.columbia.edu/pipermail/kvmarm/2015-May/014847.html

Zhichao Huang (11):
  KVM: arm: plug guest debug exploit
  KVM: arm: rename pm_fake handler to trap_raz_wi
  KVM: arm: enable to use the ARM_DSCR_MDBGEN macro from KVM assembly
    code
  KVM: arm: common infrastructure for handling AArch32 CP14/CP15
  KVM: arm: check ordering of all system register tables
  KVM: arm: add trap handlers for 32-bit debug registers
  KVM: arm: add trap handlers for 64-bit debug registers
  KVM: arm: implement dirty bit mechanism for debug registers
  KVM: arm: implement lazy world switch for debug registers
  KVM: arm: add a trace event for cp14 traps
  KVM: arm: enable trapping of all debug registers

 arch/arm/include/asm/hw_breakpoint.h |  54 ++---
 arch/arm/include/asm/kvm_asm.h       |  15 ++
 arch/arm/include/asm/kvm_coproc.h    |   3 +-
 arch/arm/include/asm/kvm_host.h      |   6 +
 arch/arm/kernel/asm-offsets.c        |   2 +
 arch/arm/kvm/coproc.c                | 407 ++++++++++++++++++++++++++++++-----
 arch/arm/kvm/handle_exit.c           |   4 +-
 arch/arm/kvm/interrupts.S            |  16 ++
 arch/arm/kvm/interrupts_head.S       | 313 ++++++++++++++++++++++++++-
 arch/arm/kvm/trace.h                 |  30 +++
 10 files changed, 762 insertions(+), 88 deletions(-)

-- 
1.7.12.4

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

end of thread, other threads:[~2015-07-13 12:12 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 10:41 [PATCH v3 00/11] KVM: arm: debug infrastructure support Zhichao Huang
2015-06-22 10:41 ` Zhichao Huang
2015-06-22 10:41 ` [PATCH v3 01/11] KVM: arm: plug guest debug exploit Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-29 15:49   ` Christoffer Dall
2015-06-29 15:49     ` Christoffer Dall
2015-07-01  7:04     ` zichao
2015-07-01  7:04       ` zichao
2015-07-01  9:00       ` Christoffer Dall
2015-07-01  9:00         ` Christoffer Dall
2015-07-01  9:00         ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 02/11] KVM: arm: rename pm_fake handler to trap_raz_wi Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:20   ` Christoffer Dall
2015-06-30 13:20     ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 03/11] KVM: arm: enable to use the ARM_DSCR_MDBGEN macro from KVM assembly code Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:20   ` Christoffer Dall
2015-06-30 13:20     ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 04/11] KVM: arm: common infrastructure for handling AArch32 CP14/CP15 Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-29 19:43   ` Christoffer Dall
2015-06-29 19:43     ` Christoffer Dall
2015-07-01  7:09     ` zichao
2015-07-01  7:09       ` zichao
2015-07-01  9:00       ` Christoffer Dall
2015-07-01  9:00         ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 05/11] KVM: arm: check ordering of all system register tables Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:20   ` Christoffer Dall
2015-06-30 13:20     ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 06/11] KVM: arm: add trap handlers for 32-bit debug registers Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-29 21:16   ` Christoffer Dall
2015-06-29 21:16     ` Christoffer Dall
2015-07-01  7:14     ` zichao
2015-07-01  7:14       ` zichao
2015-06-22 10:41 ` [PATCH v3 07/11] KVM: arm: add trap handlers for 64-bit " Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:20   ` Christoffer Dall
2015-06-30 13:20     ` Christoffer Dall
2015-07-01  7:43     ` Zhichao Huang
2015-07-01  7:43       ` Zhichao Huang
2015-06-22 10:41 ` [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for " Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30  9:20   ` Christoffer Dall
2015-06-30  9:20     ` Christoffer Dall
2015-07-03  9:54     ` Zhichao Huang
2015-07-03  9:54       ` Zhichao Huang
2015-07-03 11:56       ` Christoffer Dall
2015-07-03 11:56         ` Christoffer Dall
2015-07-07 10:06         ` Zhichao Huang
2015-07-07 10:06           ` Zhichao Huang
2015-07-07 10:24           ` Will Deacon
2015-07-07 10:24             ` Will Deacon
2015-07-08 10:50             ` Zhichao Huang
2015-07-08 10:50               ` Zhichao Huang
2015-07-08 17:08               ` Will Deacon
2015-07-08 17:08                 ` Will Deacon
2015-07-09 12:54                 ` Zhichao Huang
2015-07-09 12:54                   ` Zhichao Huang
2015-07-09 11:50             ` Christoffer Dall
2015-07-09 11:50               ` Christoffer Dall
2015-07-13 12:12               ` zichao
2015-07-13 12:12                 ` zichao
2015-06-22 10:41 ` [PATCH v3 09/11] KVM: arm: implement lazy world switch " Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:15   ` Christoffer Dall
2015-06-30 13:15     ` Christoffer Dall
2015-07-03 10:06     ` Zhichao Huang
2015-07-03 10:06       ` Zhichao Huang
2015-07-03 21:05       ` Christoffer Dall
2015-07-03 21:05         ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 10/11] KVM: arm: add a trace event for cp14 traps Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:20   ` Christoffer Dall
2015-06-30 13:20     ` Christoffer Dall
2015-06-22 10:41 ` [PATCH v3 11/11] KVM: arm: enable trapping of all debug registers Zhichao Huang
2015-06-22 10:41   ` Zhichao Huang
2015-06-30 13:19   ` Christoffer Dall
2015-06-30 13:19     ` Christoffer Dall

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.