lkml.org 
[lkml]   [2017]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/24] x86/mm: Allow flushing for future ASID switches
On Tue, Nov 28, 2017 at 05:39:08PM +0100, Peter Zijlstra wrote:

> @@ -220,7 +221,21 @@ For 32-bit we have the following conventions - kernel is built with
> .macro SWITCH_TO_USER_CR3 scratch_reg:req
> STATIC_JUMP_IF_FALSE .Lend_\@, kaiser_enabled_key, def=1
> mov %cr3, \scratch_reg
> - ADJUST_USER_CR3 \scratch_reg
> + push \scratch_reg
> + andq $(0x7FF), \scratch_reg
> + bt \scratch_reg, PER_CPU_VAR(__asid_flush)
> + jnc .Lnoflush_\@
> +
> + btr \scratch_reg, PER_CPU_VAR(__asid_flush)
> + pop \scratch_reg
> + jmp .Ldo_\@
> +
> +.Lnoflush_\@:
> + pop \scratch_reg
> + ALTERNATIVE "", "bts $63, \scratch_reg", X86_FEATURE_PCID
> +
> +.Ldo_\@:
> + orq $(KAISER_SWITCH_MASK), \scratch_reg
> mov \scratch_reg, %cr3
> .Lend_\@:
> .endm

Ah, I suppose I should also deal with RESTORE_CR3...

\
 
 \ /
  Last update: 2017-11-28 17:49    [W:0.133 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site