Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver

2021-04-13 Thread Alex Bennée
any implementation (Linux or otherwise). By all means have the distilled documentation for the driver in the kernel source tree but trying to upstream an implementation before starting the definition in the standard is a little back to front IMHO*. * that's not to say these things can't be done in parallel as the spec is reviewed and worked on and the kinks worked out but you want the final order of upstreaming to start with the spec. -- Alex Bennée

Re: [RFC PATCH 1/5] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2021-03-11 Thread Alex Bennée
guess what we are saying is that real secure monitors should come up with their own common API for interfacing with RPMB devices without looking to the Linux kernel for inspiration? -- Alex Bennée

Re: [RFC PATCH 0/5] RPMB internal and user-space API + WIP virtio-rpmb frontend

2021-03-10 Thread Alex Bennée
e and domain specific tools for each device type. > > Thanks, > Avri -- Alex Bennée

Re: [RFC PATCH 2/5] char: rpmb: provide a user space interface

2021-03-04 Thread Alex Bennée
f list conversation it was suggested that maybe the PROGRAM_KEY ioctl should be disabled for locked down kernels to dissuade production use of the facility (it is handy for testing though!). >> I wonder if virtio-rpmb may be of help here? You could wrap up up the front- >> end in the security domain that has the keys although I don't know how easy >> it would be for a backend to work with real hardware? > > I'm open to see any proposal, not sure I can wrap may head about it right > now. > > Anyway I was about to send the new round of my code, but let's come to > common ground first. > OK - I'll see what the others say. -- Alex Bennée

Re: [RFC PATCH 2/5] char: rpmb: provide a user space interface

2021-03-04 Thread Alex Bennée
rtio-rpmb may be of help here? You could wrap up up the front-end in the security domain that has the keys although I don't know how easy it would be for a backend to work with real hardware? > We all wished it can be abstracted more but the frames has to come already > signed, and the key mater

Re: [RFC PATCH 1/5] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2021-03-03 Thread Alex Bennée
org> assuming you are subscribed to one of the Cc'd lists. On Wed, 3 Mar 2021 at 15:29, Ulf Hansson wrote: > > On Wed, 3 Mar 2021 at 14:55, Alex Bennée wrote: > > > > A number of storage technologies support a specialised hardware > > partition designed to be resistant to

[RFC PATCH 4/5] rpmb: create virtio rpmb frontend driver [WIP]

2021-03-03 Thread Alex Bennée
This implements a virtio rpmb frontend driver for the RPMB subsystem. [AJB: the principle difference is all the MAC calculation and validation is now done in the driver] Signed-off-by: Alex Bennée Cc: Tomas Winkler --- ajb: - add include linux/slab.h for kzalloc - include standardised

[RFC PATCH 0/5] RPMB internal and user-space API + WIP virtio-rpmb frontend

2021-03-03 Thread Alex Bennée
things and are willing to take up the maintainer burden if this is merged. Alex Bennée (5): rpmb: add Replay Protected Memory Block (RPMB) subsystem char: rpmb: provide a user space interface tools rpmb: add RPBM access tool rpmb: create virtio rpmb frontend driver [WIP] tools/rpmb: simple test se

[RFC PATCH 1/5] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2021-03-03 Thread Alex Bennée
Signed-off-by: Alex Bennée Cc: Tomas Winkler Cc: Ulf Hansson Cc: Linus Walleij Cc: Arnd Bergmann Cc: Ilias Apalodimas --- MAINTAINERS| 7 + drivers/char/Kconfig | 2 + drivers/char/Makefile | 1 + drivers/char/rpmb/Kconfig | 11 + drivers/char/rpmb/Makefile

[RFC PATCH 2/5] char: rpmb: provide a user space interface

2021-03-03 Thread Alex Bennée
. The first is the dropping of the sequence of preformated frames in favour of explicit actions. The second is the introduction of key_serial_t and the keyring API for referencing the key to use] Signed-off-by: Alex Bennée Cc: Ulf Hansson Cc: Linus Walleij Cc: Arnd Bergmann Cc: Ilias Apalodimas Cc

[RFC PATCH 5/5] tools/rpmb: simple test sequence

2021-03-03 Thread Alex Bennée
A simple test script to exercise the rpmb interface. Signed-off-by: Alex Bennée --- tools/rpmb/key | 1 + tools/rpmb/test.sh | 13 + 2 files changed, 14 insertions(+) create mode 100644 tools/rpmb/key create mode 100755 tools/rpmb/test.sh diff --git a/tools/rpmb/key b/tools

[RFC PATCH 3/5] tools rpmb: add RPBM access tool

2021-03-03 Thread Alex Bennée
the keys] Signed-off-by: Alex Bennée Cc: Tomas Winkler Cc: Alexander Usyskin --- MAINTAINERS | 1 + tools/Makefile| 14 +- tools/rpmb/.gitignore | 2 + tools/rpmb/Makefile | 41 +++ tools/rpmb/rpmb.c | 649 ++ 5 files changed

RPMB user space ABI

2021-02-15 Thread Alex Bennée
then be for the kernel to take the higher level concepts and translate them to the final frames required to talk to the actual HW (if indeed there is some). Does this seem reasonable? Is this orthogonal to any access to RPMB partitions that file-systems might want to do? -- Alex Bennée

Re: [PATCH v1 3/3] kernel/configs: don't include PCI_QUIRKS in KVM guest configs

2020-08-04 Thread Alex Bennée
Marc Zyngier writes: > On 2020-08-04 15:44, Alex Bennée wrote: >> Marc Zyngier writes: >> >>> On 2020-08-04 13:44, Alex Bennée wrote: >>>> The VIRTIO_PCI support is an idealised PCI bus, we don't need a bunch >>>> of bloat for real worl

Re: [RFC PATCH v1 0/3] put arm64 kvm_config on a diet

2020-08-04 Thread Alex Bennée
Ard Biesheuvel writes: > On Tue, 4 Aug 2020 at 14:45, Alex Bennée wrote: >> >> Hi, >> >> When building guest kernels for virtualisation we were bringing in a >> bunch of stuff from physical hardware which we don't need for our >> idealised fixable virt

Re: [PATCH v1 3/3] kernel/configs: don't include PCI_QUIRKS in KVM guest configs

2020-08-04 Thread Alex Bennée
Marc Zyngier writes: > On 2020-08-04 13:44, Alex Bennée wrote: >> The VIRTIO_PCI support is an idealised PCI bus, we don't need a bunch >> of bloat for real world hardware for a VirtIO guest. > > Who says this guest will only have virtio devices? This is true - altho

[RFC PATCH v1 0/3] put arm64 kvm_config on a diet

2020-08-04 Thread Alex Bennée
PCI_QUIRKS from the KVM guest build as a virtual PCI device should be quirk free. This is my first time hacking around Kconfig so I hope I've got the balance between depends and selects right but please let be know if it could be specified in a cleaner way. Alex Bennée (3): arm64: allow de

[PATCH v1 1/3] arm64: allow de-selection of ThunderX PCI controllers

2020-08-04 Thread Alex Bennée
85652472 Aug 3 16:48 vmlinux* -rwxr-xr-x 1 alex alex 86033880 Aug 3 16:39 vmlinux.orig* Signed-off-by: Alex Bennée Cc: Robert Richter Cc: linux-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org --- arch/arm64/Kconfig.platforms| 2 ++ arch/arm64/configs/defconfig| 1

[PATCH v1 2/3] arm64: gate the whole of pci-xgene on CONFIG_PCI_XGENE

2020-08-04 Thread Alex Bennée
-thunder* -rwxr-xr-x 1 alex alex 85639808 Aug 3 17:12 vmlinux* Signed-off-by: Alex Bennée --- drivers/pci/controller/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile index 8fad4781a5d3..3b9b72f5773a

[PATCH v1 3/3] kernel/configs: don't include PCI_QUIRKS in KVM guest configs

2020-08-04 Thread Alex Bennée
The VIRTIO_PCI support is an idealised PCI bus, we don't need a bunch of bloat for real world hardware for a VirtIO guest. Signed-off-by: Alex Bennée --- kernel/configs/kvm_guest.config | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/configs/kvm_guest.config b/kernel/configs

Re: [PATCH v2 0/5] virtio mmio specification enhancement

2020-08-03 Thread Alex Bennée
Alex Bennée writes: > Pincus, Josh writes: > >> Hi, >> >> >> >> We were looking into a similar enhancement for the Virt I/O MMIO transport >> and came across this project. >> >> This enhancement would be perfect for us. > > So th

Re: [PATCH v2 0/5] virtio mmio specification enhancement

2020-07-31 Thread Alex Bennée
e features you are most interested in? > Has there been any progress since Feb, 2020? It looks like the effort > might have stalled? I can't speak to the OP's but there is certainly interest from others that are not the original posters. -- Alex Bennée

Re: [PATCH v2 04/12] arm64: docs: cpu-feature-registers: Document ID_AA64PFR1_EL1

2019-10-11 Thread Alex Bennée
| [35-32] |y| > +--+-+-+ > > - 6) ID_AA64ZFR0_EL1 - SVE feature ID register 0 > + 7) ID_AA64ZFR0_EL1 - SVE feature ID register 0 > > +--+-+-+ > | Name | bits | visible | -- Alex Bennée

Re: [PATCH] arm64/sve: fix genksyms generation

2019-06-17 Thread Alex Bennée
about exposing this as an array type without understanding whether or >> not that has consequences for its operation. > > The entire point is genksyms is to ensure that types of exported symbols > are compatible. To do this, it has a limited parser for C source code that > understands the basic types (char, int, long, _Bool, etc) and how to > aggregate them into structs and function arguments. This process has > always been fragile, and it clearly breaks when it fails to understand a > particular type. Shouldn't the solution for this be to fix genksyms to be less fragile and more understanding? The code base doesn't seem to be full of these sorts of ifdef workarounds. > > Arnd -- Alex Bennée

[PATCH v1 1/2] kvm: arm64: handle single-step during SError exceptions

2017-11-23 Thread Alex Bennée
need to exit to user space. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm64/kvm/handle_exit.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index 3e645ec9e751..3ba8c4a3bcff 100644 ---

[PATCH v1 1/2] kvm: arm64: handle single-step during SError exceptions

2017-11-23 Thread Alex Bennée
need to exit to user space. Signed-off-by: Alex Bennée --- arch/arm64/kvm/handle_exit.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index 3e645ec9e751..3ba8c4a3bcff 100644 --- a/arch/arm64/kvm/handle_exit.c

[PATCH v1 2/2] kvm: arm64: handle single-step of hyp emulated mmio instructions

2017-11-23 Thread Alex Bennée
the ARM_EXCEPTION_EL1_SERROR path in handle_exit(). We behave as we would during a real SError and clear the DBG_SPSR_SS bit for the emulated instruction. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm64/kvm/hyp/switch.c | 37 ++--- 1 file chang

[PATCH v1 2/2] kvm: arm64: handle single-step of hyp emulated mmio instructions

2017-11-23 Thread Alex Bennée
the ARM_EXCEPTION_EL1_SERROR path in handle_exit(). We behave as we would during a real SError and clear the DBG_SPSR_SS bit for the emulated instruction. Signed-off-by: Alex Bennée --- arch/arm64/kvm/hyp/switch.c | 37 ++--- 1 file changed, 30 insertions(+), 7

[RFC PATCH] kvm: arm64: handle single-step of hyp emulated mmio instructions

2017-11-22 Thread Alex Bennée
to handle_exit() by clearing the DBG_SPSR_SS bit as would have actually happened had the hardware really single-stepped the instruction. [AJB: currently compile tested only] Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm64/kvm/handle_exit.c | 8 +++- arch/arm64/kvm/hyp/switch.c

[RFC PATCH] kvm: arm64: handle single-step of hyp emulated mmio instructions

2017-11-22 Thread Alex Bennée
to handle_exit() by clearing the DBG_SPSR_SS bit as would have actually happened had the hardware really single-stepped the instruction. [AJB: currently compile tested only] Signed-off-by: Alex Bennée --- arch/arm64/kvm/handle_exit.c | 8 +++- arch/arm64/kvm/hyp/switch.c | 37

[PATCH v3 2/3] kvm: arm64: handle single-stepping trapped instructions

2017-11-16 Thread Alex Bennée
() helper sets up the necessary exit state if needed. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Julien Thierry <julien.thie...@arm.com> --- v2 - use helper from patch 1 - if (handled > 0) instead of if (handled) so errors propagate --- arch/arm64/kvm/han

[PATCH v3 2/3] kvm: arm64: handle single-stepping trapped instructions

2017-11-16 Thread Alex Bennée
() helper sets up the necessary exit state if needed. Signed-off-by: Alex Bennée Reviewed-by: Julien Thierry --- v2 - use helper from patch 1 - if (handled > 0) instead of if (handled) so errors propagate --- arch/arm64/kvm/handle_exit.c | 47 +++-

[PATCH v3 1/3] kvm: arm debug: introduce helper for single-step

2017-11-16 Thread Alex Bennée
After emulating instructions we may want return to user-space to handle a single-step. If single-step is enabled the helper set the run structure for return and returns true. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Julien Thierry <julien.thie...@arm.co

[PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-16 Thread Alex Bennée
the exit_reason for us. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- v2 - call helper directly from kvm_arch_vcpu_ioctl_run v3 - return 0 (ioctl success) instead of 1 --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm

[PATCH v3 1/3] kvm: arm debug: introduce helper for single-step

2017-11-16 Thread Alex Bennée
After emulating instructions we may want return to user-space to handle a single-step. If single-step is enabled the helper set the run structure for return and returns true. Signed-off-by: Alex Bennée Reviewed-by: Julien Thierry --- v2 - kvm_arm_maybe_return_debug

[PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-16 Thread Alex Bennée
the exit_reason for us. Signed-off-by: Alex Bennée --- v2 - call helper directly from kvm_arch_vcpu_ioctl_run v3 - return 0 (ioctl success) instead of 1 --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 95cba0799828

Re: [PATCH v2 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-13 Thread Alex Bennée
Julien Thierry <julien.thie...@arm.com> writes: > Hi Alex, > > On 09/11/17 17:00, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >&g

Re: [PATCH v2 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-13 Thread Alex Bennée
Julien Thierry writes: > Hi Alex, > > On 09/11/17 17:00, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >> until they have been committed and then

[PATCH] fixup! kvm: arm debug: introduce helper for single-step

2017-11-09 Thread Alex Bennée
--- arch/arm/include/asm/kvm_host.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index a2e881d6108e..26a1ea6c6542 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@

[PATCH] fixup! kvm: arm debug: introduce helper for single-step

2017-11-09 Thread Alex Bennée
--- arch/arm/include/asm/kvm_host.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index a2e881d6108e..26a1ea6c6542 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@

[PATCH v2 1/3] kvm: arm debug: introduce helper for single-step

2017-11-09 Thread Alex Bennée
After emulating instructions we may want return to user-space to handle a single-step. If single-step is enabled the helper set the run structure for return and returns true. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- v2 - kvm_arm_maybe_return_debug -> kvm_arm_handle_s

[PATCH v2 1/3] kvm: arm debug: introduce helper for single-step

2017-11-09 Thread Alex Bennée
After emulating instructions we may want return to user-space to handle a single-step. If single-step is enabled the helper set the run structure for return and returns true. Signed-off-by: Alex Bennée --- v2 - kvm_arm_maybe_return_debug -> kvm_arm_handle_step_debug - return bool, t

[PATCH v2 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-09 Thread Alex Bennée
the exit_reason for us. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- v2 - call helper directly from kvm_arch_vcpu_ioctl_run --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 95cba0799828..2991adfaca9d

[PATCH v2 3/3] kvm: arm64: handle single-step of userspace mmio instructions

2017-11-09 Thread Alex Bennée
the exit_reason for us. Signed-off-by: Alex Bennée --- v2 - call helper directly from kvm_arch_vcpu_ioctl_run --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 95cba0799828..2991adfaca9d 100644 --- a/virt/kvm/arm/arm.c +++ b

[PATCH v2 2/3] kvm: arm64: handle single-stepping trapped instructions

2017-11-09 Thread Alex Bennée
() helper sets up the necessary exit state if needed. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- v2 - use helper from patch 1 - if (handled > 0) instead of if (handled) so errors propagate --- arch/arm64/kvm/handle_exit.c | 47 +++

[PATCH v2 2/3] kvm: arm64: handle single-stepping trapped instructions

2017-11-09 Thread Alex Bennée
() helper sets up the necessary exit state if needed. Signed-off-by: Alex Bennée --- v2 - use helper from patch 1 - if (handled > 0) instead of if (handled) so errors propagate --- arch/arm64/kvm/handle_exit.c | 47 +++- 1 file changed, 33 inserti

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall <cd...@linaro.org> writes: > On Fri, Oct 06, 2017 at 12:39:21PM +0100, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >> unt

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall writes: > On Fri, Oct 06, 2017 at 12:39:21PM +0100, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >> until they have been committed

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall <cd...@linaro.org> writes: > On Fri, Oct 06, 2017 at 02:45:35PM +0100, Alex Bennée wrote: >> >> Julien Thierry <julien.thie...@arm.com> writes: >> >> > On 06/10/17 12:39, Alex Bennée wrote: >> >> The system state of KVM when

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall writes: > On Fri, Oct 06, 2017 at 02:45:35PM +0100, Alex Bennée wrote: >> >> Julien Thierry writes: >> >> > On 06/10/17 12:39, Alex Bennée wrote: >> >> The system state of KVM when using userspace emulation is not complete >>

Re: [PATCH v1 1/2] KVM: arm64: handle single-stepping trapped instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall <cd...@linaro.org> writes: > On Fri, Oct 06, 2017 at 12:39:20PM +0100, Alex Bennée wrote: >> If we are using guest debug to single-step the guest we need to ensure >> we exit after emulating the instruction. This only affects >> instructions comple

Re: [PATCH v1 1/2] KVM: arm64: handle single-stepping trapped instructions

2017-10-13 Thread Alex Bennée
Christoffer Dall writes: > On Fri, Oct 06, 2017 at 12:39:20PM +0100, Alex Bennée wrote: >> If we are using guest debug to single-step the guest we need to ensure >> we exit after emulating the instruction. This only affects >> instructions completely emulated by the

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
Marc Zyngier <marc.zyng...@arm.com> writes: > On 06/10/17 13:37, Marc Zyngier wrote: >> On 06/10/17 12:39, Alex Bennée wrote: >>> The system state of KVM when using userspace emulation is not complete >>> until we return into KVM_RUN. To handle mmio related up

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
Marc Zyngier writes: > On 06/10/17 13:37, Marc Zyngier wrote: >> On 06/10/17 12:39, Alex Bennée wrote: >>> The system state of KVM when using userspace emulation is not complete >>> until we return into KVM_RUN. To handle mmio related updates we wait >>

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
Julien Thierry <julien.thie...@arm.com> writes: > On 06/10/17 12:39, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >> until they have been comm

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
Julien Thierry writes: > On 06/10/17 12:39, Alex Bennée wrote: >> The system state of KVM when using userspace emulation is not complete >> until we return into KVM_RUN. To handle mmio related updates we wait >> until they have been committed and then schedule our KVM_E

[PATCH v1 1/2] KVM: arm64: handle single-stepping trapped instructions

2017-10-06 Thread Alex Bennée
to contain ESR_ELx_EC_SOFTSTP_LOW so QEMU knows it was a single-step event (and without altering the userspace ABI). Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm64/kvm/handle_exit.c | 48 +++- 1 file changed, 34 insertions(+), 14 del

[PATCH v1 1/2] KVM: arm64: handle single-stepping trapped instructions

2017-10-06 Thread Alex Bennée
to contain ESR_ELx_EC_SOFTSTP_LOW so QEMU knows it was a single-step event (and without altering the userspace ABI). Signed-off-by: Alex Bennée --- arch/arm64/kvm/handle_exit.c | 48 +++- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/arch/arm64

[PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
between arm/arm64 which is currently null for arm. Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/debug.c| 21 + arch/arm64/kvm/handle_exit.c

[PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-06 Thread Alex Bennée
between arm/arm64 which is currently null for arm. Signed-off-by: Alex Bennée --- arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/debug.c| 21 + arch/arm64/kvm/handle_exit.c | 9 +++-- virt/kvm/arm/arm.c

[PATCH v2 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi

2017-05-11 Thread Alex Bennée
ed-off-by: Zhichao Huang <zhichao.hu...@linaro.org> Reviewed-by: Alex Bennee <alex.ben...@linaro.org> Acked-by: Christoffer Dall <christoffer.d...@linaro.org> Acked-by: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- v2: - fix m

[PATCH v2 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi

2017-05-11 Thread Alex Bennée
-by: Alex Bennee Acked-by: Christoffer Dall Acked-by: Marc Zyngier Signed-off-by: Alex Bennée --- v2: - fix minor merge conflicts - add maz a-b --- arch/arm/kvm/coproc.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/arm/kvm/coproc.c b

[PATCH v2 1/2] KVM: arm: plug potential guest hardware debug leakage

2017-05-11 Thread Alex Bennée
hichao.hu...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- ajb v2: - don't (void) unused return value - fix some 0/1 bool usage - further re-factor to avoid hacky if (cp15) in trap path ajb v1: - convert to C world switch - reword commit message --- ar

[PATCH v2 1/2] KVM: arm: plug potential guest hardware debug leakage

2017-05-11 Thread Alex Bennée
normal debug using software based breakpoints still works. To support debugging using hardware registers we need to implement a debug register aware world switch as well as special trapping for registers that may affect the host state. Signed-off-by: Zhichao Huang Signed-off-by: Alex Bennée --- ajb

Re: [PATCH v1 1/2] KVM: arm: plug guest debug exploit

2017-05-11 Thread Alex Bennée
Marc Zyngier <marc.zyng...@arm.com> writes: > Hi Alex, > > On 10/05/17 18:01, Alex Bennée wrote: >> From: Zhichao Huang <zhichao.hu...@linaro.org> >> >> Hardware debugging in guests is not intercepted currently, it means >> that a malicious guest

Re: [PATCH v1 1/2] KVM: arm: plug guest debug exploit

2017-05-11 Thread Alex Bennée
Marc Zyngier writes: > Hi Alex, > > On 10/05/17 18:01, Alex Bennée wrote: >> From: Zhichao Huang >> >> Hardware debugging in guests is not intercepted currently, it means >> that a malicious guest can bring down the entire machine by writing >> to the d

[PATCH v1 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi

2017-05-10 Thread Alex Bennée
ed-off-by: Zhichao Huang <zhichao.hu...@linaro.org> Reviewed-by: Alex Bennee <alex.ben...@linaro.org> Acked-by: Christoffer Dall <christoffer.d...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- arch/arm/kvm/coproc.c | 32 1 file

[PATCH v1 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi

2017-05-10 Thread Alex Bennée
-by: Alex Bennee Acked-by: Christoffer Dall Signed-off-by: Alex Bennée --- arch/arm/kvm/coproc.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index b2053393bb1f..6919363ce7cc 100644 --- a/arch/arm/kvm

[PATCH v1 1/2] KVM: arm: plug guest debug exploit

2017-05-10 Thread Alex Bennée
hichao.hu...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> --- ajb: - convert to C world switch - reword commit message --- arch/arm/include/asm/kvm_coproc.h | 3 +- arch/arm/kvm/coproc.c | 82 +-- arch/arm/kvm/handle_exit.c

[PATCH v1 1/2] KVM: arm: plug guest debug exploit

2017-05-10 Thread Alex Bennée
using software based breakpoints still works. To support debugging using hardware registers we need to implement a debug register aware world switch as well as special trapping for registers that may affect the host state. Signed-off-by: Zhichao Huang Signed-off-by: Alex Bennée --- ajb

Re: [PATCH] binfmt_misc: allow selecting the interpreter based on xattr keywords

2016-11-11 Thread Alex Bennée
same location as I place qemu-user in the docker container. > > I'm not convinced this is a good idea, but I'm open to learning about > more use cases. -- Alex Bennée

Re: [PATCH] binfmt_misc: allow selecting the interpreter based on xattr keywords

2016-11-11 Thread Alex Bennée
emu-user in the docker container. > > I'm not convinced this is a good idea, but I'm open to learning about > more use cases. -- Alex Bennée

Re: [PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-15 Thread Alex Bennée
gest there is a problem with the >>> KVM handling of single stepping for guests? >> >> It didn't fail for me on the host either. What's strange is that on some >> occasions even the guest managed to get to a prompt. I'll do more tests >> today on different CPU

Re: [PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-15 Thread Alex Bennée
ith the >>> KVM handling of single stepping for guests? >> >> It didn't fail for me on the host either. What's strange is that on some >> occasions even the guest managed to get to a prompt. I'll do more tests >> today on different CPU configurations, just to rule

Re: [PATCH v4 00/23] arm64: Virtualization Host Extension support

2016-02-29 Thread Alex Bennée
binutils people are on the case. I assume you are talking about ptrace debug here rather than guest debug? Anyway from a cursory inspection I didn't see anything to worry about from the guest debug side which is unchanged. Acked-by: Alex Bennée <alex.ben...@linaro.org> > > This ha

Re: [PATCH v4 00/23] arm64: Virtualization Host Extension support

2016-02-29 Thread Alex Bennée
on the case. I assume you are talking about ptrace debug here rather than guest debug? Anyway from a cursory inspection I didn't see anything to worry about from the guest debug side which is unchanged. Acked-by: Alex Bennée > > This has been tested on the FVP_Base_SLV-V8-A model, and based on

Re: [PATCH 1/8] goldfish: refactor goldfish platform configs

2015-11-25 Thread Alex Bennée
file > +++ b/drivers/platform/goldfish/Makefile > @@ -1,5 +1,5 @@ > # > # Makefile for Goldfish platform specific drivers > # > -obj-$(CONFIG_GOLDFISH) += pdev_bus.o > +obj-$(CONFIG_GOLDFISH_BUS) += pdev_bus.o > obj-$(CONFIG_GOLDFISH_PIPE) += goldfish

Re: [PATCH 1/8] goldfish: refactor goldfish platform configs

2015-11-25 Thread Alex Bennée
kefile > b/drivers/platform/goldfish/Makefile > index a002239..d348712 100644 > --- a/drivers/platform/goldfish/Makefile > +++ b/drivers/platform/goldfish/Makefile > @@ -1,5 +1,5 @@ > # > # Makefile for Goldfish platform specific drivers > # > -obj-$(CONFIG_GOLDFISH) += p

Re: [RFC PATCH v4 1/3] tracing/events: Fix wrong sample output by storing array length instead of size

2015-07-23 Thread Alex Bennée
foo, bar) use __get_str(foo) > * > @@ -288,7 +291,7 @@ TRACE_EVENT(foo_bar, > *This prints out the array that is defined by __array in a nice format. > */ > __print_array(__get_dynamic_array(list), > - __get_dynamic_array_len(list), > +

Re: [RFC PATCH v4 1/3] tracing/events: Fix wrong sample output by storing array length instead of size

2015-07-23 Thread Alex Bennée
)), __get_str(str), __get_bitmask(cpus)) ); Reviewed-by: Alex Bennée alex.ben...@linaro.org -- Alex Bennée -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

[PATCH v8 02/11] KVM: arm64: guest debug, define API headers

2015-07-07 Thread Alex Bennée
by the architecture specific control bits of the kvm_guest_debug->control flags in the ioctl structure. Signed-off-by: Alex Bennée Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - expose hsr and pc directly to user-space v3 - s/cont

[PATCH v8 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr

2015-07-07 Thread Alex Bennée
ide the generic code when needed. Signed-off-by: Alex Bennée --- v6: - fix up some ws issues - correct clobber info - re-word commentary in kvm_host.h - fix endian access issues for aarch32 fields - revert all KVM_GET/SET_ONE_REG to 64bit (also see ABI update) v7 - new fn kvm_arm_reset_debug_

[PATCH v8 05/11] KVM: arm64: guest debug, add SW break point support

2015-07-07 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v2 - update to use new exit struct - tweak for C setup - do

[PATCH v8 06/11] KVM: arm64: guest debug, add support for single-step

2015-07-07 Thread Alex Bennée
. Once the host is no longer debugging the guest its ability to single-step userspace is restored. Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor for saved_debug regs - tweak save

[PATCH v8 11/11] KVM: arm64: add trace points for guest_debug debug

2015-07-07 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée --- v3 - add trace event for debug access

[PATCH v8 10/11] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-07-07 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée Acked-by: Christoffer Dall --- v3: - separated capability check from previous patches - moved into arm64

[PATCH v8 07/11] KVM: arm64: re-factor hyp.S debug register code

2015-07-07 Thread Alex Bennée
. It does however rely on the debug registers being 64 bit aligned (as they happen to be in the hyp ABI). Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v3: - return to the patch series - add save and restore targets - change register use and document v4: - keep original setup

[PATCH v8 01/11] KVM: add comments for kvm_debug_exit_arch struct

2015-07-07 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - add comments

[PATCH v8 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-07 Thread Alex Bennée
ioctl to allow userspace to query the number of hardware break and watch points available on the host hardware. Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v2 - switched to C setup - replace host debug registers directly into context - minor tweak to api docs - setup

[PATCH v8 04/11] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-07-07 Thread Alex Bennée
rom the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v3 - rename fns from arch->arm - preserve MDCR_EL2.HPMN setting - re-word some of the comments - fix some minor gramma

[PATCH v8 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-07-07 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée . Reviewed-by: Christoffer Dall --- v2 - simplified form

[PATCH v8 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-07-07 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée alex.ben...@linaro.org. Reviewed-by: Christoffer Dall christoffer.d

[PATCH v8 06/11] KVM: arm64: guest debug, add support for single-step

2015-07-07 Thread Alex Bennée
. Once the host is no longer debugging the guest its ability to single-step userspace is restored. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly

[PATCH v8 08/11] KVM: arm64: introduce vcpu-arch.debug_ptr

2015-07-07 Thread Alex Bennée
the generic code when needed. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v6: - fix up some ws issues - correct clobber info - re-word commentary in kvm_host.h - fix endian access issues for aarch32 fields - revert all KVM_GET/SET_ONE_REG to 64bit (also see ABI update) v7 - new fn

[PATCH v8 05/11] KVM: arm64: guest debug, add SW break point support

2015-07-07 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - update

[PATCH v8 02/11] KVM: arm64: guest debug, define API headers

2015-07-07 Thread Alex Bennée
by the architecture specific control bits of the kvm_guest_debug-control flags in the ioctl structure. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com Acked-by: Christoffer Dall christoffer.d

[PATCH v8 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-07 Thread Alex Bennée
ioctl to allow userspace to query the number of hardware break and watch points available on the host hardware. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - switched to C setup - replace host debug registers directly

[PATCH v8 04/11] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-07-07 Thread Alex Bennée
the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v3 - rename fns from arch-arm - preserve MDCR_EL2.HPMN setting - re-word some

[PATCH v8 01/11] KVM: add comments for kvm_debug_exit_arch struct

2015-07-07 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

[PATCH v8 07/11] KVM: arm64: re-factor hyp.S debug register code

2015-07-07 Thread Alex Bennée
. It does however rely on the debug registers being 64 bit aligned (as they happen to be in the hyp ABI). Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v3: - return to the patch series - add save and restore targets - change

  1   2   3   4   5   >