All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: X86 ML <x86@kernel.org>, Borislav Petkov <bpetkov@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Brian Gerst <brgerst@gmail.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH 00/16] Entry stuff, in decent shape now
Date: Tue, 21 Nov 2017 08:33:01 +0100	[thread overview]
Message-ID: <20171121073301.d3dwwewkmw4ev5sc@gmail.com> (raw)
In-Reply-To: <cover.1511195781.git.luto@kernel.org>


* Andy Lutomirski <luto@kernel.org> wrote:

> This sets up stack switching, including for SYSCALL.  I think it's
> in decent shape.
> 
> Known issues:
>  - KASAN is likely to be busted.  This could be fixed either by teaching
>    KASAN that cpu_entry_area contains valid stacks (I have no clue how
>    to go about doing this) or by rigging up the IST entry code to switch
>    RSP to point to the direct-mapped copy of the stacks before calling
>    into non-KASAN-excluded C code.
> 
>  - 32-bit kernels are failing the sigreturn_32 test.  But they're also
>    failing without the patches, so I'm not sure this is a bug in the
>    series per se.  Needs further investigation.  (Off the top of my head,
>    this could be further fallout from Thomas's IDT rework.)
> 
>  - I think we're going to want a way to turn the stack switching on and
>    off either at boot time or at runtime.  It should be fairly straightforward
>    to make it work.
> 
>  - I think the ORC unwinder isn't so good at dealing with stack overflows.
>    It bails too early (I think), resulting in lots of ? entries.  This
>    isn't a regression with this series -- it's just something that could
>    be improved.

Another problem I just found: IRQ tracing appears busted on 64-bit kernels - with 
lockdep enabled I get this boot warning:

 [    4.309026] WARNING: CPU: 10 PID: 222 at kernel/locking/lockdep.c:3924 check_flags.part.45+0x1a5/0x1b0
 ...
 [    4.309026] possible reason: unannotated irqs-off.

That's on a x86-64 defconfig-ish kernel with CONFIG_PROVE_LOCKING=y, running on an 
AMD system. Full splat below.

Thanks,

	Ingo

[    4.272197] LVT offset 0 assigned for vector 0x400
[    4.278486] perf: AMD IBS detected (0x000000ff)
[    4.284786] kvm: Nested Virtualization enabled
[    4.289447] kvm: Nested Paging enabled
[    4.308496] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)
[    4.308512] ------------[ cut here ]------------
[    4.309026] WARNING: CPU: 10 PID: 222 at kernel/locking/lockdep.c:3924 check_flags.part.45+0x1a5/0x1b0
[    4.309026] Modules linked in:
[    4.309026] CPU: 10 PID: 222 Comm: modprobe Not tainted 4.14.0-01345-g9490674-dirty #1
[    4.309026] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 2.0b       03/01/2012
[    4.309026] task: ffff880814b08000 task.stack: ffffc90007dcc000
[    4.309026] RIP: 0010:check_flags.part.45+0x1a5/0x1b0
[    4.309026] RSP: 0018:ffffc90007dcfeb0 EFLAGS: 00010082
[    4.309026] RAX: 000000000000002e RBX: ffff880814b08000 RCX: 0000000000000000
[    4.309026] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff81152e76
[    4.309026] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
[    4.309026] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[    4.309026] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
[    4.309026] FS:  0000000000000000(0000) GS:ffff880817c80000(0000) knlGS:0000000000000000
[    4.309026] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.309026] CR2: 00007f8badc39218 CR3: 000000081584b000 CR4: 00000000000406e0
[    4.309026] Call Trace:
[    4.309026]  lock_acquire+0x11a/0x1d0
[    4.309026]  vtime_user_exit+0x3c/0xa0
[    4.309026]  ? __context_tracking_exit.part.4+0x45/0x130
[    4.309026]  __context_tracking_exit.part.4+0x45/0x130
[    4.309026]  do_syscall_64+0x13f/0x220
[    4.309026]  entry_SYSCALL64_slow_path+0x25/0x25
[    4.309026] RIP: 0033:0x7f8bada2e42a
[    4.309026] RSP: 002b:00007fffba194e38 EFLAGS: 00000246 ORIG_RAX: 000000000000000c
[    4.309026] RAX: ffffffffffffffda RBX: 0000000000400040 RCX: 00007f8bada2e42a
[    4.309026] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[    4.309026] RBP: 0000000000000009 R08: 000000000000037f R09: 0000000000000064
[    4.309026] R10: 00000000178bfbff R11: 0000000000000246 R12: 00007f8bada19ce0
[    4.309026] R13: 0000000000000000 R14: 0000000000403308 R15: 0000000000001000
[    4.309026] Code: c6 9c f6 ed 81 48 c7 c7 e2 88 ed 81 e8 a0 32 01 00 0f ff e9 ef fe ff ff 48 c7 c6 9d f6 ed 81 48 c7 c7 e2 88 ed 81 e8 86 32 01 00 <0f> ff e9 5f ff ff ff 0f 1f 40 00 41 57 41 56 41 55 41 54 55 53 
[    4.309026] ---[ end trace bdfbcef9b01b1cbb ]---
[    4.309026] possible reason: unannotated irqs-off.
[    4.309026] irq event stamp: 445
[    4.309026] hardirqs last  enabled at (445): [<ffffffff81a4ae23>] swapgs_restore_regs_and_return_to_usermode+0x0/0x3c
[    4.309026] hardirqs last disabled at (444): [<ffffffff81a4bac6>] error_exit+0x6/0x20
[    4.309026] softirqs last  enabled at (24): [<ffffffff81a4e6f7>] __do_softirq+0x3b7/0x468
[    4.309026] softirqs last disabled at (7): [<ffffffff810ebec4>] irq_exit+0xc4/0xd0
[    4.572172] audit: initializing netlink subsys (disabled)
[    4.577846] audit: type=2000 audit(1511245386.576:1): state=initialized audit_enabled=0 res=1
[    4.578742] workingset: timestamp_bits=53 max_order=24 bucket_order=0
[    4.582656] SELinux:  Registering netfilter hooks
[    4.606349] NET: Registered protocol family 38

  parent reply	other threads:[~2017-11-21  7:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 17:07 [PATCH 00/16] Entry stuff, in decent shape now Andy Lutomirski
2017-11-20 17:07 ` [PATCH 01/16] x86/asm/64: Allocate and enable the SYSENTER stack Andy Lutomirski
2017-11-20 21:55   ` Thomas Gleixner
2017-11-21 10:47   ` Borislav Petkov
2017-11-20 17:07 ` [PATCH 02/16] x86/dumpstack: Add get_stack_info() support for " Andy Lutomirski
2017-11-20 20:42   ` Josh Poimboeuf
2017-11-20 20:46     ` Andy Lutomirski
2017-11-20 21:00       ` Josh Poimboeuf
2017-11-20 21:07         ` Andy Lutomirski
2017-11-20 21:27           ` Josh Poimboeuf
2017-11-20 21:30             ` Andy Lutomirski
2017-11-20 21:55               ` Josh Poimboeuf
2017-11-21  1:39                 ` Andy Lutomirski
2017-11-21  2:29                   ` Josh Poimboeuf
2017-11-20 17:07 ` [PATCH 03/16] x86/gdt: Put per-cpu GDT remaps in ascending order Andy Lutomirski
2017-11-20 21:56   ` Thomas Gleixner
2017-11-21 17:16   ` Borislav Petkov
2017-11-20 17:07 ` [PATCH 04/16] x86/fixmap: Generalize the GDT fixmap mechanism Andy Lutomirski
2017-11-20 22:01   ` Thomas Gleixner
2017-11-21  1:21     ` Andy Lutomirski
2017-11-21  8:29       ` Thomas Gleixner
2017-11-20 17:07 ` [PATCH 05/16] x86/asm: Fix assumptions that the HW TSS is at the beginning of cpu_tss Andy Lutomirski
2017-11-20 22:22   ` Thomas Gleixner
2017-11-20 17:07 ` [PATCH 06/16] x86/dumpstack: Handle stack overflow on all stacks Andy Lutomirski
2017-11-20 17:07 ` [PATCH 07/16] x86/asm: Move SYSENTER_stack to the beginning of struct tss_struct Andy Lutomirski
2017-11-20 23:37   ` Thomas Gleixner
2017-11-21  1:25     ` Andy Lutomirski
2017-11-20 17:07 ` [PATCH 08/16] x86/asm: Remap the TSS into the cpu entry area Andy Lutomirski
2017-11-20 17:07 ` [PATCH 09/16] x86/asm/64: Separate cpu_current_top_of_stack from TSS.sp0 Andy Lutomirski
2017-11-20 17:07 ` [PATCH 10/16] x86/espfix/64: Stop assuming that pt_regs is on the entry stack Andy Lutomirski
2017-11-20 17:07 ` [PATCH 11/16] x86/asm/64: Use a percpu trampoline stack for IDT entries Andy Lutomirski
2017-11-21  7:20   ` Ingo Molnar
2017-11-21 15:36     ` Andy Lutomirski
2017-11-21 18:57   ` Dave Hansen
2017-11-22  3:45     ` Andy Lutomirski
2017-11-20 17:07 ` [PATCH 12/16] x86/asm/64: Return to userspace from the trampoline stack Andy Lutomirski
2017-11-20 17:07 ` [PATCH 13/16] x86/entry/64: Create a percpu SYSCALL entry trampoline Andy Lutomirski
2017-11-21  2:34   ` Josh Poimboeuf
2017-11-21  3:20     ` Andy Lutomirski
2017-11-20 17:07 ` [PATCH 14/16] x86/irq: Remove an old outdated comment about context tracking races Andy Lutomirski
2017-11-21  6:25   ` Ingo Molnar
2017-11-20 17:07 ` [PATCH 15/16] x86/irq/64: In the stack overflow warning, print the offending IP Andy Lutomirski
2017-11-21  6:26   ` Ingo Molnar
2017-11-20 17:07 ` [PATCH 16/16] x86/entry/64: Move the IST stacks into cpu_entry_area Andy Lutomirski
2017-11-21  7:38   ` Ingo Molnar
2017-11-21 14:45     ` Andrey Ryabinin
2017-11-23 15:25       ` Andy Lutomirski
2017-11-21 15:33     ` Andy Lutomirski
2017-11-20 18:48 ` [PATCH 00/16] Entry stuff, in decent shape now Andy Lutomirski
2017-11-21  7:33 ` Ingo Molnar [this message]
2017-11-21 15:59   ` Andy Lutomirski
2017-11-21 16:12     ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171121073301.d3dwwewkmw4ev5sc@gmail.com \
    --to=mingo@kernel.org \
    --cc=bpetkov@suse.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.