Re: [RFC/RFT PATCH 3/3] arm64: KVM: keep trapping of VM sysreg writes enabled

2015-02-19 Thread Ard Biesheuvel
On 19 February 2015 at 13:40, Marc Zyngier marc.zyng...@arm.com wrote: On 19/02/15 10:54, Ard Biesheuvel wrote: --- arch/arm/kvm/mmu.c | 2 +- arch/arm64/include/asm/kvm_arm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-02-20 Thread Ard Biesheuvel
On 20 February 2015 at 14:29, Andrew Jones drjo...@redhat.com wrote: On Thu, Feb 19, 2015 at 06:57:24PM +0100, Paolo Bonzini wrote: On 19/02/2015 18:55, Andrew Jones wrote: (I don't have an exact number for how many times it went to EL1 because access_mair() doesn't have a trace

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-02-19 Thread Ard Biesheuvel
On 19 February 2015 at 14:50, Alexander Graf ag...@suse.de wrote: On 19.02.15 11:54, Ard Biesheuvel wrote: 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

Re: [PATCH roundup 1/4] arm64: mm: increase VA range of identity map

2015-03-16 Thread Ard Biesheuvel
On 16 March 2015 at 15:28, Christoffer Dall christoffer.d...@linaro.org wrote: On Fri, Mar 06, 2015 at 03:34:39PM +0100, Ard Biesheuvel wrote: The page size and the number of translation levels, and hence the supported virtual address range, are build-time configurables on arm64 whose optimal

[PATCH roundup 3/4] ARM, arm64: kvm: get rid of the bounce page

2015-03-06 Thread Ard Biesheuvel
unnecessarily if the code was exactly 1 page in size. Tested-by: Marc Zyngier marc.zyng...@arm.com Reviewed-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org --- arch/arm/kernel/vmlinux.lds.S | 26 ++--- arch/arm/kvm/init.S

[PATCH roundup 2/4] ARM: KVM: avoid HYP init code too big error

2015-03-06 Thread Ard Biesheuvel
marc.zyng...@arm.com Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org --- arch/arm/kernel/vmlinux.lds.S | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index b31aa73e8076..2787eb8d3616 100644 --- a/arch

[PATCH roundup 4/4] arm64: KVM: use ID map with increased VA range if required

2015-03-06 Thread Ard Biesheuvel
these two tables into one. Tested-by: Marc Zyngier marc.zyng...@arm.com Reviewed-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org --- arch/arm/include/asm/kvm_mmu.h | 10 ++ arch/arm/kvm/mmu.c | 27 +-- arch

[PATCH roundup 0/4] extend VA range of ID map for core kernel and KVM

2015-03-06 Thread Ard Biesheuvel
it as a single series. Ard Biesheuvel (3): arm64: mm: increase VA range of identity map ARM, arm64: kvm: get rid of the bounce page arm64: KVM: use ID map with increased VA range if required Arnd Bergmann (1): ARM: KVM: avoid HYP init code too big error arch/arm/include/asm/kvm_mmu.h | 10

[PATCH roundup 1/4] arm64: mm: increase VA range of identity map

2015-03-06 Thread Ard Biesheuvel
for the identity mapping only, and only when actually needed, i.e., when system RAM's offset is found to be out of reach at runtime. Tested-by: Laura Abbott lau...@codeaurora.org Reviewed-by: Catalin Marinas catalin.mari...@arm.com Tested-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Ard Biesheuvel

Re: ARM: KVM/XEN: how should we support virt-what?

2015-03-26 Thread Ard Biesheuvel
On 26 March 2015 at 19:45, Stefano Stabellini stefano.stabell...@eu.citrix.com wrote: On Thu, 26 Mar 2015, Andrew Jones wrote: On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: Hello ARM virt maintainers, I'd like to start a discussion about supporting virt-what[1]. virt-what

Re: [Linaro-uefi] UEFI on KVM fails to start on juno on cortex-a57 cluster

2015-03-26 Thread Ard Biesheuvel
On 26 March 2015 at 09:09, Riku Voipio riku.voi...@linaro.org wrote: On 25 March 2015 at 21:32, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 25 March 2015 at 17:14, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 25 March 2015 at 17:14, Ard Biesheuvel ard.biesheu...@linaro.org wrote

Re: [Linaro-uefi] UEFI on KVM fails to start on juno on cortex-a57 cluster

2015-04-14 Thread Ard Biesheuvel
On 14 April 2015 at 13:07, Christoffer Dall christoffer.d...@linaro.org wrote: On Mon, Apr 13, 2015 at 11:04:00AM +0200, Ard Biesheuvel wrote: On 27 March 2015 at 01:02, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 26 March 2015 at 09:09, Riku Voipio riku.voi...@linaro.org wrote: On 25

Re: [PATCH 1/2] ARM: kvm: fix a bad BSYM() usage

2015-05-11 Thread Ard Biesheuvel
On 11 May 2015 at 11:05, Christoffer Dall christoffer.d...@linaro.org wrote: On Sat, May 09, 2015 at 10:10:56PM +0200, Ard Biesheuvel wrote: On 9 May 2015 at 22:07, Christoffer Dall christoffer.d...@linaro.org wrote: On Fri, May 08, 2015 at 05:08:42PM +0100, Russell King wrote: BSYM() should

Re: [PATCH 1/2] ARM: kvm: fix a bad BSYM() usage

2015-05-09 Thread Ard Biesheuvel
On 9 May 2015 at 22:07, Christoffer Dall christoffer.d...@linaro.org wrote: On Fri, May 08, 2015 at 05:08:42PM +0100, Russell King wrote: BSYM() should only be used when refering to local symbols in the same assembly file which are resolved by the assembler, and not for linker-fixed up

Re: [Qemu-devel] [RFC/RFT PATCH v2 0/3] KVM: Introduce KVM_MEM_UNCACHED

2015-05-15 Thread Ard Biesheuvel
On 14 May 2015 at 16:41, Michael S. Tsirkin m...@redhat.com wrote: On Thu, May 14, 2015 at 04:19:23PM +0200, Laszlo Ersek wrote: On 05/14/15 15:48, Michael S. Tsirkin wrote: On Thu, May 14, 2015 at 03:32:10PM +0200, Laszlo Ersek wrote: On 05/14/15 15:00, Andrew Jones wrote: On Thu, May 14,

Re: [Linaro-uefi] UEFI on KVM fails to start on juno on cortex-a57 cluster

2015-04-13 Thread Ard Biesheuvel
On 27 March 2015 at 01:02, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 26 March 2015 at 09:09, Riku Voipio riku.voi...@linaro.org wrote: On 25 March 2015 at 21:32, Ard Biesheuvel ard.biesheu...@linaro.org wrote: On 25 March 2015 at 17:14, Ard Biesheuvel ard.biesheu...@linaro.org wrote

[PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS

2015-06-30 Thread Ard Biesheuvel
This fixes two instances where a pgprot_t is used as the operand of a bitwise operation. In order to comply with STRICT_MM_TYPECHECKS, bitwise arithmetic on a pgprot_t should go via the pgprot_val() accessor. Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Ard Biesheuvel ard.biesheu

Re: [PATCH] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-09 Thread Ard Biesheuvel
On 9 November 2015 at 17:21, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Fri, Nov 06, 2015 at 12:43:08PM +0100, Ard Biesheuvel wrote: >> The open coded tests for checking whether a PTE maps a page as >> uncached use a flawed 'pte_val(xxx) & CONST !=

Re: [PATCH] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-09 Thread Ard Biesheuvel
On 9 November 2015 at 17:35, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Mon, Nov 09, 2015 at 05:27:40PM +0100, Ard Biesheuvel wrote: >> On 9 November 2015 at 17:21, Christoffer Dall >> <christoffer.d...@linaro.org> wrote: >> > On Fri, N

Re: [PATCH v2] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-10 Thread Ard Biesheuvel
(adding lists) On 10 November 2015 at 10:45, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote: > Hi all, > > I wonder if this is a better way to address the problem. It looks at > the nature of the memory rather than the nature of the mapping, which > is probably a mo

Re: [PATCH 15/21] arm64: KVM: Add panic handling

2015-11-16 Thread Ard Biesheuvel
On 16 November 2015 at 14:11, Marc Zyngier wrote: > Add the panic handler, together with the small bits of assembly > code to call the kernel's panic implementation. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/hyp-entry.S | 11

Re: [PATCH v2] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-10 Thread Ard Biesheuvel
On 10 November 2015 at 13:22, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Tue, Nov 10, 2015 at 10:45:37AM +0100, Ard Biesheuvel wrote: >> Hi all, >> >> I wonder if this is a better way to address the problem. It looks at >> the nature of

Re: [PATCH v2] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-10 Thread Ard Biesheuvel
On 10 November 2015 at 14:40, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Tue, Nov 10, 2015 at 02:15:45PM +0100, Ard Biesheuvel wrote: >> On 10 November 2015 at 13:22, Christoffer Dall >> <christoffer.d...@linaro.org> wrote: >> > On Tue, N

Re: [PATCH 9/9] arm/arm64: KVM: arch timer: Reset CNTV_CTL to 0

2015-08-31 Thread Ard Biesheuvel
Cc: Laszlo Ersek <ler...@redhat.com> > Cc: Ard Biesheuvel <ard.biesheu...@linaro.org> > Cc: Drew Jones <drjo...@redhat.com> > Cc: Wei Huang <w...@redhat.com> > Cc: Peter Maydell <peter.mayd...@linaro.org> > Signed-off-by: Christoffer Dall <christoffer

Re: [PATCH 00/14] arm64: 16K translation granule support

2015-09-02 Thread Ard Biesheuvel
s a spin on the FVP Base model to check UEFI booting, and everything seems to work fine. (I tested 2-level and 3-level) I didn't test the KVM changes, so for all patches except those: Reviewed-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheu...@l

Re: [PATCH 12/14] arm64: Check for selected granule support

2015-09-02 Thread Ard Biesheuvel
On 13 August 2015 at 19:29, Catalin Marinas wrote: > On Thu, Aug 13, 2015 at 03:45:07PM +0100, Suzuki K. Poulose wrote: >> On 13/08/15 13:28, Steve Capper wrote: >> >On 13 August 2015 at 12:34, Suzuki K. Poulose >> >wrote: >> >> __enable_mmu: >>

Re: [PATCH 12/14] arm64: Check for selected granule support

2015-09-02 Thread Ard Biesheuvel
On 2 September 2015 at 11:48, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote: > On 13 August 2015 at 19:29, Catalin Marinas <catalin.mari...@arm.com> wrote: >> On Thu, Aug 13, 2015 at 03:45:07PM +0100, Suzuki K. Poulose wrote: >>> On 13/08/15 13:28, Steve Capper

Re: [PATCH 09/15] arm64: Add page size to the kernel image header

2015-10-05 Thread Ard Biesheuvel
On 5 October 2015 at 14:02, Suzuki K. Poulose <suzuki.poul...@arm.com> wrote: > On 02/10/15 16:49, Catalin Marinas wrote: >> >> On Tue, Sep 15, 2015 at 04:41:18PM +0100, Suzuki K. Poulose wrote: >>> >>> From: Ard Biesheuvel <ard.biesheu...@linaro.

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
Hi Pavel, Thanks for getting to the bottom of this. On 1 December 2015 at 14:03, Pavel Fedin wrote: > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > real physical addresses. This causes kvm_is_device_pfn() to return wrong > values, depending

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
On 2 December 2015 at 19:50, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: >> This function takes stage-II physical addresses (A.K.A. IPA), on input, not >> real physical addresses. This causes kvm_is_device_pfn() to return

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-04 Thread Ard Biesheuvel
On 4 December 2015 at 02:58, Ben Hutchings <b...@decadent.org.uk> wrote: > On Wed, 2015-12-02 at 18:41 +0100, Ard Biesheuvel wrote: >> Hi Pavel, >> >> Thanks for getting to the bottom of this. >> >> On 1 December 2015 at 14:03, Pavel Fedin <p.fe...@sa

[PATCH v2] ARM/arm64: KVM: correct PTE uncachedness check

2015-12-03 Thread Ard Biesheuvel
rly for a PTE's uncachedness") Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm/kvm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 7dace909d5cf..61d96a645ff3 100644 --- a/arch/arm/kvm/mmu.

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Ard Biesheuvel
On 3 December 2015 at 08:14, Pavel Fedin wrote: > Hello! > >> > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> > index 7dace90..51ad98f 100644 >> > --- a/arch/arm/kvm/mmu.c >> > +++ b/arch/arm/kvm/mmu.c >> > @@ -310,7 +310,8 @@ static void stage2_flush_ptes(struct

[PATCH] ARM/arm64: KVM: correct PTE uncachedness check

2015-12-03 Thread Ard Biesheuvel
rly for a PTE's uncachedness") Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm/kvm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 7dace909d5cf..9708c342795f 100644 --- a/arch/arm/kvm/mmu.

Re: [PATCH] ARM/arm64: KVM: correct PTE uncachedness check

2015-12-03 Thread Ard Biesheuvel
PLEASE disregard, this patch is wrong. v2 coming up On 3 December 2015 at 09:20, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote: > Commit e6fab5442345 ("ARM/arm64: KVM: test properly for a PTE's > uncachedness") modified the logic to test whether a HYP or stage-2 > map

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-24 Thread Ard Biesheuvel
On 24 June 2016 at 16:04, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote: [...] > Note that this issue not only affects framebuffers on PCI cards, it > also affects emulated USB host controllers (perhaps Alex can remind us > which one exactly?) Actually, looking at the QEMU so

Re: [PATCH] help guest boot up on AArch64 host with GICv2

2016-01-28 Thread Ard Biesheuvel
On 28 January 2016 at 21:12, Chris Metcalf wrote: > On 01/27/2016 04:12 AM, Marc Zyngier wrote: >> >> On 26/01/16 20:43, Chris Metcalf wrote: >>> >>> On 01/18/2016 04:28 AM, Marc Zyngier wrote: Hi Chris, On 15/01/16 20:02, Chris Metcalf wrote: > >

Re: [PATCH v2 06/21] arm64: KVM: VHE: Patch out use of HVC

2016-02-01 Thread Ard Biesheuvel
On 1 February 2016 at 17:20, Marc Zyngier wrote: > On 01/02/16 15:36, Catalin Marinas wrote: >> On Mon, Feb 01, 2016 at 01:34:16PM +, Marc Zyngier wrote: >>> On 01/02/16 13:16, Christoffer Dall wrote: On Mon, Jan 25, 2016 at 03:53:40PM +, Marc Zyngier wrote:

Re: [PATCH] arm64: KVM: Turn kvm_ksym_ref into a NOP on VHE

2016-03-21 Thread Ard Biesheuvel
macro on one. That was the whoie point of the opaque struct type in the original patch that introduced this macro, to disallow references lacking the &, but unfortunately, that was incompatible with the other VHE changes. With that fixed Acked-by: Ard Biesheuvel <ard.biesheu...@linaro.org>

Re: [PATCH] arm64: KVM: Move kvm_call_hyp back to its original localtion

2016-03-01 Thread Ard Biesheuvel
<marc.zyng...@arm.com> Acked-by: Ard Biesheuvel <ard.biesheu...@linaro.org> > --- > Catalin, > > Would you mind merging this on top of arm64/for-next/core? I just > verified that this prevents yet another mismerge between the arm64 and > KVM trees. > > Thanks,

Re: usb keyboard and mouse can't work on QEMU ARM64 with KVM

2016-07-26 Thread Ard Biesheuvel
On 26 July 2016 at 09:34, Shannon Zhao wrote: > Hi, > > Recently I'm trying to use usb keyboard and mouse with QEMU on ARM64. Below > is my QEMU command line, > host and guest kernel both are 4.7.0-rc7+, and I ran it on Hikey board. > > qemu-system-aarch64 \ >

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-27 Thread Ard Biesheuvel
On 27 June 2016 at 15:35, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Mon, Jun 27, 2016 at 02:30:46PM +0200, Ard Biesheuvel wrote: >> On 27 June 2016 at 12:34, Christoffer Dall <christoffer.d...@linaro.org> >> wrote: >> > On Mon, Jun 27, 2016

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-27 Thread Ard Biesheuvel
On 27 June 2016 at 12:34, Christoffer Dall <christoffer.d...@linaro.org> wrote: > On Mon, Jun 27, 2016 at 11:47:18AM +0200, Ard Biesheuvel wrote: >> On 27 June 2016 at 11:16, Christoffer Dall <christoffer.d...@linaro.org> >> wrote: >> > Hi, >> > >

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-27 Thread Ard Biesheuvel
On 27 June 2016 at 11:16, Christoffer Dall <christoffer.d...@linaro.org> wrote: > Hi, > > I'm going to ask some stupid questions here... > > On Fri, Jun 24, 2016 at 04:04:45PM +0200, Ard Biesheuvel wrote: >> Hi all, >> >> This old subject came up again

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Ard Biesheuvel
; On Mon, Jun 27, 2016 at 03:57:28PM +0200, Ard Biesheuvel wrote: >> > >> So if vga-pci.c is the only problematic device, for which a reasonable >> > >> alternative exists (virtio-gpu), I think the only feasible solution is >> > >> to educate QEMU not to

Re: [PATCH 05/15] arm64: KVM: Refactor kern_hyp_va/hyp_kern_va to deal with multiple offsets

2016-06-30 Thread Ard Biesheuvel
On 30 June 2016 at 12:16, Marc Zyngier wrote: > On 30/06/16 10:22, Marc Zyngier wrote: >> On 28/06/16 13:42, Christoffer Dall wrote: >>> On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote: As we move towards a selectable HYP VA range, it is obvious that

Re: [PATCH 05/15] arm64: KVM: Refactor kern_hyp_va/hyp_kern_va to deal with multiple offsets

2016-06-30 Thread Ard Biesheuvel
On 30 June 2016 at 13:02, Marc Zyngier <marc.zyng...@arm.com> wrote: > On 30/06/16 11:42, Ard Biesheuvel wrote: >> On 30 June 2016 at 12:16, Marc Zyngier <marc.zyng...@arm.com> wrote: >>> On 30/06/16 10:22, Marc Zyngier wrote: >>>> On 28/06/16 13:42, Ch

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Ard Biesheuvel
On 28 June 2016 at 12:55, Laszlo Ersek <ler...@redhat.com> wrote: > On 06/27/16 12:34, Christoffer Dall wrote: >> On Mon, Jun 27, 2016 at 11:47:18AM +0200, Ard Biesheuvel wrote: > >>> So first of all, let me reiterate that I could only find a single >>> inst

Re: [PATCH 13/20] ARM: KVM: Implement HVC_RESET_VECTORS stub hypercall

2017-02-19 Thread Ard Biesheuvel
On 17 February 2017 at 15:44, Marc Zyngier wrote: > In order to restore HYP mode to its original condition, KVM currently > implements __kvm_hyp_reset(). As we're moving towards a hyp-stub > defined API, it becomes necessary to implement HVC_RESET_VECTORS. > > This patch

Re: [PATCH 13/20] ARM: KVM: Implement HVC_RESET_VECTORS stub hypercall

2017-02-19 Thread Ard Biesheuvel
On 17 February 2017 at 15:44, Marc Zyngier wrote: > In order to restore HYP mode to its original condition, KVM currently > implements __kvm_hyp_reset(). As we're moving towards a hyp-stub > defined API, it becomes necessary to implement HVC_RESET_VECTORS. > > This patch

Re: [PATCH 10/20] ARM: hyp-stub: Use r1 for the soft-restart address

2017-02-19 Thread Ard Biesheuvel
On 17 February 2017 at 15:44, Marc Zyngier wrote: > It is not really obvious why the restart address should be in r3 > when communicated to the hyp-stub. r1 should be perfectly adequate, > and consistent with the rest of the code. > > Signed-off-by: Marc Zyngier

[PATCH v2 5/5] arm64: mmu: apply strict permissions to .init.text and .init.data

2017-02-11 Thread Ard Biesheuvel
, and the linear alias of the init region is always mapped writable (but never executable). Since the alternatives descriptions themselves are read-only data, move those into the .init.text region. Reviewed-by: Laura Abbott <labb...@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@l

[PATCH v2 0/5] arm64: mmu: avoid writeable-executable mappings

2017-02-11 Thread Ard Biesheuvel
between the segments results in a peculiar situation where other unrelated allocations end up right in the middle of the kernel Image, which is probably a bad idea (#5). See below for an example. - add acks Ard Biesheuvel (5): arm: kvm: move kvm_vgic_global_state out of .text section arm64

[PATCH v2 1/5] arm: kvm: move kvm_vgic_global_state out of .text section

2017-02-11 Thread Ard Biesheuvel
Zyngier <marc.zyng...@arm.com> Reviewed-by: Laura Abbott <labb...@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- virt/kvm/arm/vgic/vgic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm

[PATCH v2 2/5] arm64: mmu: move TLB maintenance from callers to create_mapping_late()

2017-02-11 Thread Ard Biesheuvel
appropriate here. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 2131521ddc24..9e0ec1a8cd3b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/ar

[PATCH v2 3/5] arm64: alternatives: apply boot time fixups via the linear mapping

2017-02-11 Thread Ard Biesheuvel
patching has completed. Reviewed-by: Laura Abbott <labb...@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/mmu.h| 1 + arch/arm64/kernel/alternative.c | 2 +- arch/arm64/kernel/smp.c | 1 + arch/arm64/mm/mmu.c

[PATCH v2 4/5] arm64: mmu: map .text as read-only from the outset

2017-02-11 Thread Ard Biesheuvel
<keesc...@chromium.org> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 7ed981c7f4c0..e97f1ce967ec 100644 --- a/arch/arm64/mm/mmu.c +

Re: [PATCH 2/4] arm64: alternatives: apply boot time fixups via the linear mapping

2017-02-10 Thread Ard Biesheuvel
> On 10 Feb 2017, at 18:49, Suzuki K Poulose <suzuki.poul...@arm.com> wrote: > >> On 10/02/17 17:16, Ard Biesheuvel wrote: >> One important rule of thumb when designing a secure software system is >> that memory should never be writable and executable at the

[PATCH 0/4] arm64: mmu: avoid writeable-executable mappings

2017-02-10 Thread Ard Biesheuvel
by: - making the alternatives patching use the linear mapping - splitting the init region into separate text and data regions This removes all RWX mappings except the really early one created in head.S (which we could perhaps fix in the future as well) Ard Biesheuvel (4): arm: kvm: move

[PATCH 2/4] arm64: alternatives: apply boot time fixups via the linear mapping

2017-02-10 Thread Ard Biesheuvel
patching has completed. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/mmu.h| 1 + arch/arm64/kernel/alternative.c | 6 ++--- arch/arm64/kernel/smp.c | 1 + arch/arm64/mm/mmu.c | 25 4 files changed, 25 inse

[PATCH 3/4] arm64: mmu: map .text as read-only from the outset

2017-02-10 Thread Ard Biesheuvel
Now that alternatives patching code no longer relies on the primary mapping of .text being writable, we can remove the code that removes the writable permissions post-init time, and map it read-only from the outset. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/ar

[PATCH 4/4] arm64: mmu: apply strict permissions to .init.text and .init.data

2017-02-10 Thread Ard Biesheuvel
mapping entirely. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/sections.h | 3 +- arch/arm64/kernel/vmlinux.lds.S | 32 ++-- arch/arm64/mm/init.c | 3 +- arch/arm64/mm/mmu.c | 12 +--- 4 files chang

Re: [PATCH v2 4/5] arm64: mmu: map .text as read-only from the outset

2017-02-14 Thread Ard Biesheuvel
> On 14 Feb 2017, at 15:57, Mark Rutland <mark.rutl...@arm.com> wrote: > >> On Sat, Feb 11, 2017 at 08:23:05PM +0000, Ard Biesheuvel wrote: >> Now that alternatives patching code no longer relies on the primary >> mapping of .text being writable, we ca

Re: [PATCH v2 4/5] arm64: mmu: map .text as read-only from the outset

2017-02-14 Thread Ard Biesheuvel
> On 14 Feb 2017, at 17:40, Mark Rutland <mark.rutl...@arm.com> wrote: > >> On Tue, Feb 14, 2017 at 04:15:11PM +0000, Ard Biesheuvel wrote: >> >>>> On 14 Feb 2017, at 15:57, Mark Rutland <mark.rutl...@arm.com> wrote: >>>> >>>&

[PATCH v3 2/5] arm64: mmu: move TLB maintenance from callers to create_mapping_late()

2017-02-14 Thread Ard Biesheuvel
-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/ar

[PATCH v3 3/5] arm64: alternatives: apply boot time fixups via the linear mapping

2017-02-14 Thread Ard Biesheuvel
patching has completed. Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/mmu.h| 1 + arch/ar

[PATCH v3 5/5] arm64: mmu: apply strict permissions to .init.text and .init.data

2017-02-14 Thread Ard Biesheuvel
, and the linear alias of the init region is always mapped writable (but never executable). Since the alternatives descriptions themselves are read-only data, move those into the .init.text region. Reviewed-by: Laura Abbott <labb...@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@l

[PATCH v3 0/5] arm64: mmu: avoid writeable-executable mappings

2017-02-14 Thread Ard Biesheuvel
of the kernel Image, which is probably a bad idea (#5). See below for an example. - add acks Ard Biesheuvel (5): arm: kvm: move kvm_vgic_global_state out of .text section arm64: mmu: move TLB maintenance from callers to create_mapping_late() arm64: alternatives: apply boot time fixups via

[PATCH v3 1/5] arm: kvm: move kvm_vgic_global_state out of .text section

2017-02-14 Thread Ard Biesheuvel
Zyngier <marc.zyng...@arm.com> Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- virt/kvm/arm/vgic/vgic.c | 4 +++-

Re: [PATCH V10 03/10] efi: parse ARM processor error

2017-02-16 Thread Ard Biesheuvel
ovides more detail on for processor error logs. > > Signed-off-by: Tyler Baicar <tbai...@codeaurora.org> > Signed-off-by: Jonathan (Zhixiong) Zhang <zjzh...@codeaurora.org> > Signed-off-by: Naveen Kaje <nk...@codeaurora.org> > Reviewed-by: James Morse <james.mo

Re: [PATCH V10 05/10] acpi: apei: handle SEA notification type for ARMv8

2017-02-16 Thread Ard Biesheuvel
On 15 February 2017 at 19:51, Tyler Baicar wrote: > ARM APEI extension proposal added SEA (Synchronous External Abort) > notification type for ARMv8. > Add a new GHES error source handling function for SEA. If an error > source's notification type is SEA, then this

Re: [PATCH V10 02/10] ras: acpi/apei: cper: generic error data entry v3 per ACPI 6.1

2017-02-16 Thread Ard Biesheuvel
a.org> > Reviewed-by: James Morse <james.mo...@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheu...@linaro.org> > --- > drivers/acpi/apei/ghes.c| 9 --- > drivers/firmware/efi/cper.c | 63 > +++-- > include/acpi/

Re: [PATCH v3 0/2] KVM: ARM: Enable vtimers with user space gic

2016-09-17 Thread Ard Biesheuvel
On 16 September 2016 at 13:44, Alexander Graf wrote: > >> On 16 Sep 2016, at 14:40, Paolo Bonzini wrote: >> >> >> >> On 16/09/2016 14:29, Christoffer Dall wrote: It may be useful for migrating a gicv2 VM to a gicv3 host without gicv2 emulation as

Re: [PATCH v3 0/2] KVM: ARM: Enable vtimers with user space gic

2016-09-17 Thread Ard Biesheuvel
On 17 September 2016 at 16:38, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 17 September 2016 at 16:28, Ard Biesheuvel <ard.biesheu...@linaro.org> > wrote: >> Another thing to keep in mind is that GICv2 >> compatibility is disabled on the non-secure sid

Re: [PATCH 2/2] arm64: Support systems without FP/ASIMD

2016-10-25 Thread Ard Biesheuvel
> make sure that the FP/ASIMD is supported. > > Cc: Catalin Marinas <catalin.mari...@arm.com> > Cc: Will Deacon <will.dea...@arm.com> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Cc: Marc Zyngier <marc.zyng...@arm.com> > Cc: Ard Biesheuvel

Re: [PATCH v5 10/10] arm64: mm: set the contiguous bit for kernel mappings where appropriate

2017-03-09 Thread Ard Biesheuvel
On 9 March 2017 at 20:33, Mark Rutland <mark.rutl...@arm.com> wrote: > On Thu, Mar 09, 2017 at 09:25:12AM +0100, Ard Biesheuvel wrote: >> +static inline u64 pte_cont_addr_end(u64 addr, u64 end) >> +{ >> + return min((addr + CONT_PTE_SIZE) & CONT_PTE_MASK, end); &

[PATCH v4 2/6] arm64: mmu: move TLB maintenance from callers to create_mapping_late()

2017-03-04 Thread Ard Biesheuvel
-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/ar

[PATCH v4 1/6] arm: kvm: move kvm_vgic_global_state out of .text section

2017-03-04 Thread Ard Biesheuvel
Zyngier <marc.zyng...@arm.com> Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- virt/kvm/arm/vgic/vgic.c | 4 +++-

[PATCH v4 5/6] arm64: mmu: apply strict permissions to .init.text and .init.data

2017-03-04 Thread Ard Biesheuvel
, and the linear alias of the init region is always mapped writable (but never executable). Since the alternatives descriptions themselves are read-only data, move those into the .init.text region. Reviewed-by: Laura Abbott <labb...@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@l

[PATCH v4 6/6] arm64: mm: set the contiguous bit for kernel mappings where appropriate

2017-03-04 Thread Ard Biesheuvel
configuration only consists of PGDs and PTEs, and the added complexity of dealing with folded PMDs is not justified considering that 16 GB contiguous ranges are likely to be ignored by the hardware (and 16k/2 levels is a niche configuration) Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.

[PATCH v4 3/6] arm64: alternatives: apply boot time fixups via the linear mapping

2017-03-04 Thread Ard Biesheuvel
patching has completed. Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/mmu.h| 1 + arch/ar

[PATCH v4 4/6] arm64: mmu: map .text as read-only from the outset

2017-03-04 Thread Ard Biesheuvel
by external debuggers to manage software breakpoints (as pointed out by Mark), add an early_param() check for rodata=, and use RWX permissions if it set to 'off'. Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Ard Biesheuvel

[PATCH v5 09/10] arm64/mmu: replace 'page_mappings_only' parameter with flags argument

2017-03-09 Thread Ard Biesheuvel
In preparation of extending the policy for manipulating kernel mappings with whether or not contiguous hints may be used in the page tables, replace the bool 'page_mappings_only' with a flags field and a flag NO_BLOCK_MAPPINGS. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> ---

[PATCH v5 10/10] arm64: mm: set the contiguous bit for kernel mappings where appropriate

2017-03-09 Thread Ard Biesheuvel
configuration only consists of PGDs and PTEs, and the added complexity of dealing with folded PMDs is not justified considering that 16 GB contiguous ranges are likely to be ignored by the hardware (and 16k/2 levels is a niche configuration) Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.

[PATCH v5 02/10] arm64: mmu: move TLB maintenance from callers to create_mapping_late()

2017-03-09 Thread Ard Biesheuvel
-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/ar

[PATCH v5 03/10] arm64: alternatives: apply boot time fixups via the linear mapping

2017-03-09 Thread Ard Biesheuvel
patching has completed. Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/mmu.h| 1 + arch/ar

[PATCH v5 01/10] arm: kvm: move kvm_vgic_global_state out of .text section

2017-03-09 Thread Ard Biesheuvel
Zyngier <marc.zyng...@arm.com> Reviewed-by: Laura Abbott <labb...@redhat.com> Reviewed-by: Mark Rutland <mark.rutl...@arm.com> Tested-by: Mark Rutland <mark.rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- virt/kvm/arm/vgic/vgic.c | 4 +++-

[PATCH v5 00/10] arm64: mmu: avoid W+X mappings and re-enable PTE_CONT for kernel

2017-03-09 Thread Ard Biesheuvel
commit log of #2 - add acks Ard Biesheuvel (10): arm: kvm: move kvm_vgic_global_state out of .text section arm64: mmu: move TLB maintenance from callers to create_mapping_late() arm64: alternatives: apply boot time fixups via the linear mapping arm64: mmu: map .text as read-only from

[PATCH v5 04/10] arm64: mmu: map .text as read-only from the outset

2017-03-09 Thread Ard Biesheuvel
rutl...@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index df377fbe464e..300e98e8cd63 100644 --- a/arch/arm64/mm/m

[PATCH v5 08/10] arm64/mmu: add contiguous bit to sanity bug check

2017-03-09 Thread Ard Biesheuvel
A mapping with the contiguous bit cannot be safely manipulated while live, regardless of whether the bit changes between the old and new mapping. So take this into account when deciding whether the change is safe. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm

[PATCH v5 07/10] arm64/mmu: ignore debug_pagealloc for kernel segments

2017-03-09 Thread Ard Biesheuvel
can use block mappings unconditionally. Note that this applies equally to the linear alias of text/rodata: we will never have dynamic allocations there given that the same memory is statically in use by the kernel image. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/ar

[PATCH v5 05/10] arm64: mmu: apply strict permissions to .init.text and .init.data

2017-03-09 Thread Ard Biesheuvel
; Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/include/asm/sections.h | 2 ++ arch/arm64/kernel/vmlinux.lds.S | 25 +--- arch/arm64/mm/mmu.c | 12 ++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/arch/arm64/incl

[PATCH v5 06/10] arm64/mmu: align alloc_init_pte prototype with pmd/pud versions

2017-03-09 Thread Ard Biesheuvel
Align the function prototype of alloc_init_pte() with its pmd and pud counterparts by replacing the pfn parameter with the equivalent physical address. Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- arch/arm64/mm/mmu.c | 8 1 file changed, 4 insertions(+), 4 del

Re: [PATCH v4 6/6] arm64: mm: set the contiguous bit for kernel mappings where appropriate

2017-03-08 Thread Ard Biesheuvel
On 7 March 2017 at 17:46, Mark Rutland <mark.rutl...@arm.com> wrote: > Hi, > > On Sat, Mar 04, 2017 at 02:30:48PM +, Ard Biesheuvel wrote: >> This is the third attempt at enabling the use of contiguous hints for >> kernel mappings. The most recent attempt 0bfc

Re: [PATCH] arm64: Add ASM modifier for xN register operands

2017-04-24 Thread Ard Biesheuvel
On 24 April 2017 at 18:00, Will Deacon wrote: > Hi Matthias, > > On Thu, Apr 20, 2017 at 11:30:53AM -0700, Matthias Kaehlcke wrote: >> Many inline assembly statements don't include the 'x' modifier when >> using xN registers as operands. This is perfectly valid, however it >>

Re: [PATCH 16/27] arm64/sve: Preserve SVE registers around kernel-mode NEON use

2017-08-15 Thread Ard Biesheuvel
_flag(TIF_FOREIGN_FPSTATE); > + } > > /* Invalidate any task state remaining in the fpsimd regs: */ > __this_cpu_write(fpsimd_last_state, NULL); Reviewed-by: Ard Biesheuvel <ard.biesheu...@linaro.org> ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH 11/27] arm64/sve: Core task context handling

2017-08-15 Thread Ard Biesheuvel
Hi Dave, On 9 August 2017 at 13:05, Dave Martin wrote: > This patch adds the core support for switching and managing the SVE > architectural state of user tasks. > > Calls to the existing FPSIMD low-level save/restore functions are > factored out as new functions

Re: [PATCH 17/27] arm64/sve: Preserve SVE registers around EFI runtime service calls

2017-08-15 Thread Ard Biesheuvel
e_used))) { > + char const *sve_state = this_cpu_ptr(efi_sve_state); > + > + sve_load_state(sve_state + sve_ffr_offset(sve_max_vl), > + _cpu_ptr(_fpsimd_state)->fpsr, &g

Re: [PATCH 05/27] arm64: fpsimd: Simplify uses of {set, clear}_ti_thread_flag()

2017-08-15 Thread Ard Biesheuvel
is verbosity isn't strictly needed. > > For consistency, this patch simplifies the affected calls. This > should have no impact on behaviour. > > Signed-off-by: Dave Martin <dave.mar...@arm.com> Acked-by: Ard Biesheuvel <ard.biesheu...@linaro.org> > --- > arch/ar

Re: [PATCH 12/15] arm-soc: omap: replace open coded VA->PA calculations

2017-08-10 Thread Ard Biesheuvel
On 9 August 2017 at 22:05, Tony Lindgren <t...@atomide.com> wrote: > * Ard Biesheuvel <ard.biesheu...@linaro.org> [170809 12:24]: >> On 9 August 2017 at 20:05, Tony Lindgren <t...@atomide.com> wrote: >> > * Ard Biesheuvel <ard.biesheu...@linaro.org> [1

  1   2   3   >