From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11554C43381 for ; Thu, 14 Jan 2021 19:43:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE5262343B for ; Thu, 14 Jan 2021 19:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730400AbhANTnT (ORCPT ); Thu, 14 Jan 2021 14:43:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28912 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730028AbhANTnS (ORCPT ); Thu, 14 Jan 2021 14:43:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610653312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XuaSh1jiZTg/VIGM2iLx4bVb5sX8DSpIZVRiX7a3MCE=; b=GMxxUE0NbKs61gWT7oQQTRCh9vsYzE2YrKR10vKceOU8wBYuHYtVYpr7abQh98VH10X3mj O4XMRk1om90JIEUAk7sWHfgdt2PSpBEpBu24Plaf5E/IRXKYS3FtbSRu9MY4OLTdsjkNQ3 KelP8Rhxk8dAZWjlSVAfmuNg1I/PtxI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-9yU8OmYrMLGLW2FQ2KQlBQ-1; Thu, 14 Jan 2021 14:41:48 -0500 X-MC-Unique: 9yU8OmYrMLGLW2FQ2KQlBQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9191D190B2A0; Thu, 14 Jan 2021 19:41:46 +0000 (UTC) Received: from treble.redhat.com (ovpn-120-156.rdu2.redhat.com [10.10.120.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3097010023B4; Thu, 14 Jan 2021 19:41:44 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Sami Tolvanen , Sedat Dilek , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, Miroslav Benes , "Rafael J. Wysocki" , Pavel Machek Subject: [PATCH 19/21] x86/power: Convert indirect jumps to retpolines Date: Thu, 14 Jan 2021 13:40:15 -0600 Message-Id: <354da72ff95aed0cea40b410f6db882bfb0877d5.1610652862.git.jpoimboe@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's kernel policy to not have (unannotated) indirect jumps because of Spectre v2. These are probably harmless, but better safe than sorry. Convert them to retpolines. Cc: "Rafael J. Wysocki" Cc: Pavel Machek Signed-off-by: Josh Poimboeuf --- arch/x86/power/hibernate_asm_64.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S index 7918b8415f13..24d971911c9d 100644 --- a/arch/x86/power/hibernate_asm_64.S +++ b/arch/x86/power/hibernate_asm_64.S @@ -21,6 +21,7 @@ #include #include #include +#include SYM_FUNC_START(swsusp_arch_suspend) movq $saved_context, %rax @@ -66,7 +67,7 @@ SYM_CODE_START(restore_image) /* jump to relocated restore code */ movq relocated_restore_code(%rip), %rcx - jmpq *%rcx + JMP_NOSPEC rcx SYM_CODE_END(restore_image) /* code below has been relocated to a safe page */ @@ -97,7 +98,7 @@ SYM_CODE_START(core_restore_code) .Ldone: /* jump to the restore_registers address from the image header */ - jmpq *%r8 + JMP_NOSPEC r8 SYM_CODE_END(core_restore_code) /* code below belongs to the image kernel */ -- 2.29.2