From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755921AbeARPDF (ORCPT ); Thu, 18 Jan 2018 10:03:05 -0500 Received: from merlin.infradead.org ([205.233.59.134]:46772 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755160AbeARO6E (ORCPT ); Thu, 18 Jan 2018 09:58:04 -0500 Message-Id: <20180118134800.711245485@infradead.org> User-Agent: quilt/0.63-1 Date: Thu, 18 Jan 2018 14:48:00 +0100 From: Peter Zijlstra From: Peter Zijlstra To: David Woodhouse , Thomas Gleixner , Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Dave Hansen , Ashok Raj , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick , Jason Baron , Peter Zijlstra Subject: [PATCH 00/35] jump_label, objtool, IBRS and IBPB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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