Messages in this thread |  | | Date | Thu, 18 Jan 2018 14:48:00 +0100 | From | Peter Zijlstra <> | From | Peter Zijlstra <> | Subject | [PATCH 00/35] jump_label, objtool, IBRS and IBPB |
| |
Lots of patches..
They include:
- objtool validation of jump_label/static_cpu_has
Allows asserting that the code block following a jump_label/static_cpu_has is indeed unconditional. Ensures GCC doesn't generate particularly stupid code which would re-insert a dynamic test.
- objtool validation of retpoline
Looks for indirect JMP/CALL sites when build with a retpoline enabled compiler. Has already spotted a bunch of sites that need fixing, see below.
- makes x86 hard rely on asm-goto to ensure we can indeed use static_cpu_has to avoid dynamic branches (and thus speculation).
- The IBRS/IBPB patches from Thomas that use static_cpu_has()
These hard rely on the above; we must not speculate across the IBRS/IBPB MSR writes otherwise that would totally defeat the point. Prior patches had LFENCE crud in the else-clause, which then makes the primitives unconditionally expensive.
- Rebased the IBRS/IBPB-KVM patches from Ashok on top
- Random odd fixes for various things encountered while doing the above.
Please have a look and sorry for this many patches.
---
Output of a x86_64-allmodconfig -KCOV -KASAN build:
arch/x86/entry/.tmp_entry_64.o: warning: objtool: .entry.text+0x1cb2: indirect call found in RETPOLINE build arch/x86/entry/.tmp_entry_64.o: warning: objtool: .entry.text+0x1cc7: indirect call found in RETPOLINE build arch/x86/hyperv/.tmp_mmu.o: warning: objtool: hyperv_flush_tlb_others()+0x30c: indirect call found in RETPOLINE build arch/x86/hyperv/.tmp_mmu.o: warning: objtool: hyperv_flush_tlb_others()+0x3b0: indirect call found in RETPOLINE build arch/x86/hyperv/.tmp_mmu.o: warning: objtool: hyperv_flush_tlb_others_ex()+0x3a1: indirect call found in RETPOLINE build arch/x86/hyperv/.tmp_mmu.o: warning: objtool: hyperv_flush_tlb_others_ex()+0x45c: indirect call found in RETPOLINE build arch/x86/xen/.tmp_multicalls.o: warning: objtool: xen_mc_flush()+0x1da: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_emulate.o: warning: objtool: fastop()+0x54: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_emulate.o: warning: objtool: em_loop()+0xcc: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_emulate.o: warning: objtool: x86_emulate_insn()+0xbd6: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_emulate.o: warning: objtool: x86_emulate_insn()+0xc1a: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_emulate.o: warning: objtool: x86_emulate_insn()+0xc66: indirect call found in RETPOLINE build arch/x86/kvm/.tmp_vmx.o: warning: objtool: vmx_handle_external_intr()+0x50: indirect call found in RETPOLINE build arch/x86/mm/.tmp_mem_encrypt_boot.o: warning: objtool: sme_encrypt_execute()+0x48: indirect call found in RETPOLINE build drivers/hv/.tmp_hv.o: warning: objtool: hv_post_message()+0x72: indirect call found in RETPOLINE build drivers/hv/.tmp_connection.o: warning: objtool: vmbus_set_event()+0x33: indirect call found in RETPOLINE build drivers/pci/host/.tmp_pci-hyperv.o: warning: objtool: hv_irq_unmask()+0x22b: indirect call found in RETPOLINE build drivers/xen/.tmp_privcmd.o: warning: objtool: privcmd_ioctl()+0xcf: indirect call found in RETPOLINE build drivers/watchdog/.tmp_hpwdt.o: warning: objtool: .text+0x24: indirect call found in RETPOLINE build
|  |