Re: [RFC PATCH v2 13/15] khwasan: add hooks implementation

2018-04-06 Thread Andrey Konovalov
On Thu, Apr 5, 2018 at 3:02 PM, Andrey Ryabinin wrote: > On 04/04/2018 08:00 PM, Andrey Konovalov wrote: >> On Wed, Apr 4, 2018 at 2:39 PM, Andrey Ryabinin >> wrote: > > You can save tag somewhere in page struct and make page_address()

Re: [RFC PATCH v2 13/15] khwasan: add hooks implementation

2018-04-06 Thread Andrey Ryabinin
On 04/06/2018 03:14 PM, Andrey Konovalov wrote: > On Thu, Apr 5, 2018 at 3:02 PM, Andrey Ryabinin > wrote: >> On 04/04/2018 08:00 PM, Andrey Konovalov wrote: >>> On Wed, Apr 4, 2018 at 2:39 PM, Andrey Ryabinin >>> wrote: >> >> You can

Re: [RFC PATCH v2 2/3] KVM: arm64: Convert lazy FPSIMD context switch trap to C

2018-04-06 Thread Marc Zyngier
Hi Dave, On 06/04/18 16:01, Dave Martin wrote: > To make the lazy FPSIMD context switch trap code easier to hack on, > this patch converts it to C. > > This is not amazingly efficient, but the trap should typically only > be taken once per host context switch. > > Signed-off-by: Dave Martin

[PATCH] ARM64: KVM: use lm_alias() for kvm_ksym_ref()

2018-04-06 Thread Mark Rutland
For historical reasons, we open-code lm_alias() in kvm_ksym_ref(). Let's use lm_alias() to avoid duplication and make things clearer. As we have to pull this from (which is not safe for includion in assembly), we may as well move the kvm_ksym_ref() definition into the existing !__ASSEMBLY__

[RFC PATCH v2 0/3] KVM: arm64: Optimise FPSIMD context switching

2018-04-06 Thread Dave Martin
This is a respin of my attempt to improve FPSIMD context handling for KVM, building on the previous RFC [1]. These patches are based on torvalds/master, but it should be sufficient to cherry-pick commit 20b8547277a6 ("arm64: fpsimd: Split cpu field out from struct fpsimd_state") onto v4.16. See

[RFC PATCH v2 3/3] KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing

2018-04-06 Thread Dave Martin
This patch refactors KVM to align the host and guest FPSIMD save/restore logic with each other for arm64. This reduces the number of redundant save/restore operations that must occur, and reduces the common-case IRQ blackout time during guest exit storms by saving the host state lazily and

[RFC PATCH v2 2/3] KVM: arm64: Convert lazy FPSIMD context switch trap to C

2018-04-06 Thread Dave Martin
To make the lazy FPSIMD context switch trap code easier to hack on, this patch converts it to C. This is not amazingly efficient, but the trap should typically only be taken once per host context switch. Signed-off-by: Dave Martin --- Since RFCv1: * Fix indentation to

[RFC PATCH v2 1/3] KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change

2018-04-06 Thread Dave Martin
From: Christoffer Dall KVM/ARM differs from other architectures in having to maintain an additional virtual address space from that of the host and the guest, because we split the execution of KVM across both EL1 and EL2. This results in a need to explicitly map

Re: [RFC PATCH v2 2/3] KVM: arm64: Convert lazy FPSIMD context switch trap to C

2018-04-06 Thread Dave Martin
On Fri, Apr 06, 2018 at 04:25:57PM +0100, Marc Zyngier wrote: > Hi Dave, > > On 06/04/18 16:01, Dave Martin wrote: > > To make the lazy FPSIMD context switch trap code easier to hack on, > > this patch converts it to C. > > > > This is not amazingly efficient, but the trap should typically only