linux/arch/x86
Borislav Petkov 6248f45674 x86/boot/64: Optimize fixmap page fixup
Single-stepping through head_64.S made me look at the fixmap page PTEs
fixup loop:

So we're going through the whole level2_fixmap_pgt 4K page, looking at
whether PAGE_PRESENT is set in those PTEs and add the delta between
where we're compiled to run and where we actually end up running.

However, if that delta is 0 (most cases) we go through all those 512
PTEs for no reason at all. Oh well, we add 0 but that's no reason to me.

Skipping that useless fixup gives us a boot speedup of 0.004 seconds in
my guest. Not a lot but considering how cheap it is, I'll take it. Here
is the printk time difference:

before:
  ...
  [    0.000000] tsc: Marking TSC unstable due to TSCs unsynchronized
  [    0.013590] Calibrating delay loop (skipped), value calculated using timer frequency..
		8027.17 BogoMIPS (lpj=16054348)
  [    0.017094] pid_max: default: 32768 minimum: 301
  ...

after:
  ...
  [    0.000000] tsc: Marking TSC unstable due to TSCs unsynchronized
  [    0.009587] Calibrating delay loop (skipped), value calculated using timer frequency..
		8026.86 BogoMIPS (lpj=16053724)
  [    0.013090] pid_max: default: 32768 minimum: 301
  ...

For the other two changes converting naked numbers to defines:

  # arch/x86/kernel/head_64.o:

   text    data     bss     dec     hex filename
   1124  290864    4096  296084   48494 head_64.o.before
   1124  290864    4096  296084   48494 head_64.o.after

md5:
   87086e202588939296f66e892414ffe2  head_64.o.before.asm
   87086e202588939296f66e892414ffe2  head_64.o.after.asm

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161125111448.23623-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-11-28 07:45:17 +01:00
..
boot x86/boot: Simplify the GDTR calculation assembly code a bit 2016-11-07 08:33:59 +01:00
configs IOMMU Updates for Linux v4.9 2016-10-11 12:52:41 -07:00
crypto crypto: sha512-mb - fix ctx pointer 2016-08-16 17:09:43 +08:00
entry x86/build: Fix build with older GCC versions 2016-10-25 11:44:25 +02:00
events perf/x86/intel: Honour the CPUID for number of fixed counters in hypervisors 2016-10-28 11:06:25 +02:00
ia32 x86/signal: Add SA_{X32,IA32}_ABI sa_flags 2016-09-14 21:28:11 +02:00
include One NULL pointer dereference, and two fixes for regressions introduced 2016-11-04 13:08:05 -07:00
kernel x86/boot/64: Optimize fixmap page fixup 2016-11-28 07:45:17 +01:00
kvm kvm: x86: Check memopp before dereference (CVE-2016-8630) 2016-11-02 21:31:53 +01:00
lguest lguest: Read offset of device_cap later 2016-06-10 11:39:09 +02:00
lib Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
math-emu
mm patches to fix a regression in 4.9-rc1 on x86 PAT 2016-10-28 09:36:07 -07:00
net bpf, x86: add support for constant blinding 2016-05-16 13:49:32 -04:00
oprofile oprofile/x86: Convert x86_backtrace() to use the new unwinder 2016-09-20 08:29:34 +02:00
pci PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
platform x86/platform/UV: Fix support for EFI_OLD_MEMMAP after BIOS callback updates 2016-10-20 08:47:58 +02:00
power x86/asm: Get rid of __read_cr4_safe() 2016-09-30 12:40:12 +02:00
purgatory Add sancov plugin 2016-06-07 22:57:10 +02:00
ras x86/RAS/mce_amd_inj: Remove debugfs dir recursively on exit 2016-09-26 11:13:17 +02:00
realmode x86/boot: Rework reserve_real_mode() to allow multiple tries 2016-08-11 11:15:01 +02:00
tools x86/insn: Add AVX-512 support to the instruction decoder 2016-07-21 09:37:11 -03:00
um Merge branch 'gup_flag-cleanups' 2016-10-19 08:39:47 -07:00
video
xen xen: fixes for 4.9-rc2 2016-10-24 19:52:24 -07:00
.gitignore
Kbuild
Kconfig atomic64: no need for CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 2016-10-07 18:46:30 -07:00
Kconfig.cpu
Kconfig.debug
Makefile lib/raid6: Add AVX512 optimized gen_syndrome functions 2016-09-21 09:09:44 -07:00
Makefile.um
Makefile_32.cpu