: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/asm.h | 61 +-
arch/x86/kernel/macros.S | 1 +
2 files changed, 28 insertions(+), 34 deletions(-)
di
Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/cpufeature.h | 82 ++-
arch/x86/kernel/macros.S | 1 +
2 files changed, 48 insertions(+), 35 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature
Mel Gorman wrote:
> On Wed, Jun 06, 2018 at 08:55:15AM -0700, Nadav Amit wrote:
>>> -#define LATENCY_LIMIT (64 * PAGE_SIZE)
>>> +#define LATENCY_LIMIT (PMD_SIZE)
>>>
>>> unsigned long move_page_tables(struct vm_area_struct *vma,
>>
Mel Gorman wrote:
> Commit 5d1904204c99 ("mremap: fix race between mremap() and page cleanning")
> fixed races between mremap and other operations for both file-backed and
> anonymous mappings. The file-backed was the most critical as it allowed the
> possibility that data could be changed on a p
Mel Gorman wrote:
> On Tue, Jun 05, 2018 at 12:53:57PM -0700, Nadav Amit wrote:
>> While I do not have a specific reservation regarding the logic, I find the
>> current TLB invalidation scheme hard to follow and inconsistent. I guess
>> should_force_flush() can be extended a
Mel Gorman wrote:
> Commit 5d1904204c99 ("mremap: fix race between mremap() and page cleanning")
> fixed races between mremap and other operations for both file-backed and
> anonymous mappings. The file-backed was the most critical as it allowed the
> possibility that data could be changed on a p
Kees Cook wrote:
> On Mon, Jun 4, 2018 at 4:21 AM, Nadav Amit wrote:
>> GCC considers the number of statements in inlined assembly blocks,
>> according to new-lines and semicolons, as an indication to the cost of
>> the block in time and space. This data is distort
;)
Signed-off-by: Nadav Amit
---
drivers/gpio/gpio-menz127.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-menz127.c b/drivers/gpio/gpio-menz127.c
index e1037582e34d..b2635326546e 100644
--- a/drivers/gpio/gpio-menz127.c
+++ b/drivers/gpio/gpio-menz127.
)
Functions such as kref_get(), free_user(), fuse_file_get() now get
inlined.
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Kees Cook
Cc: Jan Beulich
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/refco
Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/cpufeature.h | 82 ++-
arch/x86/kernel/macros.S | 1 +
2 files changed, 48 insertions(+), 35 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature
Using macros for inline assembly improves both readability and
compilation decisions that are distorted by big assembly blocks that use
alternative sections. Compile macros.S and use it to assemble all C
files. Currently, only x86 will use it.
Signed-off-by: Nadav Amit
---
Makefile
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: virtualizat...@lists.linux-foundation.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/paravirt_types.h | 54 +++
arch/x86/kernel/macros.S | 1 +
2 files changed, 31 inserti
: 40302 (-19)
Cc: Christopher Li
Cc: linux-spa...@vger.kernel.org
Signed-off-by: Nadav Amit
---
arch/x86/kernel/macros.S | 2 ++
include/linux/compiler.h | 60 +++-
2 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/arch/x86/kernel/macros.S b/arch
: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/asm.h | 61 +-
arch/x86/kernel/macros.S | 1 +
2 files changed, 28 insertions(+), 34 deletions(-)
di
nel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/alternative-asm.h | 20 ++--
arch/x86/include/asm/alternative.h | 16 ++--
arch/x86/kernel/macros.S | 1 +
3 files changed, 17 insertions(+), 20 deletions(-)
diff --git
: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Greg Kroah-Hartman
Cc: Kate Stewart
Cc: Philippe Ombredanne
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/jump_label.h | 65 ++-
arch/x86/kernel/macros.S | 1
(-165)
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bug.h | 98 ++
arch/x86/kernel/macros.S | 1 +
2 files changed, 57
.org
Reported-by: Oleksandr Natalenko
Signed-off-by: Gil Kupfer
Signed-off-by: Nadav Amit
Reviewed-by: Xavier Deguillard
Tested-by: Oleksandr Natalenko
---
drivers/misc/vmw_balloon.c | 23 +++
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/misc
Greg Kroah-Hartman wrote:
> On Thu, May 31, 2018 at 08:56:52PM +0000, Nadav Amit wrote:
>> Nadav Amit wrote:
>>
>>> Nadav Amit wrote:
>>>
>>>> Ping. Please consider it for inclusion for rc4.
>>>>
>>>> Nadav Amit wrote:
Jia-Ju Bai wrote:
>
>
> On 2018/5/31 22:30, Christopher Lameter wrote:
>> On Thu, 31 May 2018, Matthew Wilcox wrote:
>>
Freeing a page in the page allocator also was traditionally not sleeping.
That has changed?
>>> No. "Your bug" being "The bug in your static analysis tool". It pr
Nadav Amit wrote:
> Nadav Amit wrote:
>
>> Ping. Please consider it for inclusion for rc4.
>>
>> Nadav Amit wrote:
>>
>>> From: Gil Kupfer
>>>
>>> The balloon.page field is used for two different purposes if batching is
>>&g
Nadav Amit wrote:
> Ping. Please consider it for inclusion for rc4.
>
> Nadav Amit wrote:
>
>> From: Gil Kupfer
>>
>> The balloon.page field is used for two different purposes if batching is
>> on or off. If batching is on, the field point to the page
Dave Hansen wrote:
> On 05/22/2018 10:51 AM, Matthew Wilcox wrote:
>> But CR3 is a per-CPU register. So it'd be *possible* to allocate one
>> PGD per CPU (per process). Have them be identical in all but one of
>> the PUD entries. Then you've reserved 1/512 of your address space for
>> per-CPU
h...@zytor.com wrote:
> On May 18, 2018 12:21:00 PM PDT, Linus Torvalds
> wrote:
>> On Fri, May 18, 2018 at 12:18 PM Nadav Amit wrote:
>>
>>> Gnu ASM manual says: "Each time you run as it assembles exactly one
>> source
>>> program. The
Linus Torvalds wrote:
> On Fri, May 18, 2018 at 12:02 PM Nadav Amit wrote:
>
>> I can add a -Wa,[filename.s] switch. It works, but sort of undocumented.
>
> Oh, if it assembles things together, then that sounds optimal.
>
> And yes, like hpa says, we should ma
h...@zytor.com wrote:
> On May 18, 2018 11:50:12 AM PDT, Linus Torvalds
> wrote:
>> On Fri, May 18, 2018 at 11:34 AM wrote:
>>
>>> On May 18, 2018 11:25:32 AM PDT, Linus Torvalds <
>> torva...@linux-foundation.org> wrote:
>>
>>> Unfortunately gcc doesn't guarantee that global assembly inlines
Linus Torvalds wrote:
> On Fri, May 18, 2018 at 12:59 AM Peter Zijlstra
> wrote:
>
>> This is an awesome hack, but is there really nothing we can do to make
>> it more readable? Esp, that global asm doing the macro definition is a
>> pain to read.
>
> I actually find that macro to be *more* le
Borislav Petkov wrote:
> On Fri, May 18, 2018 at 03:46:33PM +0000, Nadav Amit wrote:
>> In case you didn’t read the cover-letter: the patch-set does give a 2%
>> performance improvement for #PF-MADV_DONTNEED microbenchmark loop.
>
> I saw it but *micro*-benchmark doesn'
Borislav Petkov wrote:
> On Fri, May 18, 2018 at 02:36:21PM +0000, Nadav Amit wrote:
>> I didn’t try too hard to find more affected (micro)benchmarks, but I am
>> pretty sure there are:
>
> So you being pretty sure there are, doesn't make me go, oh, ok, then,
> this
Borislav Petkov wrote:
> On Fri, May 18, 2018 at 10:13:54AM +0200, Ingo Molnar wrote:
>> Yes, that's my main worry too about all these inlining changes:
>> the very, very marked reduction in the readability of assembly code.
>
> Same reaction here: the small improvements this brings is simply no
Ingo Molnar wrote:
>
> * Peter Zijlstra wrote:
>
>> On Thu, May 17, 2018 at 09:13:58AM -0700, Nadav Amit wrote:
>>> +asm(".macro __BUG_FLAGS ins:req file:req line:req flags:req size:req\n"
>>> +"1:\t \\ins\n\t"
>>> +&q
Peter Zijlstra wrote:
> On Thu, May 17, 2018 at 09:13:58AM -0700, Nadav Amit wrote:
>> +asm(".macro __BUG_FLAGS ins:req file:req line:req flags:req size:req\n"
>> +"1:\t \\ins\n\t"
>> +".pushsection __bug_table,\"aw\"\n"
>&
David Laight wrote:
> From: Nadav Amit
>> Sent: 17 May 2018 17:14
>> This patch-set deals with an interesting yet stupid problem: kernel code
>> that does not get inlined despite its simplicity. There are several
>> causes for this behavior: "cold" at
er
Cc: virtualizat...@lists.linux-foundation.org
Cc: x...@kernel.org
Nadav Amit (6):
x86: objtool: use asm macro for better compiler decisions
x86: bug: prevent gcc distortions
x86: alternative: macrofy locks for better inlining
x86: prevent inline distortion by paravirt ops
x86: refcoun
: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Kees Cook
Cc: Jan Beulich
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/refcount.h | 62 +
1 file changed, 39 insertions(+), 23 deletions(-)
diff --git a/arch/x86/i
text symbols:
Before: 40033
After: 40015 (-18)
Cc: Christopher Li
Cc: linux-spa...@vger.kernel.org
Signed-off-by: Nadav Amit
---
include/linux/compiler.h | 37 +
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/include/linux/compiler.h b/include
nel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/alternative.h | 34 +++---
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/alternative.h
b/arch/x86/include/asm/alternative.h
index 4cd6a3b71824..1dc47c9fd480 10
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: virtualizat...@lists.linux-foundation.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/paravirt_types.h | 63 +--
1 file changed, 39 insertions(+), 24 deletions(-)
diff --git a/arch/x86/i
kernel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/asm.h | 4 ++--
arch/x86/include/asm/cmpxchg.h | 10 +-
arch/x86/include/asm/special_insns.h | 12 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/i
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bug.h | 56 +-
1 file changed, 37 insertions(+), 19 deletions(-)
diff --git a/arch/x86/i
Jan Beulich wrote:
On 15.05.18 at 16:11, wrote:
>> --- a/arch/x86/include/asm/refcount.h
>> +++ b/arch/x86/include/asm/refcount.h
>> @@ -14,34 +14,43 @@
>> * central refcount exception. The fixup address for the exception points
>> * back to the regular execution flow in .text.
>> */
>>
Kees Cook wrote:
> On Tue, May 15, 2018 at 7:11 AM, Nadav Amit wrote:
>> GCC considers the number of statements in inlined assembly blocks,
>> according to new-lines and semicolons, as an indication to the cost of
>> the block in time and space. This data is distort
Josh Poimboeuf wrote:
> On Tue, May 15, 2018 at 07:11:07AM -0700, Nadav Amit wrote:
>> This patch-set deals with an interesting yet stupid problem: code that
>> does not get inlined despite its simplicity.
>
> I got the 0/8 patch twice, and didn't get the 1/8 patch.
Nadav Amit wrote:
> This patch-set deals with an interesting yet stupid problem: code that
> does not get inlined despite its simplicity.
>
> I find 5 classes of causes:
>
> 1. Inline assembly blocks in which code and data are added to
> alternative sections. The compile
Josh Triplett wrote:
> On Tue, May 15, 2018 at 07:11:08AM -0700, Nadav Amit wrote:
>> GCC considers the number of statements in inlined assembly blocks,
>> according to new-lines and semicolons, as an indication to the cost of
>> the block in time and space. This data is di
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: virtualizat...@lists.linux-foundation.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/paravirt_types.h | 53 +++
1 file changed, 30 insertions(+), 23 deletions(-)
diff --git a/arch/x86/i
...@lists.linux-foundation.org
Cc: x...@kernel.org
Nadav Amit (8):
x86: objtool: use asm macro for better compiler decisions
x86: bug: prevent gcc distortions
x86: alternative: macrofy locks for better inlining
x86: prevent inline distortion by paravirt ops
x86: refcount: prevent gcc dist
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bug.h | 48 +++---
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/arch/x86/i
kernel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/asm.h | 4 ++--
arch/x86/include/asm/cmpxchg.h | 10 +-
arch/x86/include/asm/special_insns.h | 12 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/i
5 10064176 2936832 31150173 1db505d ./vmlinux after (+437)
Static text symbols:
Before: 39650
After: 39643 (-7)
Cc: Randy Dunlap
Cc: Jonathan Corbet
Signed-off-by: Nadav Amit
---
include/linux/log2.h | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linu
73 1db505d ./vmlinux before
18149210 10064048 2936832 31150090 1db500a ./vmlinux after (-83)
Static text symbols:
Before: 39643
After: 39632 (-11)
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bito
nel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/alternative.h | 28
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/alternative.h
b/arch/x86/include/asm/alternative.h
index 4cd6a3b71824..daa68ad51665 10
: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Kees Cook
Cc: Jan Beulich
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/refcount.h | 55 -
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/arch/x86/i
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Peter Zijlstra
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bug.h | 48 +++---
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/arch/x86/i
text symbols:
Before: 40033
After: 40015 (-18)
Cc: Christopher Li
Cc: linux-spa...@vger.kernel.org
Signed-off-by: Nadav Amit
---
include/linux/compiler.h | 29 +
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux
text symbols:
Before: 40033
After: 40015 (-18)
Cc: Christopher Li
Cc: linux-spa...@vger.kernel.org
Signed-off-by: Nadav Amit
---
include/linux/compiler.h | 29 +
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux
Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: virtualizat...@lists.linux-foundation.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/paravirt_types.h | 53 +++
1 file changed, 30 insertions(+), 23 deletions(-)
diff --git a/arch/x86/i
...@lists.linux-foundation.org
Cc: x...@kernel.org
Nadav Amit (8):
x86: objtool: use asm macro for better compiler decisions
x86: bug: prevent gcc distortions
x86: alternative: macrofy locks for better inlining
x86: prevent inline distortion by paravirt ops
x86: refcount: prevent gcc dist
: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Cc: Kees Cook
Cc: Jan Beulich
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/refcount.h | 55 -
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/arch/x86/i
73 1db505d ./vmlinux before
18149210 10064048 2936832 31150090 1db500a ./vmlinux after (-83)
Static text symbols:
Before: 39643
After: 39632 (-11)
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: "H. Peter Anvin"
Cc: x...@kernel.org
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/bito
5 10064176 2936832 31150173 1db505d ./vmlinux after (+437)
Static text symbols:
Before: 39650
After: 39643 (-7)
Cc: Randy Dunlap
Cc: Jonathan Corbet
Signed-off-by: Nadav Amit
---
include/linux/log2.h | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linu
kernel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/asm.h | 4 ++--
arch/x86/include/asm/cmpxchg.h | 10 +-
arch/x86/include/asm/special_insns.h | 12 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/x86/i
nel.org
Cc: Josh Poimboeuf
Signed-off-by: Nadav Amit
---
arch/x86/include/asm/alternative.h | 28
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/alternative.h
b/arch/x86/include/asm/alternative.h
index 4cd6a3b71824..daa68ad51665 10
Paolo Bonzini wrote:
> On 05/05/2018 19:22, Nadav Amit wrote:
>> Paolo Bonzini wrote:
>>
>>> -ftracer can duplicate asm blocks causing compilation to fail in
>>> noclone functions. For example, KVM declares a global variable
>>> in an asm like
>>
Paolo Bonzini wrote:
> -ftracer can duplicate asm blocks causing compilation to fail in
> noclone functions. For example, KVM declares a global variable
> in an asm like
>
>asm("2: ... \n
> .pushsection data \n
> .global vmx_return \n
> vmx_return: .long 2b");
>
> a
Sinan Kaya wrote:
> +Bjorn,
>
> On 5/3/2018 9:59 AM, Joerg Roedel wrote:
>> On Thu, May 03, 2018 at 09:46:34AM -0400, Sinan Kaya wrote:
>>> I also like the idea in general.
>>> Minor nit..
>>>
>>> Shouldn't this be an iommu parameter rather than a PCI kernel command line
>>> parameter?
>>> We
Linus Torvalds wrote:
> On Tue, May 1, 2018 at 9:46 AM Nadav Amit wrote:
>
>> My bad. It’s not the new-line. Let me do some more digging.
>
> From the gcc docs:
>
> Some targets require that GCC track the size of each instruction used
> in order to generate
Nadav Amit wrote:
> Linus Torvalds wrote:
>
>> On Tue, May 1, 2018 at 6:40 AM Josh Poimboeuf wrote:
>>
>>> But if I remove the section completely by removing the
>>> pushsection/popsection, then copy_overflow() gets inlined.
>>
>>> So GCC
Linus Torvalds wrote:
> On Tue, May 1, 2018 at 6:40 AM Josh Poimboeuf wrote:
>
>> But if I remove the section completely by removing the
>> pushsection/popsection, then copy_overflow() gets inlined.
>
>> So GCC's inlining decisions are somehow influenced by the existence of
>> some random empt
When gcc considers the size of a function for inlining decisions, it
apparently considers *all* sections. Since the kernel extensively uses
sections for things other than code (e.g., exception-table, bug-table), the
optimality of these decisions seem questionable to me.
The objtool’s sections may
Ping. Please consider it for inclusion for rc4.
Nadav Amit wrote:
> From: Gil Kupfer
>
> The balloon.page field is used for two different purposes if batching is
> on or off. If batching is on, the field point to the page which is used
> to communicate with with the hyperviso
Cc: Andy Lutomirski
> Cc: Arjan van de Ven
> Cc: Borislav Petkov
> Cc: Dan Williams
> Cc: David Woodhouse
> Cc: Greg Kroah-Hartman
> Cc: Hugh Dickins
> Cc: Josh Poimboeuf
> Cc: Juergen Gross
> Cc: Kees Cook
> Cc: Linus Torvalds
> Cc: Nadav Amit
> Cc:
.org
Reported-by: Oleksandr Natalenko
Signed-off-by: Gil Kupfer
Signed-off-by: Nadav Amit
Reviewed-by: Xavier Deguillard
---
drivers/misc/vmw_balloon.c | 23 +++
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw
Oleksandr Natalenko wrote:
> Hello.
>
> On Fri, Mar 23, 2018 at 9:42 AM, Oleksandr Natalenko
> wrote:
>>> Actually, rechecking the bug description, I might have rushed. The bug that
>>> I encountered is related to the vunmap() but it is only caused when batching
>>> is off, while the bug you re
Dave Hansen wrote:
> On 04/03/2018 09:45 PM, Nadav Amit wrote:
>> Dave Hansen wrote:
>>
>>> From: Dave Hansen
>>>
>>> The entry/exit text and cpu_entry_area are mapped into userspace and
>>> the kernel. But, they are not _PAGE_GLOBAL. Th
gned-off-by: Dave Hansen
> Cc: Andrea Arcangeli
> Cc: Andy Lutomirski
> Cc: Linus Torvalds
> Cc: Kees Cook
> Cc: Hugh Dickins
> Cc: Juergen Gross
> Cc: x...@kernel.org
> Cc: Nadav Amit
> ---
>
> b/arch/x86/mm/cpu_entry_area.c | 10 +-
> b/arch/x
Dave Hansen wrote:
> On 03/23/2018 12:15 PM, Nadav Amit wrote:
>>> A PTE is constructed from a physical address and a pgprotval_t.
>>> __PAGE_KERNEL, for instance, is a pgprot_t and must be converted
>>> into a pgprotval_t before it can be used to create a PTE
Dave Hansen wrote:
>
> From: Dave Hansen
>
> A PTE is constructed from a physical address and a pgprotval_t.
> __PAGE_KERNEL, for instance, is a pgprot_t and must be converted
> into a pgprotval_t before it can be used to create a PTE. This is
> done implicitly within functions like set_pte()
Dave Hansen wrote:
>
> From: Dave Hansen
>
> The entry/exit text and cpu_entry_area are mapped into userspace and
> the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary
> TLB misses.
>
> Add the _PAGE_GLOBAL flag for these areas.
>
> static void __init
> diff -puN arch/x86/
Oleksandr Natalenko wrote:
> Hi.
>
> On Mon, Mar 19, 2018 at 7:52 PM, Nadav Amit wrote:
>>> Oleksandr, if you can confirm that it fixes the bug you encountered, it
>>> would be great.
>>>
>>> Greg, Arnd, on your free time, please let me know
Nadav Amit wrote:
> Nadav Amit wrote:
>
>> From: Gil Kupfer
>>
>> The balloon.page field is used for two different purposes if batching is
>> on or off. If batching is on, the field point to the page which is used
>> to communicate with with the hy
Nadav Amit wrote:
> From: Gil Kupfer
>
> The balloon.page field is used for two different purposes if batching is
> on or off. If batching is on, the field point to the page which is used
> to communicate with with the hypervisor. If it is off, balloon.page
> points to the
.org
Reported-by: Oleksandr Natalenko
Signed-off-by: Gil Kupfer
Signed-off-by: Nadav Amit
Reviewed-by: Xavier Deguillard
---
v2: Fixing commit message
drivers/misc/vmw_balloon.c | 23 +++
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/misc/vmw_bal
63be98
[ 42.325735] ---[ end trace 872e008e33f81508 ]---
To solve the bug, we eliminate the dual purpose of balloon.page.
Fixes: 220a80f0c2e7 ("VMware balloon: add batching to the vmw_balloon.")
Cc: sta...@vger.kernel.org
Reported-by: Oleksandr Natalenko
Signed-off-by: Gil Kupfer
Sign
Wanpeng Li wrote:
> 2018-02-27 9:30 GMT+08:00 Nadav Amit :
>> Wanpeng Li wrote:
>>
>>> From: Wanpeng Li
>>>
>>> Linux (among the others) has checks to make sure that certain features
>>> aren't enabled on a certain family/model/ste
Wanpeng Li wrote:
> From: Wanpeng Li
>
> Linux (among the others) has checks to make sure that certain features
> aren't enabled on a certain family/model/stepping if the microcode version
> isn't greater than or equal to a known good version.
>
> By exposing the real microcode version, we'r
Dave Hansen wrote:
>
> From: Dave Hansen
>
> The __PAGE_KERNEL_* page permissions are "raw". They contain bits
> that may or may not be supported on the current processor. They
> need to be filtered by a mask (currently __supported_pte_mask) to
> turn them into a value that we can actually s
Dave Hansen wrote:
>
> From: Dave Hansen
>
>
> +static inline pgprotval_t check_pgprot(pgprot_t pgprot)
> +{
> + pgprotval_t massaged_val = massage_pgprot(pgprot);
> +
> + WARN_ONCE(pgprot_val(pgprot) != massaged_val,
> + "attempted to set unsupported pgprot: %016lx "
>
Dave Hansen wrote:
>
> From: Dave Hansen
>
> In creating its page tables, the espfix code masks its PGTABLE_PROT
> value with the supported mask: __supported_pte_mask. This ensures
> that unsupported bits are not set in the final PTE. But, it also
> sets _PAGE_GLOBAL which we do not want for
Dmitry Safonov <0x7f454...@gmail.com> wrote:
> 2018-02-16 7:11 GMT+00:00 Cyrill Gorcunov :
>> On Thu, Feb 15, 2018 at 11:29:42PM +, Andy Lutomirski wrote:
>> ...
>> +bool pti_handle_segment_not_present(long error_code)
>> +{
>> + if (!static_cpu_has(X86_FEATURE_PTI))
>> +
Dave Hansen wrote:
> On 02/16/2018 10:25 AM, Nadav Amit wrote:
>>> +#ifdef CONFIG_PAGE_TABLE_ISOLATION
>>> +#define __PAGE_KERNEL_GLOBAL 0
>>> +#else
>>> +#define __PAGE_KERNEL_GLOBAL _PAGE_GLOBAL
>>> +#endif
>> .
Dave Hansen wrote:
> On 02/16/2018 09:47 AM, Nadav Amit wrote:
>>> But, this also means that we now get *no* opportunity to use
>>> global pages with PTI, even for data which is shared such as the
>>> cpu_entry_area and entry/exit text.
>>
>> Doesn’t
Dave Hansen wrote:
>
> From: Dave Hansen
>
> Kernel mappings are historically _PAGE_GLOBAL. But, with PTI, we do not
> want them to be _PAGE_GLOBAL. We currently accomplish this by simply
> clearing _PAGE_GLOBAL from the suppotred mask which ensures it is
> cleansed from many of our PTE cons
Andy Lutomirski wrote:
> On Fri, Feb 16, 2018 at 12:42 AM, Linus Torvalds
> wrote:
>> On Thu, Feb 15, 2018 at 4:22 PM, Nadav Amit wrote:
>>> It is not too pretty, I agree, but it should do the work. There is only one
>>> problematic descriptor that can be used to
Andrew Cooper wrote:
> On 16/02/2018 00:25, Nadav Amit wrote:
>> Dave Hansen wrote:
>>
>>> On 02/15/2018 08:35 AM, Nadav Amit wrote:
>>>> I removed the PTI disabling while SMEP is unsupported, although I
>>>> must admit I did not fully understa
Dave Hansen wrote:
> On 02/15/2018 04:25 PM, Nadav Amit wrote:
>> Dave Hansen wrote:
>>
>>> On 02/15/2018 08:35 AM, Nadav Amit wrote:
>>>> I removed the PTI disabling while SMEP is unsupported, although I
>>>> must admit I did not fully underst
Dave Hansen wrote:
> On 02/15/2018 08:35 AM, Nadav Amit wrote:
>> I removed the PTI disabling while SMEP is unsupported, although I
>> must admit I did not fully understand why it is required.
>
> Do you mean you don't fully understand how PTI gives SMEP-like behav
Linus Torvalds wrote:
> On Thu, Feb 15, 2018 at 3:29 PM, Andy Lutomirski wrote:
>> It's possible we could get away with adding the prctl but making the
>> default be that only the bitness that matches the program being run is
>> allowed. After all, it's possible that CRIU is literally the only
Andy Lutomirski wrote:
> On Thu, Feb 15, 2018 at 4:36 PM, Nadav Amit wrote:
>> Based on the understanding that there should be no way for userspace to
>> address the kernel-space from compatibility mode, disable it while
>> running in compatibility mode as long as the 64-bi
Andy Lutomirski wrote:
> On Thu, Feb 15, 2018 at 4:35 PM, Nadav Amit wrote:
>> If PTI is disabled, we do not want to switch page-tables. On entry to
>> the kernel, this is done based on CR3 value. On return, do it according
>> to per core indication.
>>
>&
1001 - 1100 of 1321 matches
Mail list logo