Re: [PATCH v10 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2019-02-18 Thread Christoffer Dall
On Mon, Jan 14, 2019 at 04:11:47PM +, Andrew Murray wrote: > Add support for the :G and :H attributes in perf by handling the > exclude_host/exclude_guest event attributes. > > We notify KVM of counters that we wish to be enabled or disabled on > guest entry/exit and thus defer from starting

Re: [PATCH v2 1/4] KVM: arm64: Forbid kprobing of the VHE world-switch code

2019-02-01 Thread Christoffer Dall
On Thu, Jan 31, 2019 at 06:53:06PM +, James Morse wrote: > Hey Christoffer, > > On 31/01/2019 08:08, Christoffer Dall wrote: > > On Thu, Jan 24, 2019 at 04:32:54PM +, James Morse wrote: > >> On systems with VHE the kernel and KVM's world-switch code run at the &

Re: [PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-31 Thread Christoffer Dall
On Thu, Jan 31, 2019 at 06:06:09PM +0100, Andrew Jones wrote: > On Thu, Jan 31, 2019 at 02:52:11PM +, Marc Zyngier wrote: > > On 31/01/2019 12:57, Andrew Jones wrote: > > > On Thu, Jan 31, 2019 at 12:51:56PM +0100, Christoffer Dall wrote: > > > > [...] >

Re: [PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-31 Thread Christoffer Dall
On Thu, Jan 31, 2019 at 01:57:12PM +0100, Andrew Jones wrote: > On Thu, Jan 31, 2019 at 12:51:56PM +0100, Christoffer Dall wrote: > > On Thu, Jan 31, 2019 at 11:12:54AM +0100, Andrew Jones wrote: > > > On Thu, Jan 31, 2019 at 08:43:53AM +0100, Christoffer Dall wrote: > >

Re: [PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-31 Thread Christoffer Dall
On Thu, Jan 31, 2019 at 11:12:54AM +0100, Andrew Jones wrote: > On Thu, Jan 31, 2019 at 08:43:53AM +0100, Christoffer Dall wrote: > > On Wed, Jan 30, 2019 at 04:27:21PM +0100, Andrew Jones wrote: > > > On Wed, Jan 30, 2019 at 10:34:31AM +0100, Christoffer Dall wrote: > >

[PATCH v2 4/4] KVM: mips: Move to common kvm_mmu_memcache infrastructure

2019-01-31 Thread Christoffer Dall
Now that we have a common infrastructure for doing MMU cache allocations, use this for mips as well. Signed-off-by: Christoffer Dall --- arch/mips/include/asm/kvm_host.h | 15 ++--- arch/mips/include/asm/kvm_types.h | 7 arch/mips/kvm/mips.c | 2 +- arch/mips/kvm/mmu.c

[PATCH v2 2/4] KVM: x86: Rename mmu_memory_cache to kvm_mmu_memcache

2019-01-31 Thread Christoffer Dall
to memcache to avoid overly long lines. This is a bit tedious on the callsites but ends up looking more palatable. Signed-off-by: Christoffer Dall --- arch/x86/include/asm/kvm_host.h | 6 ++--- arch/x86/include/asm/kvm_types.h | 4 ++-- arch/x86/kvm/mmu.c | 38

[PATCH v2 0/3] KVM: Unify mmu_memory_cache functionality across architectures

2019-01-31 Thread Christoffer Dall
this functionality. - Rename KVM_NR_MEM_OBJS to KVM_MMU_NR_MEMCACHE_OBJS --- Christoffer Dall (4): KVM: x86: Move mmu_memory_cache functions to common code KVM: x86: Rename mmu_memory_cache to kvm_mmu_memcache KVM: arm/arm64: Move to common kvm_mmu_memcache infrastructure KVM: mips: Move

[PATCH v2 3/4] KVM: arm/arm64: Move to common kvm_mmu_memcache infrastructure

2019-01-31 Thread Christoffer Dall
. Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h| 13 +- arch/arm/include/asm/kvm_mmu.h | 2 +- arch/arm/include/asm/kvm_types.h | 7 +++ arch/arm64/include/asm/kvm_host.h | 13 +- arch/arm64/include/asm/kvm_mmu.h | 2 +- arch/arm64/include/asm/kvm_types.h

[PATCH v2 1/4] KVM: x86: Move mmu_memory_cache functions to common code

2019-01-31 Thread Christoffer Dall
architectures require the mmu memory cache. Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_types.h | 5 +++ arch/arm64/include/asm/kvm_types.h | 6 +++ arch/mips/include/asm/kvm_types.h| 5 +++ arch/powerpc/include/asm/kvm_types.h | 5 +++ arch/s390/include/asm

Re: [PATCH v2 1/4] KVM: arm64: Forbid kprobing of the VHE world-switch code

2019-01-31 Thread Christoffer Dall
On Thu, Jan 24, 2019 at 04:32:54PM +, James Morse wrote: > On systems with VHE the kernel and KVM's world-switch code run at the > same exception level. Code that is only used on a VHE system does not > need to be annotated as __hyp_text as it can reside anywhere in the > kernel text. > >

Re: [PATCH v2 2/4] arm64: kprobe: Always blacklist the KVM world-switch code

2019-01-31 Thread Christoffer Dall
> Signed-off-by: James Morse > Acked-by: Masami Hiramatsu Reviewed-by: Christoffer Dall > --- > arch/arm64/kernel/probes/kprobes.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/probes/kprobes.c > b/arch/arm64/kernel/pr

Re: [PATCH v2 3/4] arm64: hyp-stub: Forbid kprobing of the hyp-stub

2019-01-31 Thread Christoffer Dall
On Thu, Jan 24, 2019 at 04:32:56PM +, James Morse wrote: > The hyp-stub is loaded by the kernel's early startup code at EL2 > during boot, before KVM takes ownership later. The hyp-stub's > text is part of the regular kernel text, meaning it can be kprobed. > > A breakpoint in the hyp-stub

Re: [PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-30 Thread Christoffer Dall
On Wed, Jan 30, 2019 at 04:27:21PM +0100, Andrew Jones wrote: > On Wed, Jan 30, 2019 at 10:34:31AM +0100, Christoffer Dall wrote: > > On Tue, Jan 29, 2019 at 05:03:47PM +0100, Andrew Jones wrote: > > > On Fri, Jan 25, 2019 at 10:46:53AM +0100, Christoffer Dall wrote: > >

Re: [PATCH v9 10/26] arm64: kvm: Unmask PMR before entering guest

2019-01-30 Thread Christoffer Dall
daif_restore with DAIF_PROCCTX_NOIRQ, which actually does both of the things in (5). > Avoid this by making sure ICC_PMR_EL1 is unmasked when we enter a guest. > > Signed-off-by: Julien Thierry > Acked-by: Catalin Marinas > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Catalin

Re: [PATCH 5/5] arm/arm64: KVM: Don't panic on failure to properly reset system registers

2019-01-30 Thread Christoffer Dall
On Tue, Jan 29, 2019 at 05:33:37PM +0100, Andrew Jones wrote: > On Fri, Jan 25, 2019 at 10:46:56AM +0100, Christoffer Dall wrote: > > From: Marc Zyngier > > > > Failing to properly reset system registers is pretty bad. But not > > quite as bad as bringing the whole mac

Re: [PATCH 3/5] KVM: arm/arm64: Require VCPU threads to turn them self off

2019-01-30 Thread Christoffer Dall
On Tue, Jan 29, 2019 at 05:16:44PM +0100, Andrew Jones wrote: > > Summary edit > > > KVM: arm/arm64: Require VCPU threads to turn them self off > > themselves > > On Fri, Jan 25, 2019 at 10:46:54AM +0100, Christoffer Dall wrote: > > To avoid a race between t

Re: [PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-30 Thread Christoffer Dall
On Tue, Jan 29, 2019 at 05:03:47PM +0100, Andrew Jones wrote: > On Fri, Jan 25, 2019 at 10:46:53AM +0100, Christoffer Dall wrote: > > From: Marc Zyngier > > > > The current kvm_psci_vcpu_on implementation will directly try to > > manipulate the state of the VCPU t

Re: [PATCH 1/5] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

2019-01-30 Thread Christoffer Dall
On Tue, Jan 29, 2019 at 04:05:25PM +, Marc Zyngier wrote: > Hi Drew, > > On Tue, 29 Jan 2019 15:48:58 +, > Andrew Jones wrote: > > > > Hi Christoffer, > > > > On Fri, Jan 25, 2019 at 10:46:52AM +0100, Christoffer Dall wrote: > > > Resettin

Re: [PATCH 1/3] KVM: x86: Move mmu_memory_cache functions to common code

2019-01-29 Thread Christoffer Dall
On Mon, Jan 28, 2019 at 08:19:56AM -0800, Sean Christopherson wrote: > On Mon, Jan 28, 2019 at 03:48:41PM +0100, Christoffer Dall wrote: > > We are currently duplicating the mmu memory cache functionality quite > > heavily between the architectures that support KVM. As a first

[PATCH 3/3] KVM: mips: Move to common kvm_mmu_memcache infrastructure

2019-01-28 Thread Christoffer Dall
Now that we have a common infrastructure for doing MMU cache allocations, use this for mips as well. Signed-off-by: Christoffer Dall --- arch/mips/include/asm/kvm_host.h | 15 ++--- arch/mips/include/asm/kvm_types.h | 5 +++ arch/mips/kvm/mips.c | 2 +- arch/mips/kvm/mmu.c

[PATCH 2/3] KVM: arm/arm64: Move to common kvm_mmu_memcache infrastructure

2019-01-28 Thread Christoffer Dall
. Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h| 13 +- arch/arm/include/asm/kvm_mmu.h | 2 +- arch/arm/include/asm/kvm_types.h | 5 +++ arch/arm64/include/asm/kvm_host.h | 13 +- arch/arm64/include/asm/kvm_mmu.h | 2 +- arch/arm64/include/asm/kvm_types.h

[PATCH 1/3] KVM: x86: Move mmu_memory_cache functions to common code

2019-01-28 Thread Christoffer Dall
KVM_NR_MEM_OBJS is defined. As we move each architecture to the common implementation, this condition will eventually go away. Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_types.h | 5 ++ arch/arm64/include/asm/kvm_types.h | 6 ++ arch/mips/include/asm/kvm_types.h| 5

[PATCH 0/3] KVM: Unify mmu_memory_cache functionality across architectures

2019-01-28 Thread Christoffer Dall
on arm/arm64, and only compile-tested on x86 and mips. Christoffer Dall (3): KVM: x86: Move mmu_memory_cache functions to common code KVM: arm/arm64: Move to common kvm_mmu_memcache infrastructure KVM: mips: Move to common kvm_mmu_memcache infrastructure arch/arm/include/asm/kvm_host.h

Re: [PATCH 0/3] KVM: arm/arm64: trivial header path sanitization

2019-01-25 Thread Christoffer Dall
cture of this work, > the full patch set is available at: > > git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git > build-test Changes appear fine to me: Acked-by: Christoffer Dall ___ kvmarm mailing list kvma

[PATCH 2/5] arm/arm64: KVM: Allow a VCPU to fully reset itself

2019-01-25 Thread Christoffer Dall
at the same time. Fix this by factoring out all reset logic from the PSCI implementation and forwarding the required information along with a request to the target VCPU. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h | 10 + arch/arm/kvm/reset.c

[PATCH 3/5] KVM: arm/arm64: Require VCPU threads to turn them self off

2019-01-25 Thread Christoffer Dall
To avoid a race between turning VCPUs off and turning them on, make sure that only the VCPU threat itself turns off the VCPU. When other threads want to turn of a VCPU, they now do this via a request. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h

[PATCH 1/5] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

2019-01-25 Thread Christoffer Dall
logic. Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier --- arch/arm64/kvm/reset.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index b72a3dd56204..f21a2a575939 100644 --- a/arch/arm64

[PATCH 0/5] KVM: arm/arm64: Fix VCPU power management problems

2019-01-25 Thread Christoffer Dall
. - Powering off a VCPU could race with powering on the same VCPU. - We unnecesarily panic'ed if we found a non-initialized guest system register. The main approach to fixing all these problems is by using VCPU requests. See the individual patches for more details. Christoffer Dall (3): KVM: arm

[PATCH 05/14] arm/arm64: KVM: Statically configure the host's view of MPIDR

2019-01-24 Thread Christoffer Dall
of the above is that we can perfectly avoid the eager saving of MPIDR_EL1, and only keep the restore. We just have to setup the host contexts appropriately at boot time. Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h | 8 arch/arm/kvm/hyp/cp15

[PATCH 01/14] arm/arm64: KVM: Introduce kvm_call_hyp_ret()

2019-01-24 Thread Christoffer Dall
-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h | 3 +++ arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/debug.c| 2 +- virt/kvm/arm/arm.c| 2 +- virt/kvm/arm/vgic/vgic-v3.c | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm

[PATCH 12/14] KVM: arm/arm64: arch_timer: Assign the phys timer on VHE systems

2019-01-24 Thread Christoffer Dall
on this architecture. Co-written with Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_hyp.h | 4 + include/kvm/arm_arch_timer.h | 6 + virt/kvm/arm/arch_timer.c | 206 ++--- 3 files changed, 171 insertions

[PATCH 03/14] arm64: KVM: Drop VHE-specific HYP call stub

2019-01-24 Thread Christoffer Dall
From: Marc Zyngier We now call VHE code directly, without going through any central dispatching function. Let's drop that code. Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm64/kvm/hyp.S | 3 --- arch/arm64/kvm/hyp/hyp-entry.S | 12 2 files

[PATCH 13/14] KVM: arm/arm64: Rework the timer code to use a timer_map

2019-01-24 Thread Christoffer Dall
-by: Christoffer Dall --- include/kvm/arm_arch_timer.h | 22 +-- virt/kvm/arm/arch_timer.c| 295 +++ virt/kvm/arm/trace.h | 105 + 3 files changed, 276 insertions(+), 146 deletions(-) diff --git a/include/kvm/arm_arch_timer.h b/include/kvm

[PATCH 06/14] KVM: arm/arm64: Factor out VMID into struct kvm_vmid

2019-01-24 Thread Christoffer Dall
value in kvm_get_vttbr and rely on update_vmid to always assign a valid vmid value (within the supported range). Signed-off-by: Christoffer Dall Reviewed-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 13 --- arch/arm/include/asm/kvm_mmu.h| 11 ++ arch/arm/kvm/hyp/switch.c

[PATCH 02/14] arm64: KVM: Allow for direct call of HYP functions when using VHE

2019-01-24 Thread Christoffer Dall
it allows the compiler to check for type compatibility, something that we are missing so far. Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm64/include/asm/kvm_host.h | 32 +-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/arm64/i

[PATCH 14/14] KVM: arm/arm64: Move kvm_is_write_fault to header file

2019-01-24 Thread Christoffer Dall
From: Christoffer Dall Move this little function to the header files for arm/arm64 so other code can make use of it directly. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 8 arch/arm64/include/asm/kvm_emulate.h | 8 virt

[PATCH 08/14] KVM: arm64: Fix ICH_ELRSR_EL2 sysreg naming

2019-01-24 Thread Christoffer Dall
From: Marc Zyngier We previously incorrectly named the define for this system register. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/arch_gicv3.h | 4 ++-- arch/arm64/include/asm/sysreg.h | 2 +- virt/kvm/arm/hyp/vgic-v3-sr.c | 2 +- 3 files

[PATCH 11/14] KVM: arm/arm64: timer: Rework data structures for multiple timers

2019-01-24 Thread Christoffer Dall
the EL1 phys timer as well. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- include/kvm/arm_arch_timer.h | 44 ++- virt/kvm/arm/arch_timer.c| 58 +++- 2 files changed, 54 insertions(+), 48 deletions(-) diff --git a/include/kvm

[PATCH 10/14] KVM: arm/arm64: consolidate arch timer trap handlers

2019-01-24 Thread Christoffer Dall
marshalls the arguments and then hands off to a set of common accessors. This makes extending the emulation to include EL2 timers much easier. Signed-off-by: Andre Przywara [Fixed 32-bit VM breakage and reduced to reworking existing code] Signed-off-by: Christoffer Dall [Fixed 32bit host, general

[PATCH 07/14] KVM: arm/arm64: Simplify bg_timer programming

2019-01-24 Thread Christoffer Dall
() will be called before kvm_timer_blocking. Reported-by: Andre Przywara Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier --- include/kvm/arm_arch_timer.h | 3 --- virt/kvm/arm/arch_timer.c| 35 ++- virt/kvm/arm/arm.c | 2 -- 3 files changed

[PATCH 09/14] KVM: arm64: Reuse sys_reg() macro when searching the trap table

2019-01-24 Thread Christoffer Dall
From: Marc Zyngier Instead of having an open-coded macro, reuse the sys_reg() macro that does the exact same thing. Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm64/kvm/sys_regs.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git

[PATCH 04/14] ARM: KVM: Teach some form of type-safety to kvm_call_hyp

2019-01-24 Thread Christoffer Dall
-false predicate. Hopefully, the compiler is dumb enough to do the type checking and clever enough to not emit the corresponding code... Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h | 31 --- arch/arm/kvm/hyp/hyp-entry.S

[PATCH 00/14] KVM: arm/arm64: Various rework in preparation of nested virt support

2019-01-24 Thread Christoffer Dall
ource/arm_arch_timer: Store physical timer IRQ number for KVM on VHE" https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1908965.html Andre Przywara (1): KVM: arm/arm64: consolidate arch timer trap handlers Christoffer Dall (6): KVM: arm/arm64: Factor out VMID into struct kvm_

[PATCH] clocksource/arm_arch_timer: Store physical timer IRQ number for KVM on VHE

2019-01-24 Thread Christoffer Dall
guest and saves us from emulating this timer for the guest on VHE systems. Store the EL1 Physical Timer's IRQ number in struct arch_timer_kvm_info on VHE systems to allow KVM to use it. Signed-off-by: Andre Przywara Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- Patches

[PATCH] KVM: arm/arm64: vgic: Always initialize the group of private IRQs

2019-01-10 Thread Christoffer Dall
GIC model (which is only the group field). This patch removes the incorrect comment from kvm_vgic_vcpu_init and initializes the group of all previously created VCPUs's private interrupts in vgic_init in addition to the existing initialization in kvm_vgic_vcpu_init. Signed-off-by: Christoffer Dall

Re: [kvmarm:kvm-arm64/nv-wip-v5.0-rc1 4/75] arch/arm/kvm/../../../virt/kvm/arm/arch_timer.c:700:7: error: 'SYS_CNTP_TVAL_EL0' undeclared

2019-01-09 Thread Christoffer Dall
On Wed, Jan 09, 2019 at 10:09:51AM +, Marc Zyngier wrote: > On 09/01/2019 09:13, André Przywara wrote: > > On 09/01/2019 04:40, kbuild test robot wrote: > > > > Marc, Christoffer, > > > >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git > >>

Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2019-01-08 Thread Christoffer Dall
On Tue, Jan 08, 2019 at 12:12:13PM +, Marc Zyngier wrote: > On 08/01/2019 12:03, Christoffer Dall wrote: > > On Tue, Jan 08, 2019 at 11:50:59AM +, Marc Zyngier wrote: > >> On Tue, 08 Jan 2019 11:25:13 +, > >> Andrew Murray wrote: > >> > >&

Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2019-01-08 Thread Christoffer Dall
On Tue, Jan 08, 2019 at 11:25:13AM +, Andrew Murray wrote: > On Tue, Jan 08, 2019 at 11:18:43AM +0100, Christoffer Dall wrote: > > On Fri, Jan 04, 2019 at 03:32:06PM +, Will Deacon wrote: > > > On Tue, Dec 18, 2018 at 01:02:26PM +0100, Christoffer Dall wrote: > >

Re: [PATCH 00/12] arm64: Paravirtualized time support

2019-01-08 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 11:40:47AM +, Mark Rutland wrote: > On Wed, Nov 28, 2018 at 02:45:15PM +, Steven Price wrote: > > This series add support for paravirtualized time for Arm64 guests and > > KVM hosts following the specification in Arm's document DEN 0057A: > > > >

Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2019-01-08 Thread Christoffer Dall
On Fri, Jan 04, 2019 at 03:32:06PM +, Will Deacon wrote: > On Tue, Dec 18, 2018 at 01:02:26PM +0100, Christoffer Dall wrote: > > On Wed, Dec 12, 2018 at 10:29:32AM +, Andrew Murray wrote: > > > Add support for the :G and :H attributes in perf by handling the

Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2018-12-18 Thread Christoffer Dall
On Tue, Dec 18, 2018 at 04:27:05PM +, Andrew Murray wrote: > On Tue, Dec 18, 2018 at 03:38:33PM +0100, Christoffer Dall wrote: > > On Tue, Dec 18, 2018 at 01:25:32PM +, Andrew Murray wrote: > > > On Tue, Dec 18, 2018 at 01:02:26PM +0100, Christoffer Dall wrote: > >

Re: [PATCH v8 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2018-12-18 Thread Christoffer Dall
On Wed, Dec 12, 2018 at 10:29:32AM +, Andrew Murray wrote: > Add support for the :G and :H attributes in perf by handling the > exclude_host/exclude_guest event attributes. > > We notify KVM of counters that we wish to be enabled or disabled on > guest entry/exit and thus defer from starting

Re: [PATCH v8 2/5] arm64: KVM: encapsulate kvm_cpu_context in kvm_host_data

2018-12-18 Thread Christoffer Dall
On Wed, Dec 12, 2018 at 10:29:30AM +, Andrew Murray wrote: > The virt/arm core allocates a kvm_cpu_context_t percpu, at present this is > a typedef to kvm_cpu_context and is used to store host cpu context. The > kvm_cpu_context structure is also used elsewhere to hold vcpu context. > In order

Re: [PATCH v10 0/8] kvm: arm64: Support PUD hugepage at stage 2

2018-12-18 Thread Christoffer Dall
uld post a patch later after further discussions in the > list. > For the series: Reviewed-by: Christoffer Dall ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v7 2/5] arm64: KVM: encapsulate kvm_cpu_context in kvm_host_data

2018-12-11 Thread Christoffer Dall
On Tue, Dec 11, 2018 at 01:11:33PM +, Andrew Murray wrote: > On Tue, Dec 11, 2018 at 01:29:51PM +0100, Christoffer Dall wrote: > > On Tue, Dec 11, 2018 at 12:13:37PM +, Andrew Murray wrote: > > > The virt/arm core allocates a percpu structure as per the > > > k

Re: [PATCH v7 2/5] arm64: KVM: encapsulate kvm_cpu_context in kvm_host_data

2018-12-11 Thread Christoffer Dall
On Tue, Dec 11, 2018 at 12:13:37PM +, Andrew Murray wrote: > The virt/arm core allocates a percpu structure as per the kvm_cpu_context_t > type, at present this is typedef'd to kvm_cpu_context and used to store > host cpu context. The kvm_cpu_context structure is also used elsewhere to > hold

[PATCH] KVM: arm/arm64: Fix VMID alloc race by reverting to lock-less

2018-12-11 Thread Christoffer Dall
: sta...@vger.kernel.org Fixes: f0cf47d939d0 "KVM: arm/arm64: Close VMID generation race" Reviewed-by: Julien Thierry Signed-off-by: Christoffer Dall --- virt/kvm/arm/arm.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/virt/kvm/arm/arm.c b/vi

[PATCH] KVM: arm/arm64: vgic-v2: Set active_source to 0 when restoring state

2018-12-11 Thread Christoffer Dall
as additional information to userspace for GICv2 if anyone cares. Cc: sta...@vger.kernel.org Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-mmio.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c

Re: KVM arm realtime performance optimization

2018-12-11 Thread Christoffer Dall
On Tue, Dec 11, 2018 at 10:00:35AM +0100, Steven Miao (Arm Technology China) wrote: > Hi Christopher, > > > -Original Message- > > From: Christoffer Dall > > Sent: Monday, December 10, 2018 9:19 PM > > To: Steven Miao (Arm Technology China) > &

Re: [PATCH v2 4/4] KVM: arm/arm64: vgic: Make vgic_cpu->ap_list_lock a raw_spinlock

2018-12-11 Thread Christoffer Dall
since RT spinlocks are interruptible. > > Signed-off-by: Julien Thierry > Cc: Christoffer Dall > Cc: Marc Zyngier Acked-by: Christoffer Dall ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v2 1/4] KVM: arm/arm64: vgic: Do not cond_resched_lock() with IRQs disabled

2018-12-11 Thread Christoffer Dall
nterrupts are > disabled at this point and we cannot reschedule a vcpu. > > Solve this by waiting for all vcpus to be halted after emmiting the halt > request. > > Signed-off-by: Julien Thierry > Suggested-by: Marc Zyngier > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: s

Re: [PATCH 1/2] kvm/arm: skip MMIO insn after emulation

2018-12-11 Thread Christoffer Dall
t; > Signed-off-by: Mark Rutland > Cc: Alex Bennée > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Peter Maydell > --- > virt/kvm/arm/mmio.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/virt/kvm/arm/mmio.c b/virt/kvm/arm/mm

Re: [PATCH 2/2] kvm/arm: consistently advance singlestep when emulating instructions

2018-12-11 Thread Christoffer Dall
itly check for an active-pending step, nor do we need to > fake a debug exception from the guest. > > Signed-off-by: Mark Rutland > Cc: Alex Bennée > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Peter Maydell > --- > arch/arm/include/asm/kvm_ho

Re: [PATCH v6 2/4] arm64: KVM: add accessors to track guest/host only counters

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 11:46:56PM +, Andrew Murray wrote: > On Mon, Dec 10, 2018 at 11:26:34AM +0100, Christoffer Dall wrote: > > On Mon, Dec 10, 2018 at 09:45:57AM +, Andrew Murray wrote: > > > In order to effeciently enable/disable guest/host only perf counters > &g

Re: KVM arm realtime performance optimization

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 05:36:09AM +, Steven Miao (Arm Technology China) wrote: > > From: kvmarm-boun...@lists.cs.columbia.edu > On Behalf Of Steven Miao (Arm > Technology China) > Sent: Thursday, December 6, 2018 3:05 PM > To: kvmarm@lists.cs.columbia.edu > Subject: KVM arm realtime

Re: [PATCH] kvm/arm: return 0 when the number of objects is not lessthan min

2018-12-10 Thread Christoffer Dall
On Thu, Dec 06, 2018 at 09:56:30AM +0800, peng.h...@zte.com.cn wrote: > >On Wed, Dec 05, 2018 at 09:15:51AM +0800, Peng Hao wrote: > >> Return 0 when there is enough kvm_mmu_memory_cache object. > >> > >> Signed-off-by: Peng Hao > >> --- > >> virt/kvm/arm/mmu.c | 2 +- > >> 1 file changed, 1

Re: [PATCH v3 7/8] arm64: KVM: Handle ARM erratum 1165522 in TLB invalidation

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 11:15:00AM +, James Morse wrote: > Hi Marc, Christoffer, > > On 10/12/2018 10:46, Marc Zyngier wrote: > > On 10/12/2018 10:19, Christoffer Dall wrote: > >> On Thu, Dec 06, 2018 at 05:31:25PM +, Marc Zyngier wrote: > >>> In

Re: [PATCH v9 1/8] KVM: arm/arm64: Share common code in user_mem_abort()

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 10:47:42AM +, Suzuki K Poulose wrote: > > > On 10/12/2018 08:56, Christoffer Dall wrote: > >On Mon, Dec 03, 2018 at 01:37:37PM +, Suzuki K Poulose wrote: > >>Hi Anshuman, > >> > >>On 03/12/2018 12:11, Anshuman Khandual w

Re: [PATCH v3 1/8] arm64: KVM: Make VHE Stage-2 TLB invalidation operations non-interruptible

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 10:24:31AM +, Marc Zyngier wrote: > Hi Christoffer, > > On 10/12/2018 10:03, Christoffer Dall wrote: > > On Thu, Dec 06, 2018 at 05:31:19PM +, Marc Zyngier wrote: > >> Contrary to the non-VHE version of the TLB invalidation helpers

Re: [PATCH v6 2/4] arm64: KVM: add accessors to track guest/host only counters

2018-12-10 Thread Christoffer Dall
On Mon, Dec 10, 2018 at 09:45:57AM +, Andrew Murray wrote: > In order to effeciently enable/disable guest/host only perf counters > at guest entry/exit we add bitfields to kvm_cpu_context for guest and > host events as well as accessors for updating them. > > Signed-off-by: Andrew Murray >

Re: [PATCH v3 6/8] arm64: KVM: Add synchronization on translation regime change for erratum 1165522

2018-12-10 Thread Christoffer Dall
ore we clear > + * HCR_EL2.TGE. > + * > + * We have already configured the guest's stage 1 translation in > + * kvm_vcpu_load_sysregs above. We must now call __activate_vm > + * before __activate_traps, because __activate_vm configures > + * stage 2

Re: [PATCH v3 3/8] arm64: KVM: Install stage-2 translation before enabling traps

2018-12-10 Thread Christoffer Dall
_activate_vm(kern_hyp_va(vcpu->kvm)); > + __activate_traps(vcpu); > > __hyp_vgic_restore_state(vcpu); > __timer_enable_traps(vcpu); > -- > 2.19.2 > Acked-by: Christoffer Dall ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v3 2/8] KVM: arm64: Rework detection of SVE, !VHE systems

2018-12-10 Thread Christoffer Dall
may be overkill. > return -ENODEV; > } > > @@ -1657,8 +1659,6 @@ int kvm_arch_init(void *opaque) > if (err) > return err; > > - in_hyp_mode = is_kernel_in_hyp_mode(); > - > if (!in_hyp_mode) { > err = init_hyp_mode(); > if (err) > -- > 2.19.2 > Otherwise: Acked-by: Christoffer Dall ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v3 1/8] arm64: KVM: Make VHE Stage-2 TLB invalidation operations non-interruptible

2018-12-10 Thread Christoffer Dall
On Thu, Dec 06, 2018 at 05:31:19PM +, Marc Zyngier wrote: > Contrary to the non-VHE version of the TLB invalidation helpers, the VHE > code has interrupts enabled, meaning that we can take an interrupt in > the middle of such a sequence, and start running something else with > HCR_EL2.TGE

Re: [PATCH v9 5/8] KVM: arm64: Support PUD hugepage in stage2_is_exec()

2018-12-10 Thread Christoffer Dall
On Wed, Dec 05, 2018 at 05:57:51PM +, Suzuki K Poulose wrote: > > > On 01/11/2018 13:38, Christoffer Dall wrote: > >On Wed, Oct 31, 2018 at 05:57:42PM +, Punit Agrawal wrote: > >>In preparation for creating PUD hugepages at stage 2, add support for > >

Re: [PATCH v9 3/8] KVM: arm/arm64: Introduce helpers to manipulate page table entries

2018-12-10 Thread Christoffer Dall
On Mon, Dec 03, 2018 at 07:20:08PM +0530, Anshuman Khandual wrote: > > > On 10/31/2018 11:27 PM, Punit Agrawal wrote: > > Introduce helpers to abstract architectural handling of the conversion > > of pfn to page table entries and marking a PMD page table entry as a > > block entry. > > Why is

Re: [PATCH v9 2/8] KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault

2018-12-10 Thread Christoffer Dall
>when support for PUD hugepages is introduced refactor the code to > >>share the checks needed to mark a page table entry as executable. > >> > >>Signed-off-by: Punit Agrawal > >>Reviewed-by: Suzuki K Poulose > >>Cc: Christoffer Dall > &

Re: [PATCH v9 2/8] KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault

2018-12-10 Thread Christoffer Dall
he checks needed to mark a page table entry as executable. > > > > Signed-off-by: Punit Agrawal > > Reviewed-by: Suzuki K Poulose > > Cc: Christoffer Dall > > Cc: Marc Zyngier > > --- > > virt/kvm/arm/mmu.c | 28 +++- > > 1 file

Re: [PATCH v9 1/8] KVM: arm/arm64: Share common code in user_mem_abort()

2018-12-10 Thread Christoffer Dall
> >> > >>Signed-off-by: Punit Agrawal > >>Reviewed-by: Suzuki K Poulose > >>Cc: Christoffer Dall > >>Cc: Marc Zyngier > >>--- > >> virt/kvm/arm/mmu.c | 49 -- > >> 1

Re: [PATCH] kvm: arm/arm64 : fix vm's hanging at startup time

2018-11-23 Thread Christoffer Dall
On Fri, Nov 23, 2018 at 02:01:56PM +0800, peng.h...@zte.com.cn wrote: > >Hi, > > > >On Wed, Nov 21, 2018 at 04:56:54PM +0800, peng.h...@zte.com.cn wrote: > >> >On 19/11/2018 09:10, Mark Rutland wrote: > >> >> On Sat, Nov 17, 2018 at 10:58:37AM +0800, peng.h...@zte.com.cn wrote: > >> On

Re: [RFC PATCH v2 11/23] KVM: arm64: Support runtime sysreg filtering for KVM_GET_REG_LIST

2018-11-22 Thread Christoffer Dall
On Thu, Nov 22, 2018 at 01:32:37PM +0100, Dave P Martin wrote: > On Thu, Nov 22, 2018 at 11:27:53AM +, Alex Bennée wrote: > > > > Christoffer Dall writes: > > > > > [Adding Peter and Alex for their view on the QEMU side] > > > > > > On Th

Re: [RFC PATCH v2 11/23] KVM: arm64: Support runtime sysreg filtering for KVM_GET_REG_LIST

2018-11-22 Thread Christoffer Dall
On Thu, Nov 22, 2018 at 11:13:51AM +, Peter Maydell wrote: > On 22 November 2018 at 10:53, Christoffer Dall > wrote: > > [Adding Peter and Alex for their view on the QEMU side] > > > > On Thu, Nov 15, 2018 at 05:27:11PM +, Dave Martin wr

Re: [RFC PATCH v2 11/23] KVM: arm64: Support runtime sysreg filtering for KVM_GET_REG_LIST

2018-11-22 Thread Christoffer Dall
[Adding Peter and Alex for their view on the QEMU side] On Thu, Nov 15, 2018 at 05:27:11PM +, Dave Martin wrote: > On Fri, Nov 02, 2018 at 09:16:25AM +0100, Christoffer Dall wrote: > > On Fri, Sep 28, 2018 at 02:39:15PM +0100, Dave Martin wrote: > > > KVM_GET_REG_LIST sho

Re: [PATCH] kvm: arm/arm64 : fix vm's hanging at startup time

2018-11-22 Thread Christoffer Dall
On Wed, Nov 21, 2018 at 03:53:03PM +, Julien Thierry wrote: > > > On 21/11/18 15:24, Christoffer Dall wrote: > >On Wed, Nov 21, 2018 at 12:17:45PM +, Julien Thierry wrote: > >> > >> > >>On 21/11/18 11:06, Christoffer Dall wrote: > >>

Re: [PATCH] kvm: arm/arm64 : fix vm's hanging at startup time

2018-11-21 Thread Christoffer Dall
On Wed, Nov 21, 2018 at 12:17:45PM +, Julien Thierry wrote: > > > On 21/11/18 11:06, Christoffer Dall wrote: > >Hi, > > > >On Wed, Nov 21, 2018 at 04:56:54PM +0800, peng.h...@zte.com.cn wrote: > >>>On 19/11/2018 09:10, Mark Rutland wrote: > &g

Re: [PATCH] kvm: arm/arm64 : fix vm's hanging at startup time

2018-11-21 Thread Christoffer Dall
Hi, On Wed, Nov 21, 2018 at 04:56:54PM +0800, peng.h...@zte.com.cn wrote: > >On 19/11/2018 09:10, Mark Rutland wrote: > >> On Sat, Nov 17, 2018 at 10:58:37AM +0800, peng.h...@zte.com.cn wrote: > On 16/11/18 00:23, peng.h...@zte.com.cn wrote: > >> Hi, > >>> When virtual machine

Re: [PATCH 0/4] KVM: arm/arm64: vgic: Use raw_spinlock for locks taken in IRQ context

2018-11-20 Thread Christoffer Dall
t seeing a more thorough analysis. > Patch 2-4 replace the VGIC spinlocks with raw_spinlocks > For these: Acked-by: Christoffer Dall Thanks, Christoffer ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH 1/4] KVM: arm/arm64: vgic: Do not cond_resched_lock() with IRQs disabled

2018-11-20 Thread Christoffer Dall
KVM: arm/arm64: > Factor out functionality to get vgic mmio requester_vcpu") > > Signed-off-by: Julien Thierry > Suggested-by: Marc Zyngier > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: sta...@vger.kernel.org > --- > virt/kvm/arm/vgic/vgic-mmio.c | 33 +

Re: [RFC PATCH v2 05/23] KVM: arm: Add arch vcpu uninit hook

2018-11-20 Thread Christoffer Dall
On Thu, Nov 15, 2018 at 04:40:31PM +, Dave Martin wrote: > On Fri, Nov 02, 2018 at 09:05:36AM +0100, Christoffer Dall wrote: > > On Fri, Sep 28, 2018 at 02:39:09PM +0100, Dave Martin wrote: > > > In preparation for adding support for SVE in guests on arm64, a > > >

Re: [PATCH v3 2/7] arm64/kvm: context-switch ptrauth registers

2018-11-13 Thread Christoffer Dall
On Mon, Nov 12, 2018 at 10:32:12PM +, Catalin Marinas wrote: > On Fri, Nov 02, 2018 at 09:37:25AM +0100, Christoffer Dall wrote: > > On Wed, Oct 17, 2018 at 04:17:55PM +0530, Amit Daniel Kachhap wrote: > > > From: Mark Rutland > > > > > > When pointer auth

Re: [RFC] [PATCH] kvm: arm: Introduce error code KVM_EINVARIANT

2018-11-12 Thread Christoffer Dall
Hi Manish, On Sat, Nov 10, 2018 at 10:18:47PM +, Manish Jaggi wrote: > > CCing a larger audience. > Please review. > > On 10/23/2018 03:51 PM, Jaggi, Manish wrote: > > From: Manish Jaggi > > > > This patch introduces an error code KVM_EINVARIANT which is returned > > by KVM when userland

Re: [PATCH 4/4] arm64: KVM: Implement workaround for Cortex-A76 erratum 1165522

2018-11-08 Thread Christoffer Dall
On Thu, Nov 08, 2018 at 06:05:55PM +, Marc Zyngier wrote: > On 06/11/18 08:15, Christoffer Dall wrote: > > On Mon, Nov 05, 2018 at 02:36:16PM +, Marc Zyngier wrote: > >> Early versions of Cortex-A76 can end-up with corrupt TLBs if they > >> speculate an AT in

Re: Timekeeping on ARM guests/hosts

2018-11-08 Thread Christoffer Dall
On Thu, Nov 08, 2018 at 04:34:08PM +, Steven Price wrote: > On 08/11/2018 10:26, Christoffer Dall wrote: > > On Wed, Nov 07, 2018 at 10:22:06AM -0800, Miriam Zimmerman wrote: > >> On Wed, Nov 7, 2018 at 1:42 AM Christoffer Dall > >> wrote: > >>> > &g

Re: Timekeeping on ARM guests/hosts

2018-11-08 Thread Christoffer Dall
On Wed, Nov 07, 2018 at 10:22:06AM -0800, Miriam Zimmerman wrote: > On Wed, Nov 7, 2018 at 1:42 AM Christoffer Dall > wrote: > > > > On Tue, Nov 06, 2018 at 10:37:21AM -0800, Miriam Zimmerman wrote: > > > On Mon, Nov 5, 2018 at 11:45 PM Christoffer Dall > > >

Re: [RFC QEMU 0/2] arm/virt: Account for guest pause time

2018-11-07 Thread Christoffer Dall
Hi Bijan, On Tue, Nov 06, 2018 at 04:32:27PM -0800, Bijan Mottahedeh wrote: > This patch series address two Qemu issues: This series should primarily go to qemu-devel (as it is a QEMU patch). Could you please re-send the series to qemu-devel. Keeping the kvmarm list on cc is nice, but only a

Re: Timekeeping on ARM guests/hosts

2018-11-07 Thread Christoffer Dall
On Tue, Nov 06, 2018 at 10:37:21AM -0800, Miriam Zimmerman wrote: > On Mon, Nov 5, 2018 at 11:45 PM Christoffer Dall > wrote: > > > > On Fri, Nov 02, 2018 at 02:23:45PM -0700, Miriam Zimmerman wrote: > > > In researching KVM_REG_ARM_TIMER_CNT, I discovered your commit

[PATCH v2] KVM: arm64: Clarify explanation of STAGE2_PGTABLE_LEVELS

2018-11-06 Thread Christoffer Dall
having the Arm ARM open on the right page. While we're at it, fixup a typo in a comment that was recently changed. Signed-off-by: Christoffer Dall --- Changes since v1: - Dropped note about (PAGE_SHIFT - 3) > 4 arch/arm64/include/asm/stage2_pgtable.h | 14 ++ virt/kvm/arm/mm

Re: [PATCH] KVM: arm64: Clarify explanation of STAGE2_PGTABLE_LEVELS

2018-11-06 Thread Christoffer Dall
On Tue, Nov 06, 2018 at 12:13:18PM +, Suzuki K Poulose wrote: > > > On 06/11/2018 11:45, Christoffer Dall wrote: > >On Tue, Nov 06, 2018 at 09:52:59AM +, Suzuki K Poulose wrote: > >> > >> > >>On 06/11/2018 08:42, Christoffer Dall wrote: >

Re: [PATCH] KVM: arm64: Clarify explanation of STAGE2_PGTABLE_LEVELS

2018-11-06 Thread Christoffer Dall
On Tue, Nov 06, 2018 at 09:52:59AM +, Suzuki K Poulose wrote: > > > On 06/11/2018 08:42, Christoffer Dall wrote: > >On Mon, Nov 05, 2018 at 03:00:34PM +, Suzuki K Poulose wrote: > >> > >> > >>On 02/11/18 14:25, Christoffer Dall wrote: > >&g

<    1   2   3   4   5   6   7   8   9   10   >