<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/x86/kernel/paravirt.c, branch v4.19</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>x86/paravirt: Fix some warning messages</title>
<updated>2018-09-19T11:22:04+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2018-09-19T10:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=571d0563c8881595f4ab027aef9ed1c55e3e7b7c'/>
<id>571d0563c8881595f4ab027aef9ed1c55e3e7b7c</id>
<content type='text'>
The first argument to WARN_ONCE() is a condition.

Fixes: 5800dc5c19f3 ("x86/paravirt: Fix spectre-v2 mitigations for paravirt guests")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Alok Kataria &lt;akataria@vmware.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: virtualization@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org
Link: https://lkml.kernel.org/r/20180919103553.GD9238@mwanda


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The first argument to WARN_ONCE() is a condition.

Fixes: 5800dc5c19f3 ("x86/paravirt: Fix spectre-v2 mitigations for paravirt guests")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Alok Kataria &lt;akataria@vmware.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: virtualization@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org
Link: https://lkml.kernel.org/r/20180919103553.GD9238@mwanda


</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mm: Only use tlb_remove_table() for paravirt</title>
<updated>2018-08-23T18:56:31+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2018-08-22T15:30:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48a8b97cfd804a965fbbe7be2d56a7984ef6bdb1'/>
<id>48a8b97cfd804a965fbbe7be2d56a7984ef6bdb1</id>
<content type='text'>
If we don't use paravirt; don't play unnecessary and complicated games
to free page-tables.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Rik van Riel &lt;riel@surriel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we don't use paravirt; don't play unnecessary and complicated games
to free page-tables.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Rik van Riel &lt;riel@surriel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/paravirt: Fix spectre-v2 mitigations for paravirt guests</title>
<updated>2018-08-07T20:15:02+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2018-08-03T14:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5800dc5c19f34e6e03b5adab1282535cb102fafd'/>
<id>5800dc5c19f34e6e03b5adab1282535cb102fafd</id>
<content type='text'>
Nadav reported that on guests we're failing to rewrite the indirect
calls to CALLEE_SAVE paravirt functions. In particular the
pv_queued_spin_unlock() call is left unpatched and that is all over the
place. This obviously wrecks Spectre-v2 mitigation (for paravirt
guests) which relies on not actually having indirect calls around.

The reason is an incorrect clobber test in paravirt_patch_call(); this
function rewrites an indirect call with a direct call to the _SAME_
function, there is no possible way the clobbers can be different
because of this.

Therefore remove this clobber check. Also put WARNs on the other patch
failure case (not enough room for the instruction) which I've not seen
trigger in my (limited) testing.

Three live kernel image disassemblies for lock_sock_nested (as a small
function that illustrates the problem nicely). PRE is the current
situation for guests, POST is with this patch applied and NATIVE is with
or without the patch for !guests.

PRE:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    callq  *0xffffffff822299e8
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063ae0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.

POST:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    callq  0xffffffff810a0c20 &lt;__raw_callee_save___pv_queued_spin_unlock&gt;
   0xffffffff817be9a5 &lt;+53&gt;:    xchg   %ax,%ax
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063aa0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.

NATIVE:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    movb   $0x0,(%rdi)
   0xffffffff817be9a3 &lt;+51&gt;:    nopl   0x0(%rax)
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063ae0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.


Fixes: 63f70270ccd9 ("[PATCH] i386: PARAVIRT: add common patching machinery")
Fixes: 3010a0663fd9 ("x86/paravirt, objtool: Annotate indirect calls")
Reported-by: Nadav Amit &lt;namit@vmware.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nadav reported that on guests we're failing to rewrite the indirect
calls to CALLEE_SAVE paravirt functions. In particular the
pv_queued_spin_unlock() call is left unpatched and that is all over the
place. This obviously wrecks Spectre-v2 mitigation (for paravirt
guests) which relies on not actually having indirect calls around.

The reason is an incorrect clobber test in paravirt_patch_call(); this
function rewrites an indirect call with a direct call to the _SAME_
function, there is no possible way the clobbers can be different
because of this.

Therefore remove this clobber check. Also put WARNs on the other patch
failure case (not enough room for the instruction) which I've not seen
trigger in my (limited) testing.

Three live kernel image disassemblies for lock_sock_nested (as a small
function that illustrates the problem nicely). PRE is the current
situation for guests, POST is with this patch applied and NATIVE is with
or without the patch for !guests.

PRE:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    callq  *0xffffffff822299e8
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063ae0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.

POST:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    callq  0xffffffff810a0c20 &lt;__raw_callee_save___pv_queued_spin_unlock&gt;
   0xffffffff817be9a5 &lt;+53&gt;:    xchg   %ax,%ax
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063aa0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.

NATIVE:

(gdb) disassemble lock_sock_nested
Dump of assembler code for function lock_sock_nested:
   0xffffffff817be970 &lt;+0&gt;:     push   %rbp
   0xffffffff817be971 &lt;+1&gt;:     mov    %rdi,%rbp
   0xffffffff817be974 &lt;+4&gt;:     push   %rbx
   0xffffffff817be975 &lt;+5&gt;:     lea    0x88(%rbp),%rbx
   0xffffffff817be97c &lt;+12&gt;:    callq  0xffffffff819f7160 &lt;_cond_resched&gt;
   0xffffffff817be981 &lt;+17&gt;:    mov    %rbx,%rdi
   0xffffffff817be984 &lt;+20&gt;:    callq  0xffffffff819fbb00 &lt;_raw_spin_lock_bh&gt;
   0xffffffff817be989 &lt;+25&gt;:    mov    0x8c(%rbp),%eax
   0xffffffff817be98f &lt;+31&gt;:    test   %eax,%eax
   0xffffffff817be991 &lt;+33&gt;:    jne    0xffffffff817be9ba &lt;lock_sock_nested+74&gt;
   0xffffffff817be993 &lt;+35&gt;:    movl   $0x1,0x8c(%rbp)
   0xffffffff817be99d &lt;+45&gt;:    mov    %rbx,%rdi
   0xffffffff817be9a0 &lt;+48&gt;:    movb   $0x0,(%rdi)
   0xffffffff817be9a3 &lt;+51&gt;:    nopl   0x0(%rax)
   0xffffffff817be9a7 &lt;+55&gt;:    pop    %rbx
   0xffffffff817be9a8 &lt;+56&gt;:    pop    %rbp
   0xffffffff817be9a9 &lt;+57&gt;:    mov    $0x200,%esi
   0xffffffff817be9ae &lt;+62&gt;:    mov    $0xffffffff817be993,%rdi
   0xffffffff817be9b5 &lt;+69&gt;:    jmpq   0xffffffff81063ae0 &lt;__local_bh_enable_ip&gt;
   0xffffffff817be9ba &lt;+74&gt;:    mov    %rbp,%rdi
   0xffffffff817be9bd &lt;+77&gt;:    callq  0xffffffff817be8c0 &lt;__lock_sock&gt;
   0xffffffff817be9c2 &lt;+82&gt;:    jmp    0xffffffff817be993 &lt;lock_sock_nested+35&gt;
End of assembler dump.


Fixes: 63f70270ccd9 ("[PATCH] i386: PARAVIRT: add common patching machinery")
Fixes: 3010a0663fd9 ("x86/paravirt, objtool: Annotate indirect calls")
Reported-by: Nadav Amit &lt;namit@vmware.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mm: Rename flush_tlb_single() and flush_tlb_one() to __flush_tlb_one_[user|kernel]()</title>
<updated>2018-02-15T00:15:52+00:00</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2018-01-31T16:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1299ef1d8870d2d9f09a5aadf2f8b2c887c2d033'/>
<id>1299ef1d8870d2d9f09a5aadf2f8b2c887c2d033</id>
<content type='text'>
flush_tlb_single() and flush_tlb_one() sound almost identical, but
they really mean "flush one user translation" and "flush one kernel
translation".  Rename them to flush_tlb_one_user() and
flush_tlb_one_kernel() to make the semantics more obvious.

[ I was looking at some PTI-related code, and the flush-one-address code
  is unnecessarily hard to understand because the names of the helpers are
  uninformative.  This came up during PTI review, but no one got around to
  doing it. ]

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Eduardo Valentin &lt;eduval@amazon.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Kees Cook &lt;keescook@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Linux-MM &lt;linux-mm@kvack.org&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Link: http://lkml.kernel.org/r/3303b02e3c3d049dc5235d5651e0ae6d29a34354.1517414378.git.luto@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flush_tlb_single() and flush_tlb_one() sound almost identical, but
they really mean "flush one user translation" and "flush one kernel
translation".  Rename them to flush_tlb_one_user() and
flush_tlb_one_kernel() to make the semantics more obvious.

[ I was looking at some PTI-related code, and the flush-one-address code
  is unnecessarily hard to understand because the names of the helpers are
  uninformative.  This came up during PTI review, but no one got around to
  doing it. ]

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Eduardo Valentin &lt;eduval@amazon.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Kees Cook &lt;keescook@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Linux-MM &lt;linux-mm@kvack.org&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Link: http://lkml.kernel.org/r/3303b02e3c3d049dc5235d5651e0ae6d29a34354.1517414378.git.luto@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>locking/paravirt: Use new static key for controlling call of virt_spin_lock()</title>
<updated>2017-10-10T09:50:12+00:00</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2017-09-06T17:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9043442b43b1fddf202591b84702863286700c1a'/>
<id>9043442b43b1fddf202591b84702863286700c1a</id>
<content type='text'>
There are cases where a guest tries to switch spinlocks to bare metal
behavior (e.g. by setting "xen_nopvspin" boot parameter). Today this
has the downside of falling back to unfair test and set scheme for
qspinlocks due to virt_spin_lock() detecting the virtualized
environment.

Add a static key controlling whether virt_spin_lock() should be
called or not. When running on bare metal set the new key to false.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: akataria@vmware.com
Cc: boris.ostrovsky@oracle.com
Cc: chrisw@sous-sol.org
Cc: hpa@zytor.com
Cc: jeremy@goop.org
Cc: rusty@rustcorp.com.au
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170906173625.18158-2-jgross@suse.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are cases where a guest tries to switch spinlocks to bare metal
behavior (e.g. by setting "xen_nopvspin" boot parameter). Today this
has the downside of falling back to unfair test and set scheme for
qspinlocks due to virt_spin_lock() detecting the virtualized
environment.

Add a static key controlling whether virt_spin_lock() should be
called or not. When running on bare metal set the new key to false.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: akataria@vmware.com
Cc: boris.ostrovsky@oracle.com
Cc: chrisw@sous-sol.org
Cc: hpa@zytor.com
Cc: jeremy@goop.org
Cc: rusty@rustcorp.com.au
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170906173625.18158-2-jgross@suse.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/paravirt: Remove no longer used paravirt functions</title>
<updated>2017-09-13T08:55:15+00:00</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2017-09-04T10:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87930019c713873a1c3b9bd55dde46e81f70c8f1'/>
<id>87930019c713873a1c3b9bd55dde46e81f70c8f1</id>
<content type='text'>
With removal of lguest some of the paravirt functions are no longer
needed:

	-&gt;read_cr4()
	-&gt;store_idt()
	-&gt;set_pmd_at()
	-&gt;set_pud_at()
	-&gt;pte_update()

Remove them.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: akataria@vmware.com
Cc: boris.ostrovsky@oracle.com
Cc: chrisw@sous-sol.org
Cc: jeremy@goop.org
Cc: rusty@rustcorp.com.au
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170904102527.25409-1-jgross@suse.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With removal of lguest some of the paravirt functions are no longer
needed:

	-&gt;read_cr4()
	-&gt;store_idt()
	-&gt;set_pmd_at()
	-&gt;set_pud_at()
	-&gt;pte_update()

Remove them.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: akataria@vmware.com
Cc: boris.ostrovsky@oracle.com
Cc: chrisw@sous-sol.org
Cc: jeremy@goop.org
Cc: rusty@rustcorp.com.au
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170904102527.25409-1-jgross@suse.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/xen: Get rid of paravirt op adjust_exception_frame</title>
<updated>2017-08-31T19:35:10+00:00</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2017-08-31T17:42:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5878d5d6fdef6447d73b0acc121ba445bef37f53'/>
<id>5878d5d6fdef6447d73b0acc121ba445bef37f53</id>
<content type='text'>
When running as Xen pv-guest the exception frame on the stack contains
%r11 and %rcx additional to the other data pushed by the processor.

Instead of having a paravirt op being called for each exception type
prepend the Xen specific code to each exception entry. When running as
Xen pv-guest just use the exception entry with prepended instructions,
otherwise use the entry without the Xen specific code.

[ tglx: Merged through tip to avoid ugly merge conflict ]

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: xen-devel@lists.xenproject.org
Cc: boris.ostrovsky@oracle.com
Cc: luto@amacapital.net
Link: http://lkml.kernel.org/r/20170831174249.26853-1-jg@pfupf.net
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When running as Xen pv-guest the exception frame on the stack contains
%r11 and %rcx additional to the other data pushed by the processor.

Instead of having a paravirt op being called for each exception type
prepend the Xen specific code to each exception entry. When running as
Xen pv-guest just use the exception entry with prepended instructions,
otherwise use the entry without the Xen specific code.

[ tglx: Merged through tip to avoid ugly merge conflict ]

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: xen-devel@lists.xenproject.org
Cc: boris.ostrovsky@oracle.com
Cc: luto@amacapital.net
Link: http://lkml.kernel.org/r/20170831174249.26853-1-jg@pfupf.net
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mm: Split read_cr3() into read_cr3_pa() and __read_cr3()</title>
<updated>2017-06-13T06:48:09+00:00</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2017-06-12T17:26:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c690ee1039b251e583fc65b28da30e97d6a7385'/>
<id>6c690ee1039b251e583fc65b28da30e97d6a7385</id>
<content type='text'>
The kernel has several code paths that read CR3.  Most of them assume that
CR3 contains the PGD's physical address, whereas some of them awkwardly
use PHYSICAL_PAGE_MASK to mask off low bits.

Add explicit mask macros for CR3 and convert all of the CR3 readers.
This will keep them from breaking when PCID is enabled.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: xen-devel &lt;xen-devel@lists.xen.org&gt;
Link: http://lkml.kernel.org/r/883f8fb121f4616c1c1427ad87350bb2f5ffeca1.1497288170.git.luto@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The kernel has several code paths that read CR3.  Most of them assume that
CR3 contains the PGD's physical address, whereas some of them awkwardly
use PHYSICAL_PAGE_MASK to mask off low bits.

Add explicit mask macros for CR3 and convert all of the CR3 readers.
This will keep them from breaking when PCID is enabled.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Juergen Gross &lt;jgross@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: xen-devel &lt;xen-devel@lists.xen.org&gt;
Link: http://lkml.kernel.org/r/883f8fb121f4616c1c1427ad87350bb2f5ffeca1.1497288170.git.luto@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/paravirt: Add 5-level support to the paravirt code</title>
<updated>2017-04-04T06:22:34+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2017-03-30T08:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=335437fbf7d3a630d775f06c9ee37d60919561d8'/>
<id>335437fbf7d3a630d775f06c9ee37d60919561d8</id>
<content type='text'>
Add operations to allocate/release p4ds.

Xen requires more work. We will need to come back to it.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170330080731.65421-5-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add operations to allocate/release p4ds.

Xen requires more work. We will need to come back to it.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170330080731.65421-5-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Convert the rest of the code to support p4d_t</title>
<updated>2017-03-27T06:56:58+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2017-03-17T18:55:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f2a6a7050109e0a5c7a84c70aa6010f682b2f1ee'/>
<id>f2a6a7050109e0a5c7a84c70aa6010f682b2f1ee</id>
<content type='text'>
This patch converts x86 to use proper folding of a new (fifth) page table level
with &lt;asm-generic/pgtable-nop4d.h&gt;.

That's a bit of a kitchen sink patch, but I don't see how to split it further
without hurting bisectability.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170317185515.8636-7-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch converts x86 to use proper folding of a new (fifth) page table level
with &lt;asm-generic/pgtable-nop4d.h&gt;.

That's a bit of a kitchen sink patch, but I don't see how to split it further
without hurting bisectability.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170317185515.8636-7-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
