Re: [PATCH v6 1/6] arm/arm64: KVM: Introduce armv7 fp/simd vcpu fields and helpers

2016-01-05 Thread Mario Smarduch
On 1/5/2016 7:00 AM, Christoffer Dall wrote: > On Sat, Dec 26, 2015 at 01:54:55PM -0800, Mario Smarduch wrote: >> Add helper functions to enable access to fp/smid on guest entry and save host >> fpexc on vcpu put, check if fp/simd registers are dirty and add new vcpu >> fie

[PATCH v6 2/6] arm: KVM: Introduce host fp/simd context switch function

2015-12-26 Thread Mario Smarduch
Add fp/simd context switch function callable from host kernel mode. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/Makefile| 2 +- arch/arm/kvm/fpsimd_switch.S | 47 2 files changed, 48 insertions(+), 1 de

[PATCH v6 0/6] arm/arm64: KVM: Enhance armv7/8 fp/simd lazy switch

2015-12-26 Thread Mario Smarduch
tr branch label - Fixed handling of FPEXC to restore guest and host versions on vcpu_put - Tested arm32/arm64 - rebased to 4.3-rc2 - changed a couple register accesses from 64 to 32 bit Mario Smarduch (6): Introduce armv7 fp/simd vcpu fields and helpers Introduce host fp/simd context switch fu

[PATCH v6 1/6] arm/arm64: KVM: Introduce armv7 fp/simd vcpu fields and helpers

2015-12-26 Thread Mario Smarduch
Add helper functions to enable access to fp/smid on guest entry and save host fpexc on vcpu put, check if fp/simd registers are dirty and add new vcpu fields. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_emulate.h

[PATCH v6 3/6] arm/arm64: KVM: Enable armv7 fp/simd enhanced context switch

2015-12-26 Thread Mario Smarduch
Enable armv7 enhanced fp/simd context switch. Guest and host registers are only context switched on first access and vcpu put. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm/kernel/asm-offsets.c | 1 + arch/arm/kvm

[PATCH v6 4/6] arm: KVM: Delete unused macros

2015-12-26 Thread Mario Smarduch
set_hcptr is no longer used so delete it. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/interrupts_head.S | 29 - 1 file changed, 29 deletions(-) diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S index 5

[PATCH v6 5/6] arm/arm64: KVM: Introduce armv8 fp/simd vcpu fields and helpers

2015-12-26 Thread Mario Smarduch
-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_emulate.h | 12 arch/arm64/include/asm/kvm_asm.h | 5 + arch/arm64/include/asm/kvm_emulate.h | 26 -- arch/arm64/include/asm/kvm_host.h| 12 +++- arch/arm64/k

[PATCH v6 6/6] arm/arm64: KVM: Enable armv8 fp/simd enhanced context switch

2015-12-26 Thread Mario Smarduch
Enable armv8 enhanced fp/simd context switch. Guest and host registers are only context switched on first access and vcpu put. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/arm.c | 13 +++-- arch/arm64/kernel/asm-offsets.c | 1 + arch/arm64/k

Re: [PATCH v5 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-22 Thread Mario Smarduch
On 12/22/2015 12:06 AM, Christoffer Dall wrote: > On Mon, Dec 21, 2015 at 11:34:25AM -0800, Mario Smarduch wrote: >> >> >> On 12/18/2015 11:45 PM, Christoffer Dall wrote: >>> On Fri, Dec 18, 2015 at 05:17:00PM -0800, Mario Smarduch wrote: >>>> On

Re: [PATCH v5 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-21 Thread Mario Smarduch
On 12/18/2015 11:45 PM, Christoffer Dall wrote: > On Fri, Dec 18, 2015 at 05:17:00PM -0800, Mario Smarduch wrote: >> On 12/18/2015 5:54 AM, Christoffer Dall wrote: >>> On Sun, Dec 06, 2015 at 05:07:14PM -0800, Mario Smarduch wrote: >>>> This patch tracks armv7 an

Re: [PATCH v5 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-12-18 Thread Mario Smarduch
On 12/18/2015 5:49 AM, Christoffer Dall wrote: > On Sun, Dec 06, 2015 at 05:07:13PM -0800, Mario Smarduch wrote: >> This patch tracks armv7 fp/simd hardware state with hcptr register. >> On vcpu_load saves host fpexc, enables FP access, and sets trapping >> on fp/simd acc

Re: [PATCH v5 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-18 Thread Mario Smarduch
On 12/18/2015 5:54 AM, Christoffer Dall wrote: > On Sun, Dec 06, 2015 at 05:07:14PM -0800, Mario Smarduch wrote: >> This patch tracks armv7 and armv8 fp/simd hardware state with cptr_el2 >> register. >> On vcpu_load for 32 bit guests enable FP access, and enable fp/simd >

Re: [PATCH v5 1/3] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-12-18 Thread Mario Smarduch
On 12/18/2015 5:07 AM, Christoffer Dall wrote: > On Sun, Dec 06, 2015 at 05:07:12PM -0800, Mario Smarduch wrote: >> This patch adds vcpu fields to configure hcptr trap register which is also >> used >> to determine if fp/simd registers are dirty. Adds a field t

Re: [PATCH v3 07/22] arm64: KVM: Implement system register save/restore

2015-12-12 Thread Mario Smarduch
On 12/11/2015 10:29 AM, Marc Zyngier wrote: > Hi Mario, > > On 11/12/15 03:24, Mario Smarduch wrote: >> Hi Marc, >> >> On 12/7/2015 2:53 AM, Marc Zyngier wrote: >>> Implement the system register save/restore as a direct translation of >>> the assem

Re: [PATCH v3 07/22] arm64: KVM: Implement system register save/restore

2015-12-10 Thread Mario Smarduch
Hi Marc, On 12/7/2015 2:53 AM, Marc Zyngier wrote: > Implement the system register save/restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier > Reviewed-by: Christoffer Dall > --- >

Re: [PATCH v3 05/22] arm64: KVM: Implement vgic-v3 save/restore

2015-12-07 Thread Mario Smarduch
On 12/7/2015 8:52 AM, Marc Zyngier wrote: > Hi Mario, > > On 07/12/15 16:40, Mario Smarduch wrote: >> Hi Marc, >> >> On 12/7/2015 2:53 AM, Marc Zyngier wrote: >>> Implement the vgic-v3 save restore as a direct translation of >>> the assembly code

Re: [PATCH v3 05/22] arm64: KVM: Implement vgic-v3 save/restore

2015-12-07 Thread Mario Smarduch
Hi Marc, On 12/7/2015 2:53 AM, Marc Zyngier wrote: > Implement the vgic-v3 save restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile | 1 + > arch/arm64/kvm/hyp/hyp.h| 3 + >

Re: [PATCH v3 05/22] arm64: KVM: Implement vgic-v3 save/restore

2015-12-07 Thread Mario Smarduch
On 12/7/2015 10:20 AM, Marc Zyngier wrote: > On 07/12/15 18:05, Mario Smarduch wrote: >> >> >> On 12/7/2015 9:37 AM, Marc Zyngier wrote: [...] >>> >> >> I was thinking something like 'current_lr[VGIC_V3_LR_INDEX(...)]'. > > That doesn't

Re: [PATCH v3 06/22] arm64: KVM: Implement timer save/restore

2015-12-07 Thread Mario Smarduch
On 12/7/2015 2:53 AM, Marc Zyngier wrote: > Implement the timer save restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile | 1 + > arch/arm64/kvm/hyp/hyp.h | 3 ++ >

Re: [PATCH v3 05/22] arm64: KVM: Implement vgic-v3 save/restore

2015-12-07 Thread Mario Smarduch
On 12/7/2015 9:37 AM, Marc Zyngier wrote: > On 07/12/15 17:18, Mario Smarduch wrote: >> >> >> On 12/7/2015 8:52 AM, Marc Zyngier wrote: >>> Hi Mario, >>> >>> On 07/12/15 16:40, Mario Smarduch wrote: >>>> Hi Marc, >>>> &g

[PATCH v5 0/3] KVM/arm/arm64: enhance armv7/8 fp/simd lazy switch

2015-12-06 Thread Mario Smarduch
64 to 32 bit Mario Smarduch (3): add hooks for armv7 fp/simd lazy switch support enable enhanced armv7 fp/simd lazy switch enable enhanced armv8 fp/simd lazy switch arch/arm/include/asm/kvm_emulate.h | 55 ++ arch/arm/include/asm/kvm_host.h | 9 +++ arch/ar

[PATCH v5 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-12-06 Thread Mario Smarduch
if trap bits are cleared save guest and restore host context and always restore host fpexc. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_emulate.h | 50 arch/arm/include/asm/kvm_host.h | 1 + arch/arm/kvm/Ma

[PATCH v5 1/3] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-12-06 Thread Mario Smarduch
This patch adds vcpu fields to configure hcptr trap register which is also used to determine if fp/simd registers are dirty. Adds a field to save host FPEXC, and offsets associated offsets. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host

[PATCH v5 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-06 Thread Mario Smarduch
vcpu lazy mode. On vcpu_put if trap bits are clear save guest and restore host context and also save 32 bit guest fpexc register. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_emulate.h | 5 ++ arch/arm/include/asm/kvm_host.h | 2 + arch/a

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Mario Smarduch
On 12/3/2015 7:46 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch adds vcpu fields to track lazy state, save host FPEXC, and >> offsets to fields. >> >> Signed-off-by: Mario Smarduch <m.smard...@samsung.com> >> ---

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Mario Smarduch
On 12/3/2015 11:24 AM, Marc Zyngier wrote: > On 03/12/15 19:21, Mario Smarduch wrote: >> >> >> On 12/3/2015 7:46 AM, Marc Zyngier wrote: >>> On 14/11/15 22:12, Mario Smarduch wrote: >>>> This patch adds vcpu fields to track lazy state, s

Re: [PATCH v4 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-03 Thread Mario Smarduch
On 12/3/2015 8:13 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch tracks armv7 and armv8 fp/simd hardware state with a vcpu lazy >> flag. >> On vcpu_load for 32 bit guests enable FP access, and later enable fp/simd >> trapping for 3

Re: [PATCH v4 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-12-03 Thread Mario Smarduch
On 12/3/2015 7:58 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch tracks armv7 fp/simd hardware state with a vcpu lazy flag. >> On vcpu_load saves host fpexc and enables FP access, and later enables >> fp/simd >> trapping if lazy f

Re: [PATCH v2 00/21] arm64: KVM: world switch in C

2015-11-30 Thread Mario Smarduch
On 11/30/2015 12:33 PM, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:54PM +, Marc Zyngier wrote: >> Once upon a time, the KVM/arm64 world switch was a nice, clean, lean >> and mean piece of hand-crafted assembly code. Over time, features have >> crept in, the code has become

[PATCH v4 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-11-14 Thread Mario Smarduch
, disable trapping and set vcpu lazy flag. On vcpu_put if flag is set save guest and restore host context and also save guest fpexc register. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 3 ++ arch/arm/kvm/arm.c| 18 +++--

[PATCH v4 0/3] KVM/arm/arm64: enhance armv7/8 fp/simd lazy switch

2015-11-14 Thread Mario Smarduch
of FPEXC to restore guest and host versions on vcpu_put - Tested arm32/arm64 - rebased to 4.3-rc2 - changed a couple register accesses from 64 to 32 bit Mario Smarduch (3): add hooks for armv7 fp/simd lazy switch support enable enhanced armv7 fp/simd lazy switch enable enhanced armv8 fp/

[PATCH v4 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-11-14 Thread Mario Smarduch
flag. On vcpu_put if flag is set save guest and restore host context and always restore host fpexc. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 33 ++ arch/arm/kvm/arm.c| 12 arch/a

[PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-11-14 Thread Mario Smarduch
This patch adds vcpu fields to track lazy state, save host FPEXC, and offsets to fields. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 6 ++ arch/arm/kernel/asm-offsets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/i

Re: [PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-11-14 Thread Mario Smarduch
On 11/10/2015 3:18 AM, Christoffer Dall wrote: > On Mon, Nov 09, 2015 at 03:13:15PM -0800, Mario Smarduch wrote: >> >> >> On 11/5/2015 7:02 AM, Christoffer Dall wrote: >>> On Fri, Oct 30, 2015 at 02:56:33PM -0700, Mario Smarduch wrote: [] >> kern_hyp_va x0

Re: [PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-11-09 Thread Mario Smarduch
On 11/5/2015 7:02 AM, Christoffer Dall wrote: > On Fri, Oct 30, 2015 at 02:56:33PM -0700, Mario Smarduch wrote: >> This patch enables arm64 lazy fp/simd switch, similar to arm described in >> second patch. Change from previous version - restore function is moved to >> ho

Re: [PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-11-06 Thread Mario Smarduch
On 11/6/2015 3:29 AM, Christoffer Dall wrote: > On Thu, Nov 05, 2015 at 04:57:12PM -0800, Mario Smarduch wrote: >> >> >> On 11/5/2015 7:02 AM, Christoffer Dall wrote: >>> On Fri, Oct 30, 2015 at 02:56:33PM -0700, Mario Smarduch wrote: >>>> This patch

Re: [PATCH v3 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-11-06 Thread Mario Smarduch
On 11/6/2015 3:37 AM, Christoffer Dall wrote: > On Thu, Nov 05, 2015 at 04:23:41PM -0800, Mario Smarduch wrote: >> >> >> On 11/5/2015 6:48 AM, Christoffer Dall wrote: >>> On Fri, Oct 30, 2015 at 02:56:32PM -0700, Mario Smarduch wrote: >>>> This patch

Re: [PATCH v3 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-11-05 Thread Mario Smarduch
On 11/5/2015 6:48 AM, Christoffer Dall wrote: > On Fri, Oct 30, 2015 at 02:56:32PM -0700, Mario Smarduch wrote: >> This patch tracks vfp/simd hardware state with a vcpu lazy flag. vCPU lazy >> flag is set on guest access and traps to vfp/simd hardware switch handler. >> On

Re: [PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-11-05 Thread Mario Smarduch
On 11/5/2015 7:02 AM, Christoffer Dall wrote: > On Fri, Oct 30, 2015 at 02:56:33PM -0700, Mario Smarduch wrote: >> This patch enables arm64 lazy fp/simd switch, similar to arm described in >> second patch. Change from previous version - restore function is moved to >> ho

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Mario Smarduch
; On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch <m.smard...@samsung.com> >>>> wrote: >>>>> On 11/3/2015 9:55 AM, Will Deacon wrote: >>>>>> On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario Smarduch wrote: >>>>>>> On 11/3/2015 8:33 AM

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-03 Thread Mario Smarduch
On 11/3/2015 8:33 AM, Christopher Covington wrote: > Hi Mario, > > On 11/02/2015 06:51 PM, Mario Smarduch wrote: >> Hello, >>this is a re-post from couple weeks ago, please take time to review this >> simple patch which simplifies DEBUG_LL and prevents kernel cra

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-03 Thread Mario Smarduch
On 11/3/2015 9:55 AM, Will Deacon wrote: > On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario Smarduch wrote: >> On 11/3/2015 8:33 AM, Christopher Covington wrote: >>> On 11/02/2015 06:51 PM, Mario Smarduch wrote: >>>>this is a re-post from couple weeks a

[PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-02 Thread Mario Smarduch
all <christoffer.d...@linaro.org> Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/Kconfig.debug | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index a2e16f9..d126bd4 100644 --- a/arch/arm/Kconfig.debug

[PATCH v3 0/3] KVM/arm64/arm: enhance armv7/8 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
cesses from 64 to 32 bit Mario Smarduch (3): hooks for armv7 fp/simd lazy switch support enable enhanced armv7 fp/simd lazy switch enable enhanced armv8 fp/simd lazy switch arch/arm/include/asm/kvm_host.h | 7 + arch/arm/kernel/asm-offsets.c | 2 ++ arch/arm/kvm

[PATCH v3 1/3] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-10-30 Thread Mario Smarduch
This patch adds vcpu fields to track lazy state, save host FPEXC, and offsets to fields. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 6 ++ arch/arm/kernel/asm-offsets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/i

[PATCH v3 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
with guest context. In vcpu_put check if vcpu lazy flag is set, and execute a hardware context switch to restore host. Also some arm64 field and empty function are added to compile for arm64. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h

[PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
This patch enables arm64 lazy fp/simd switch, similar to arm described in second patch. Change from previous version - restore function is moved to host. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kernel/asm-offsets.c

Re: [PATCH v2 2/2] KVM/arm: enable enhanced armv7 fp/simd lazy switch

2015-10-20 Thread Mario Smarduch
On 10/20/2015 12:24 AM, Christoffer Dall wrote: > On Mon, Oct 19, 2015 at 04:25:04PM -0700, Mario Smarduch wrote: >> >> >> On 10/19/2015 3:14 AM, Christoffer Dall wrote: >>> On Sat, Sep 26, 2015 at 04:43:29PM -0700, Mario Smarduch wrote: >>>> This pat

Re: [RFT - PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-10-19 Thread Mario Smarduch
On 10/18/2015 2:07 PM, Christoffer Dall wrote: > On Mon, Oct 12, 2015 at 09:29:23AM -0700, Mario Smarduch wrote: >> Hi Christoffer, Marc - >> I just threw this test your way without any explanation. > > I'm confused. Did you send me something somewhere already? Yes

Re: [PATCH v2 1/2] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-10-19 Thread Mario Smarduch
On 10/19/2015 1:53 AM, Christoffer Dall wrote: > On Sat, Sep 26, 2015 at 04:43:28PM -0700, Mario Smarduch wrote: >> This patch adds vcpu fields to track lazy state, save host FPEXC, and >> offsets to fields. >> >> Signed-off-by: Mario Smarduch <m.smard...@sa

Re: [PATCH v2 2/2] KVM/arm: enable enhanced armv7 fp/simd lazy switch

2015-10-19 Thread Mario Smarduch
On 10/19/2015 3:14 AM, Christoffer Dall wrote: > On Sat, Sep 26, 2015 at 04:43:29PM -0700, Mario Smarduch wrote: >> This patch enhances current lazy vfp/simd hardware switch. In addition to >> current lazy switch, it tracks vfp/simd hardware state with a vcpu >> lazy flag.

[PATCH] KVM/arm: kernel low level debug suport for ARM32 virtual platforms

2015-10-16 Thread Mario Smarduch
address (for ARCH_VEXPRESS) based on A9 or A15 part numbers. Looked for a same approach but couldn't find a way to differentiate between virtual platforms, something like a platform register. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/Kconfig.debu

Re: [RFT - PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-10-12 Thread Mario Smarduch
ideas I'd be happy to enhance the test. Thanks, Mario On 10/5/2015 8:45 AM, Christoffer Dall wrote: > On Tue, Sep 22, 2015 at 04:34:01PM -0700, Mario Smarduch wrote: >> This is a 2nd itteration for arm64, v1 patches were posted by mistake from >> an >> older branch which

RE: [RFT - PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-10-05 Thread Mario Smarduch
Will do, I'll get them over to you. -Original Message- From: Christoffer Dall [mailto:christoffer.d...@linaro.org] Sent: Monday, October 05, 2015 10:26 AM To: Mario Smarduch Cc: kvm...@lists.cs.columbia.edu; marc.zyng...@arm.com; kvm@vger.kernel.org; linux-arm-ker...@lists.infradead.org

[PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-10-05 Thread Mario Smarduch
m64 - rebased to 4.3-rc2 - changed a couple register accesses from 64 to 32 bit Mario Smarduch (2): add hooks for armv8 fp/simd lazy switch enable armv8 fp/simd lazy switch arch/arm/kvm/arm.c| 2 -- arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/include/asm/kvm_host.h |

[PATCH v2 1/2] add hooks for armv8 fp/simd lazy switch

2015-10-05 Thread Mario Smarduch
This patch adds hooks to support fp/simd lazy switch. A vcpu flag to track fp/simd state, and flag offset in vcpu structure. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm64/include/asm/kvm_host.h | 3 +++ arch/arm64/kernel/asm-offsets.c | 1 + 2 files chan

[PATCH v2 2/2] enable armv8 fp/simd lazy switch

2015-10-05 Thread Mario Smarduch
context switches to two per vCPU execution schedule. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/arm.c | 2 -- arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/kvm/hyp.S | 59 +++- 3 files chang

Re: [RFT - PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-10-05 Thread Mario Smarduch
- - Mario On 10/5/2015 8:45 AM, Christoffer Dall wrote: > On Tue, Sep 22, 2015 at 04:34:01PM -0700, Mario Smarduch wrote: >> This is a 2nd itteration for arm64, v1 patches were posted by mistake from >> an >> older branch which included several bugs. Hopefully didn't waste to

[PATCH v2 0/2] KVM/arm: enhance arvm7 vfp/simd lazy switch support

2015-09-26 Thread Mario Smarduch
ing of FPEXC to restore guest and host versions on vcpu_put Mario Smarduch (2): add hooks for armv7 fp/simd lazy switch support enable armv7 fp/simd lazy switch arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 6 + arch/arm/kernel/asm-offsets.c | 2 ++ arch/

[PATCH v2 1/2] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-09-26 Thread Mario Smarduch
This patch adds vcpu fields to track lazy state, save host FPEXC, and offsets to fields. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_host.h | 6 ++ arch/arm/kernel/asm-offsets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/i

[PATCH v2 2/2] KVM/arm: enable enhanced armv7 fp/simd lazy switch

2015-09-26 Thread Mario Smarduch
and saving host fpexc. On vm-exit if flag is set skip hardware context switch and return to host with guest context. On vcpu_put check if vcpu lazy flag is set, and execute a hardware context switch to restore host. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/inclu

Re: [PATCH 2/2] KVM/arm: enable armv7 fp/simd lazy switch

2015-09-22 Thread Mario Smarduch
Hi Antonios, On 9/22/2015 7:01 AM, Antonios Motakis wrote: > Hello, > > On 18-Sep-15 03:05, Mario Smarduch wrote: >> Adds code to enable fp/simd lazy switch. On each entry check if fp/simd >> registers have been switched to guest, if no set the trap flag. On trap >&g

[RFT - PATCH v2 0/2] KVM/arm64: add fp/simd lazy switch support

2015-09-22 Thread Mario Smarduch
about 30% down to 2% with one guest running. At this time I don't have arm32/arm64 working and hoping Christoffer and/or Marc (or anyone) can test 32-bit guest/64-bit host. Mario Smarduch (2): add hooks for armv8 fp/simd lazy switch enable armv8 fp/simd lazy switch arch/arm/kvm/arm.c

[RFT - PATCH v2 1/2] add hooks for armv8 fp/simd lazy switch

2015-09-22 Thread Mario Smarduch
This patch adds hooks to support fp/simd lazy switch. A vcpu flag to track fp/simd state, and flag offset in vcpu structure. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm64/include/asm/kvm_host.h | 3 +++ arch/arm64/kernel/asm-offsets.c | 1 + 2 files chan

[RFT - PATCH v2 2/2] enable armv8 fp/simd lazy switch

2015-09-22 Thread Mario Smarduch
context switches to one per vCPU scheduled execution. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/arm.c | 2 -- arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/kvm/hyp.S | 58 +++- 3 files chang

[RFT - PATCH 2/2] KVM/arm64: enable armv8 fp/simd lazy switch

2015-09-21 Thread Mario Smarduch
This patch enables arm64 lazy fp/simd switch. Removes the ARM constraint, and follows the same approach as armv7 version - found here https://lists.cs.columbia.edu/pipermail/kvmarm/2015-September/016518.html Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/arm.c

[RFT - PATCH 1/2] KVM/arm64: add hooks for armv8 fp/simd lazy switch support

2015-09-21 Thread Mario Smarduch
This patch adds hooks to support fp/simd lazy switch. A vcpu flag to track fp/simd state, offset into the vcpu structure and switch prototype function. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/include/asm/kvm_host

[RFT - PATCH 0/2] KVM/arm64: add fp/simd lazy switch support

2015-09-21 Thread Mario Smarduch
validation (the RFT tag). The results substantially decrease the numbe of fp/simd context switches for a FP load. At this time I don't have arm32/arm64 working and requesting Christoffer and/or Marc to test 32 bit guest on 64 bit host. Mario Smarduch (2): add hooks for armv8 fp/simd lazy

[PATCH 2/2] KVM/arm: enable armv7 fp/simd lazy switch

2015-09-17 Thread Mario Smarduch
guest and restore host and reset the vfp_lazy state to enable trapping again. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/kvm/arm.c| 17 + arch/arm/kvm/interrupts.S | 40 +--- 2 files changed, 46 insertions(

[PATCH 0/2] KVM/arm: add fp/simd lazy switch support

2015-09-17 Thread Mario Smarduch
and verify operation. Initial intent was to post all patches at once, but arm64 version will be posted soon. Mario Smarduch (2): add hooks for armv7 vfp/simd lazy switch support enable armv7 vfp/simd lazy switch arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 3

[PATCH 1/2] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-09-17 Thread Mario Smarduch
Basic hooks are added to support fp/simd lazy switch. A vcpu flag to track fp/simd state, offset into the vcpu structure and switch prototype function. Signed-off-by: Mario Smarduch <m.smard...@samsung.com> --- arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 3 +++

Re: [PATCH v4 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-08-19 Thread Mario Smarduch
Great that's even better. On 8/19/2015 3:28 PM, Marc Zyngier wrote: On Wed, 19 Aug 2015 14:52:08 -0700 Mario Smarduch m.smard...@samsung.com wrote: Hi Christoffer, I'll test it and work with it. FWIW, I've added these patches to both -queue and -next, and from the tests Christoffer

Re: [PATCH v4 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-08-19 Thread Mario Smarduch
Hi Christoffer, I'll test it and work with it. Thanks, Mario On 8/19/2015 10:49 AM, Christoffer Dall wrote: Hi Mario, On Wed, Aug 05, 2015 at 05:11:37PM +0100, Marc Zyngier wrote: On 16/07/15 22:29, Mario Smarduch wrote: This patch only saves and restores FP/SIMD registers on Guest

Re: [PATCH v4 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits for non-VHE

2015-07-16 Thread Mario Smarduch
On 07/16/2015 12:05 PM, Christoffer Dall wrote: On Thu, Jul 16, 2015 at 11:23:08AM -0700, Mario Smarduch wrote: On 07/16/2015 08:52 AM, Christoffer Dall wrote: On Fri, Jul 10, 2015 at 06:19:05PM -0700, Mario Smarduch wrote: This is a followp to previous iteration but implemented on top of VHE

Re: [PATCH v4 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits for non-VHE

2015-07-16 Thread Mario Smarduch
On 07/16/2015 08:52 AM, Christoffer Dall wrote: On Fri, Jul 10, 2015 at 06:19:05PM -0700, Mario Smarduch wrote: This is a followp to previous iteration but implemented on top of VHE patches. Only non-VHE path is addressied by this patch. In second patch 32-bit handler is updated to keep

[PATCH v4 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64

2015-07-16 Thread Mario Smarduch
After enhancing arm64 FP/SIMD exit handling, ARMv7 VFP exit branch is moved to guest trap handling. This allows us to keep exit handling flow between both architectures consistent. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/kvm/interrupts.S | 14 -- 1 file

[PATCH v4 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits

2015-07-16 Thread Mario Smarduch
commit message Mario Smarduch (2): Optimize arm64 skip 30-50% vfp/simd save/restore on exits keep arm vfp/simd exit handling consistent with arm64 arch/arm/kvm/interrupts.S| 14 +++-- arch/arm64/include/asm/kvm_arm.h | 5 - arch/arm64/kvm/hyp.S | 45

[PATCH v4 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-07-16 Thread Mario Smarduch
This patch only saves and restores FP/SIMD registers on Guest access. To do this cptr_el2 FP/SIMD trap is set on Guest entry and later checked on exit. lmbench, hackbench show significant improvements, for 30-50% exits FP/SIMD context is not saved/restored Signed-off-by: Mario Smarduch m.smard

[PATCH v4 1/2] arm64: KVM: Optimize arm64 non-VHE fpsimd skip 30-50% save/restore on exits

2015-07-11 Thread Mario Smarduch
This patch only saves and restores FP/SIMD registers on Guest access. To do this cptr_el2 FP/SIMD trap is set on Guest entry and later checked on exit. The non-VHE path has been tested, future work would add VHE support. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm64/include

[PATCH v4 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits for non-VHE

2015-07-11 Thread Mario Smarduch
, the first patch optimizes arm64 save/restore, we only do so on Guest access. hackbench and several lmbench tests show anywhere from 30% to 50% of exits don't save/restore fp/simd register set. Tested on Foundation Model, unfortuntely not tested yet on VHE enabled model. Mario Smarduch (2

[PATCH v4 2/2] keep arm vfp/simd exit handling consistent with arm64

2015-07-11 Thread Mario Smarduch
After enhancing arm64 FP/SIMD exit handling, ARMv7 VFP exit branch is moved to guest trap handling. This allows us to keep exit handling flow between both architectures consistent. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/kvm/interrupts.S | 14 -- 1 file

Re: [PATCH 09/13] arm64: KVM: VHE: Add alternatives for VHE-enabled world-switch

2015-07-09 Thread Mario Smarduch
On 07/09/2015 01:06 AM, Marc Zyngier wrote: Hi Mario, On 09/07/15 02:29, Mario Smarduch wrote: On 07/08/2015 09:19 AM, Marc Zyngier wrote: In order to switch between host and guest, a VHE-enabled kernel must use different accessors for certain system registers. This patch uses runtime

Re: [PATCH 09/13] arm64: KVM: VHE: Add alternatives for VHE-enabled world-switch

2015-07-08 Thread Mario Smarduch
On 07/08/2015 09:19 AM, Marc Zyngier wrote: In order to switch between host and guest, a VHE-enabled kernel must use different accessors for certain system registers. This patch uses runtime patching to use the right instruction when required... Signed-off-by: Marc Zyngier

Re: [PATCH 2/3] arm: KVM: Implement lazy VFP switching outside of Hyp Mode

2015-07-06 Thread Mario Smarduch
On 07/05/2015 12:34 PM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 08:30:27PM -0700, Mario Smarduch wrote: This patch implements the VFP context switch code called from vcpu_put in Host KVM. In addition it implements the logic to skip setting a VFP trap if one is not needed. Also resets

Re: [PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state

2015-07-06 Thread Mario Smarduch
On 07/05/2015 12:27 PM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 08:30:26PM -0700, Mario Smarduch wrote: Define the required kvm_vcpu_arch fields, and offsets to manage VFP state. And declary Hyp interface function to switch VFP registers. Signed-off-by: Mario Smarduch m.smard

Re: [PATCH 3/3] arm: KVM: Add VFP lazy switch hooks in Host KVM

2015-07-06 Thread Mario Smarduch
On 07/05/2015 12:37 PM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 08:30:28PM -0700, Mario Smarduch wrote: This patch implements host KVM interface to Hyp mode VFP function to switch out guest and switch in host. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/kvm

Re: [PATCH 0/3] arm: KVM: VFP lazy switch in KVM Host Mode may save upto 98%

2015-07-06 Thread Mario Smarduch
On 07/05/2015 12:37 PM, Christoffer Dall wrote: Hi Mario, On Wed, Jun 24, 2015 at 08:30:25PM -0700, Mario Smarduch wrote: Currently we do a lazy VFP switch in Hyp mode, but once we exit and re-enter hyp mode we trap again on VFP access. This mode has shown around 30-50% improvement

Re: [PATCH v3 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-07-03 Thread Mario Smarduch
On 07/03/2015 04:53 AM, Christoffer Dall wrote: On Thu, Jul 02, 2015 at 02:51:57PM -0700, Mario Smarduch wrote: On 07/01/2015 06:46 AM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 05:04:11PM -0700, Mario Smarduch wrote: This patch only saves and restores FP/SIMD registers on Guest access

Re: [PATCH v3 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits

2015-07-02 Thread Mario Smarduch
On 07/01/2015 02:49 AM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 05:04:10PM -0700, Mario Smarduch wrote: Currently we save/restore fp/simd on each exit. Fist patch optimizes arm64 save/restore, we only do so on Guest access. hackbench and several lmbench tests show anywhere from 30

Re: [PATCH v3 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-07-02 Thread Mario Smarduch
On 07/01/2015 06:46 AM, Christoffer Dall wrote: On Wed, Jun 24, 2015 at 05:04:11PM -0700, Mario Smarduch wrote: This patch only saves and restores FP/SIMD registers on Guest access. To do this cptr_el2 FP/SIMD trap is set on Guest entry and later checked on exit. lmbench, hackbench show

Re: [PATCH 0/3] arm: KVM: VFP lazy switch in KVM Host Mode may save upto 98%

2015-06-28 Thread Mario Smarduch
if it is). Thanks, - Mario On 06/24/2015 08:30 PM, Mario Smarduch wrote: Currently we do a lazy VFP switch in Hyp mode, but once we exit and re-enter hyp mode we trap again on VFP access. This mode has shown around 30-50% improvement running hackbench and lmbench. This patch series extends lazy

[PATCH v3 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits

2015-06-24 Thread Mario Smarduch
in switch_to_guest_vfp per Marcs comment - Got another chance to replace an unreferenced label with a comment Mario Smarduch (2): Optimize arm64 skip 30-50% vfp/simd save/restore on exits keep arm vfp/simd exit handling consistent with arm64 arch/arm/kvm/interrupts.S| 14

[PATCH v3 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64

2015-06-24 Thread Mario Smarduch
After enhancing arm64 FP/SIMD exit handling, ARMv7 VFP exit branch is moved to guest trap handling. This allows us to keep exit handling flow between both architectures consistent. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/kvm/interrupts.S | 14 -- 1 file

[PATCH v3 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-06-24 Thread Mario Smarduch
This patch only saves and restores FP/SIMD registers on Guest access. To do this cptr_el2 FP/SIMD trap is set on Guest entry and later checked on exit. lmbench, hackbench show significant improvements, for 30-50% exits FP/SIMD context is not saved/restored Signed-off-by: Mario Smarduch m.smard

[PATCH 2/3] arm: KVM: Implement lazy VFP switching outside of Hyp Mode

2015-06-24 Thread Mario Smarduch
This patch implements the VFP context switch code called from vcpu_put in Host KVM. In addition it implements the logic to skip setting a VFP trap if one is not needed. Also resets the flag if Host KVM switched registers to trap new guest vfp accesses. Signed-off-by: Mario Smarduch m.smard

[PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state

2015-06-24 Thread Mario Smarduch
Define the required kvm_vcpu_arch fields, and offsets to manage VFP state. And declary Hyp interface function to switch VFP registers. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/include/asm/kvm_asm.h |1 + arch/arm/include/asm/kvm_host.h |3 +++ arch/arm/kernel

[PATCH 0/3] arm: KVM: VFP lazy switch in KVM Host Mode may save upto 98%

2015-06-24 Thread Mario Smarduch
. Currently ARM32 is addressed later ARM64. Mario Smarduch (3): define headers and offsets to mange VFP state Implement lazy VFP switching outside of Hyp Mode Add VFP lazy switch hooks in Host KVM arch/arm/include/asm/kvm_asm.h |1 + arch/arm/include/asm/kvm_host.h |3 +++ arch/arm/kernel

[PATCH 3/3] arm: KVM: Add VFP lazy switch hooks in Host KVM

2015-06-24 Thread Mario Smarduch
This patch implements host KVM interface to Hyp mode VFP function to switch out guest and switch in host. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/kvm/arm.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c

Re: [PATCH v2 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64

2015-06-18 Thread Mario Smarduch
On 06/18/2015 10:27 AM, Marc Zyngier wrote: On 16/06/15 22:50, Mario Smarduch wrote: After enhancing arm64 FP/SIMD exit handling, FP/SIMD exit branch is moved to guest trap handling. This keeps exiting handling flow between both architectures consistent. Signed-off-by: Mario Smarduch m.smard

Re: 32-bit fp/simd race - never mind :)

2015-06-17 Thread Mario Smarduch
I have been looking at it for too long, my concepts got twisted. On 06/17/2015 07:56 PM, Mario Smarduch wrote: Maybe I've been looking at this code too long, but it appears that on __kvm_vcpu_return we save/restore fp/simd registers and then change to hyp role. In between if we get

  1   2   3   4   5   >