Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbdF3FmI (ORCPT ); Fri, 30 Jun 2017 01:42:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:43064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787AbdF3FmG (ORCPT ); Fri, 30 Jun 2017 01:42:06 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D321422BE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org MIME-Version: 1.0 In-Reply-To: References: <20170629175333.bicpvbwo4d5pdbak@treble> <20170629190559.ttw52ahwtsjynayx@treble> <20170629214134.c36krjhvzegwkfjk@treble> <20170630021249.cqkszxaqtwakmzpg@treble> From: Andy Lutomirski Date: Thu, 29 Jun 2017 22:41:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/8] x86/entry: add unwind hint annotations To: Andy Lutomirski Cc: Josh Poimboeuf , X86 ML , "linux-kernel@vger.kernel.org" , live-patching@vger.kernel.org, Linus Torvalds , Jiri Slaby , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Mike Galbraith Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1167 Lines: 29 On Thu, Jun 29, 2017 at 10:05 PM, Andy Lutomirski wrote: > Hmm. There's another option that might be considerably nicer, though: > put the IRQ stack at a known (at link time) position *in percpu > space*. (Presumably it already is -- I haven't checked.) Then we do: > > .macro ENTER_IRQ_STACK old_rsp > DEBUG_ENTRY_ASSERT_IRQS_OFF > movq %rsp, \old_rsp > incl PER_CPU_VAR(irq_count) > > /* > * Right now, if we just incremented irq_count to zero, we've > * claimed the IRQ stack but we haven't switched to it yet. > * Anything that can interrupt us here without using IST > * must be *extremely* careful to limit its stack usage. > */ > jnz .Lpush_old_rsp_\@ > movq \old_rsp, PER_CPU_VAR(top_word_in_irq_stack) > movq PER_CPU_VAR(irq_stack_ptr), %rsp > .Lpush_old_rsp_\@: > pushq \old_rsp > .endm > How about the two commits here (well, soon to be there once gitweb catches up): https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/entry_irq_stack&id=0f56a55bb133cd53ccb78ca51378086296618322 If you like them, want to add them to your series?