linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: linux-kernel@vger.kernel.org, mingo@kernel.org, x86@kernel.org,
	brgerst@gmail.com, luto@kernel.org, jpoimboe@redhat.com
Cc: torvalds@linux-foundation.org, ak@linux.intel.com,
	tglx@linutronix.de, dan.j.williams@intel.com
Subject: [RFC PATCH v3 0/6] x86/entry/64: interrupt entry size reduction
Date: Tue, 20 Feb 2018 22:01:07 +0100	[thread overview]
Message-ID: <20180220210113.6725-1-linux@dominikbrodowski.net> (raw)

Here is another re-spin of the interrupt entry size reduction patchset,
which applies on top of tip/pti and tries to implement what Linus
suggested a few days ago.[*]

Patch 1/5 provides the most significant cuttings (-3k) and gets us below
the text size of entry_64.o (by about 2k) compared to before I started
meddling with it. This patch is the most evolved of the set, yet saw the
helper function being renamed since v2.

The other five patches still need more discussion on whether each
additional step and the code complexity it adds is really worth it. And
stringent review, of course.

Overall, these patches provide for a sizeable cutting of up to 4.5k compared
to tip/pti:

   text	   data	    bss	    dec	    hex	filename
  19500	      0	      0	  19500	   4c2c	entry_64.o-orig (before 2e3f0098bc45)
  21088	      0	      0	  21088	   5260	entry_64.o-pti (as of ced5d0bf603f)
  18006	      0	      0	  18006	   4656	entry_64.o (patch 1/6)
  16623	      0	      0	  16623	   40ef	entry_64.o (patch 6/6)

Changes for v3:
- patch 1:
	- rename interrupt_helper to interrupt_entry (suggested by Josh
	  Poimboeuf)
	- do not add cld to interrupt_entry yet
- patch 2 (follow-up changes only)
- patch 3:
	- move cld from interrupt macro to interrupt_entry (suggestion
	  by Linus Torvalds to make this more explicit)
	- do not add cld to switch_to_thread_stack wrapper function, but
	  keep cld where it is entry_INT80_compat.
- patch 4: (follow-up changes only)
- patch 5 (NEW):
	- move ASM_CLAC to interrupt helper (suggested by Brian Gerst)
- patch 6 (was patch 5/5 in v2):
	- update commentary (suggested by Josh Poimboeuf)
	- remove unused UNWIND hint from entry_64_compat.S (suggested by
	  Josh Poimboeuf)

Changes for v2:
- patch 1 (unchanged)
- patch 2:
	- use leaq 8() instead of mov+addq in ENTER_IRQ_STACK (suggested
	  by Brian Gerst)
	- add UNWIND_HINT_REGS indirect=1 after call to interrupt_helper;
	  update size information accordingly
- patch 3:
	- add cld to switch_to_thread_stack wrapper function
	- improve commit message
	- update size information
- patch 4:
	- add UNWIND_HINT_REGS indirect=1 to the now-removed interrupt
	  macro
- patch 5 (NEW):
	- open-code the DO_SWITCH_TO_THREAD_STACK macro (suggested by
	  Brian Gerst)
	- improve (?) UNWIND hints

[*] http://lkml.kernel.org/r/CA+55aFwLTF3EtaQ4OpDv2UM41J=EU7gfemv=eVq+uQi31-usSg@mail.gmail.com

Dominik Brodowski (6):
  x86/entry/64: move PUSH_AND_CLEAR_REGS from interrupt macro to helper
    function
  x86/entry/64: move ENTER_IRQ_STACK from interrupt macro to
    interrupt_entry
  x86/entry/64: move switch_to_thread_stack to interrupt_entry
  x86/entry/64: remove interrupt macro
  x86/entry/64: move ASM_CLAC to interrupt_entry
  x86/entry/64: open-code switch_to_thread_stack

 arch/x86/entry/entry_64.S        | 132 ++++++++++++++++++++++++---------------
 arch/x86/entry/entry_64_compat.S |  17 ++++-
 2 files changed, 98 insertions(+), 51 deletions(-)

-- 
2.16.2

             reply	other threads:[~2018-02-20 21:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 21:01 Dominik Brodowski [this message]
2018-02-20 21:01 ` [RFC PATCH v3 1/6] x86/entry/64: move PUSH_AND_CLEAR_REGS from interrupt macro to helper function Dominik Brodowski
2018-02-20 22:25   ` Linus Torvalds
2018-02-21  2:42     ` [PATCH] x86/entry/64: Simplify ENCODE_FRAME_POINTER Josh Poimboeuf
2018-02-21 10:50       ` [tip:x86/pti] " tip-bot for Josh Poimboeuf
2018-02-21 17:03       ` tip-bot for Josh Poimboeuf
2018-02-21 10:45   ` [tip:x86/pti] x86/entry/64: Move PUSH_AND_CLEAR_REGS from interrupt macro to helper function tip-bot for Dominik Brodowski
2018-02-21 16:58   ` tip-bot for Dominik Brodowski
2018-02-20 21:01 ` [RFC PATCH v3 2/6] x86/entry/64: move ENTER_IRQ_STACK from interrupt macro to interrupt_entry Dominik Brodowski
2018-02-21 10:46   ` [tip:x86/pti] x86/entry/64: Move " tip-bot for Dominik Brodowski
2018-02-21 16:59   ` tip-bot for Dominik Brodowski
2018-02-20 21:01 ` [RFC PATCH v3 3/6] x86/entry/64: move switch_to_thread_stack " Dominik Brodowski
2018-02-21 10:46   ` [tip:x86/pti] x86/entry/64: Move the switch_to_thread_stack() call to interrupt_entry() tip-bot for Dominik Brodowski
2018-02-21 16:59   ` tip-bot for Dominik Brodowski
2018-02-20 21:01 ` [RFC PATCH v3 4/6] x86/entry/64: remove interrupt macro Dominik Brodowski
2018-02-21 10:47   ` [tip:x86/pti] x86/entry/64: Remove 'interrupt' macro tip-bot for Dominik Brodowski
2018-02-21 17:00   ` tip-bot for Dominik Brodowski
2018-02-20 21:01 ` [RFC PATCH v3 5/6] x86/entry/64: move ASM_CLAC to interrupt_entry Dominik Brodowski
2018-02-21 10:47   ` [tip:x86/pti] x86/entry/64: Move ASM_CLAC to interrupt_entry() tip-bot for Dominik Brodowski
2018-02-21 17:00   ` tip-bot for Dominik Brodowski
2018-02-20 21:01 ` [RFC PATCH v3 6/6] x86/entry/64: open-code switch_to_thread_stack Dominik Brodowski
2018-02-21 10:48   ` [tip:x86/pti] x86/entry/64: Open-code switch_to_thread_stack() tip-bot for Dominik Brodowski
2018-02-21 17:01   ` tip-bot for Dominik Brodowski

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=20180220210113.6725-1-linux@dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=ak@linux.intel.com \
    --cc=brgerst@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).