On Mon, Jan 08, 2018 at 09:26:10PM +0100, Yves-Alexis Perez wrote:
> On Mon, 2018-01-08 at 19:26 +0100, Willy Tarreau wrote:
> > You're totally right, I discovered during my later developments that
> > indeed PCID is not exposed there. So we take the hit of a full TLB
> > flush twice per syscall.
>
> So I really think it might make sense to redo the tests with PCID, because the
> assumptions you're basing your patch series on might actually not hold.
I'll have to do it on the bare-metal server soon anyway.
Cheers,
Willy
From: Viktor Slavkovic <viktors(a)google.com>
A lock-unlock is missing in ASHMEM_SET_SIZE ioctl which can result in a
race condition when mmap is called. After the !asma->file check, before
setting asma->size, asma->file can be set in mmap. That would result in
having different asma->size than the mapped memory size. Combined with
ASHMEM_UNPIN ioctl and shrinker invocation, this can result in memory
corruption.
Signed-off-by: Viktor Slavkovic <viktors(a)google.com>
Cc: stable(a)vger.kernel.org
---
drivers/staging/android/ashmem.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 0f695df14c9d..372ce9913e6d 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -765,10 +765,12 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
case ASHMEM_SET_SIZE:
ret = -EINVAL;
+ mutex_lock(&ashmem_mutex);
if (!asma->file) {
ret = 0;
asma->size = (size_t)arg;
}
+ mutex_unlock(&ashmem_mutex);
break;
case ASHMEM_GET_SIZE:
ret = asma->size;
--
2.16.0.rc0.223.g4a4ac83678-goog
Hi Yves-Alexis,
On Mon, Jan 08, 2018 at 06:07:54PM +0100, Yves-Alexis Perez wrote:
> On Sun, 2018-01-07 at 11:18 +0100, Willy Tarreau wrote:
> > - the highest performance impact on VMs comes from having PTI on the
> > guest kernel (-45%). At this point it makes no difference whether
> > the host kernel has it or not.
>
> Hi Willy,
>
> out of curiosity, is the pcid/invpcid flags exposed to and used by your guest
> CPU? It might very well that the PCID optimisations are not used by the guests
> here, and it might be worth either checking on bare metal or with the PCID
> optimisations enabled.
You're totally right, I discovered during my later developments that
indeed PCID is not exposed there. So we take the hit of a full TLB
flush twice per syscall.
Willy
On Mon, Jan 8, 2018 at 3:05 PM, kernelci.org bot <bot(a)kernelci.org> wrote:
>
> stable-rc/linux-4.4.y build: 178 builds: 7 failed, 171 passed, 8 errors (v4.4.110-23-g49278737d445)
> Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.4.y/kernel/v4.4.110-23-…
> Tree: stable-rc
> Branch: linux-4.4.y
> Git Describe: v4.4.110-23-g49278737d445
> Git Commit: 49278737d4458032fb523dfe5451b441c04c5b73
> Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> Built: 4 unique architectures
>
> Build Failures Detected:
>
> x86: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
> allnoconfig FAIL
> i386_defconfig FAIL
> tinyconfig FAIL
I missed these earlier, since the kernelci summary output doesn't
print link errors:
arch/x86/kernel/setup.o: In function `vsyscall_enabled':
setup.c:(.text+0x10): multiple definition of `vsyscall_enabled'
arch/x86/kernel/time.o:time.c:(.text+0x10): first defined here
arch/x86/kernel/rtc.o: In function `vsyscall_enabled':
rtc.c:(.text+0x0): multiple definition of `vsyscall_enabled'
arch/x86/kernel/time.o:time.c:(.text+0x10): first defined here
arch/x86/kernel/cpu/built-in.o: In function `vsyscall_enabled':
(.text+0xbc0): multiple definition of `vsyscall_enabled'
This comes from 0cbf2b590bea ("Map the vsyscall page with _PAGE_USER")
which adds a line 'bool vsyscall_enabled(void) { return false; }' that
presumably
should have been 'static inline'.
Arnd
On 01/08/2018 01:05 AM, Yves-Alexis Perez wrote:
> On Mon, 2018-01-08 at 03:25 +0000, Ben Hutchings wrote:
>> This is with the full patch set applied (and a fix for NMI handling
>> that wasn't in 3.16.53-rc1):
>> https://www.decadent.org.uk/ben/tmp/linux-image-3.16.52_3.16.52-50_amd64.deb
I booted this. It crashes in *secondary* CPU startup when it sets
CR4.PCIDE while still in 32-bit protected mode. That's illegal.
Plain 3.16 doesn't do this:
https://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-kaiser.git/tree/a…
> /* Enable PAE mode and PGE */
> movl $(X86_CR4_PAE | X86_CR4_PGE), %ecx
> movq %rcx, %cr4
So I suspect the "Enable PAE and PGE" area is wrong.
On Mon, Jan 8, 2018 at 12:25 PM, kernelci.org bot <bot(a)kernelci.org> wrote:
>
> stable-rc/linux-4.4.y build: 178 builds: 4 failed, 174 passed, 8 errors (v4.4.110-18-g5da3d9af3a4b)
> Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.4.y/kernel/v4.4.110-18-…
> Tree: stable-rc
> Branch: linux-4.4.y
> Git Describe: v4.4.110-18-g5da3d9af3a4b
> Git Commit: 5da3d9af3a4b90d3c5ab19f9ad1dbb7d237edcf9
> Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> Built: 4 unique architectures
>
> Build Failures Detected:
>
> arm: gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)
> cm_x300_defconfig FAIL
> mvebu_v7_defconfig FAIL
> pxa3xx_defconfig FAIL
> raumfeld_defconfig FAIL
>
> mvebu_v7_defconfig (arm) — FAIL, 2 errors, 0 warnings, 0 section mismatches
>
> Errors:
> drivers/mtd/nand/pxa3xx_nand.c:918:2: error: duplicate case value
> drivers/mtd/nand/pxa3xx_nand.c:915:2: error: previously used here
Hi Greg,
Commit fee4380f368e ("mtd: nand: pxa3xx: Fix READOOB implementation") was
apparently backported in error, it looks like it should just be
dropped here in 4.4.y.
The commit lists 'Fixes: 43bcfd2bb24a ("mtd: nand: pxa3xx: Add driver-specific
ECC BCH support")', that commit was merged into v4.14, so backporting the
fix further is probably not appropriate for 4.9 or earlier kernels either.
The duplicate case statement only happens before linux-4.6, as commit
c2cdace755b5 ("mtd: nand: pxa3xx_nand: add support for partial chunks")'
removed a previous 'case READOOB' statement in this driver, so the build
regression appears only in 4.4 but not 4.9.
Arnd
This is a note to let you know that I've just added the patch titled
mtd: nand: pxa3xx: Fix READOOB implementation
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mtd-nand-pxa3xx-fix-readoob-implementation.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From fee4380f368e84ed216b62ccd2fbc4126f2bf40b Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon(a)free-electrons.com>
Date: Mon, 18 Dec 2017 11:32:45 +0100
Subject: mtd: nand: pxa3xx: Fix READOOB implementation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Boris Brezillon <boris.brezillon(a)free-electrons.com>
commit fee4380f368e84ed216b62ccd2fbc4126f2bf40b upstream.
In the current driver, OOB bytes are accessed in raw mode, and when a
page access is done with NDCR_SPARE_EN set and NDCR_ECC_EN cleared, the
driver must read the whole spare area (64 bytes in case of a 2k page,
16 bytes for a 512 page). The driver was only reading the free OOB
bytes, which was leaving some unread data in the FIFO and was somehow
leading to a timeout.
We could patch the driver to read ->spare_size + ->ecc_size instead of
just ->spare_size when READOOB is requested, but we'd better make
in-band and OOB accesses consistent.
Since the driver is always accessing in-band data in non-raw mode (with
the ECC engine enabled), we should also access OOB data in this mode.
That's particularly useful when using the BCH engine because in this
mode the free OOB bytes are also ECC protected.
Fixes: 43bcfd2bb24a ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
Reported-by: Sean Nyekjær <sean.nyekjaer(a)prevas.dk>
Tested-by: Willy Tarreau <w(a)1wt.eu>
Signed-off-by: Boris Brezillon <boris.brezillon(a)free-electrons.com>
Acked-by: Ezequiel Garcia <ezequiel(a)vanguardiasur.com.ar>
Tested-by: Sean Nyekjaer <sean.nyekjaer(a)prevas.dk>
Acked-by: Robert Jarzmik <robert.jarzmik(a)free.fr>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/mtd/nand/pxa3xx_nand.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -950,6 +950,7 @@ static void prepare_start_command(struct
switch (command) {
case NAND_CMD_READ0:
+ case NAND_CMD_READOOB:
case NAND_CMD_PAGEPROG:
info->use_ecc = 1;
break;
Patches currently in stable-queue which might be from boris.brezillon(a)free-electrons.com are
queue-4.9/mtd-nand-pxa3xx-fix-readoob-implementation.patch
Hi Pavlos!
On Mon, Jan 08, 2018 at 04:19:17PM +0100, Pavlos Parissis wrote:
> Hi,
>
> The 4.14 kernel is listed as a 'Stable' but not as 'Longterm' in the kernel releases feed[1], is
> this expected?
Normally kernels are only listed as LTS once they leave their regular
"stable" status, often after next kernel version is issued. I think this
leaves a last minute chance to Greg to change his mind if the kernel he
elected is too damaged ;-)
Cheers,
Willy