Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp730691ybz; Sat, 25 Apr 2020 03:05:25 -0700 (PDT) X-Google-Smtp-Source: APiQypLBg/WWom6KXWaSMRYgR2xS0BFt95Dh6vsa4rV7yKJ6EcBgH9+L7Q03KcSDinYfAMwDOZp0 X-Received: by 2002:a17:906:2b96:: with SMTP id m22mr10963921ejg.330.1587809125435; Sat, 25 Apr 2020 03:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587809125; cv=none; d=google.com; s=arc-20160816; b=ieIM+W3GwQWccRCwu5FKIGPxyYVpXmNTxDaie5JnF43x8ekdIkJ3eLb2eohy/UoEvW ztT3pmZEWeNnDjI1iyW4zYj0S1peEz5Dc+V/HmjtSgc7ICnrjY0YOXWpdSsMhREoG4e0 baIxMVUokSFCcOqaWed7kovptsgHe7UJGcrm/J1/R4jSyyBwCP4J9K1W9ALiF32xcy2V OdcpcevuOgwL2TbuCiJRl15yJ9YKX2ic4gsjilYflWIdaHYFM1jIor4ZlOdbS3HTPT5k pWRWrMaU2szt1RuAZh4S+eIZKXF/hcphncOJ8Rvbio6M+nbH2bJH1D69ktBm5QQsJCC0 FJwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S8oICFkq/vVJCy/zBhI+k3DypCtF86mBFwST7Zqu/W4=; b=dN7+KwOn0vB0njyljoa98+CoXVtuwXsPTTZxecKJZIm5yfZCDQ/7W34ohSsQ6LomtX XlZGPR+NYJxlLg+F8fw5ax0B/4bigq91oqPAXo7ARMqbw8UleijNt2/JB90svgYbkWp2 ce73oVeQuPQSH39Zi582mAVSeYipbc04XpoQfsu+XFbWdvTyPKHwYdQplAwXbm6K5ZJ7 vuklhxvwbUi35wsRGf/hZ2lyzw1/2wcRFlM2sw5bLtFbOJh7lKhN9kifsLiezQntb8Au gfEeAj62gtWudK7Zn3Tjvsjly8mOOJXyv2iuXUwO6SARe96Tsyk5smNmKAHQdwQ7bMu5 qXSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwf4vjvC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si4554280edw.356.2020.04.25.03.05.01; Sat, 25 Apr 2020 03:05:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwf4vjvC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbgDYKDg (ORCPT + 99 others); Sat, 25 Apr 2020 06:03:36 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34272 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726110AbgDYKDa (ORCPT ); Sat, 25 Apr 2020 06:03:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587809009; 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=S8oICFkq/vVJCy/zBhI+k3DypCtF86mBFwST7Zqu/W4=; b=fwf4vjvCOxQNwbAXWHrZGQusz0qmq1t3uw/r2Vf13kOOExbS8k8+Fy2M4ptnMo7g2HkR9A ryQlssrkbe7l8jGNwE2q/YXKPKohS0fGYPRk384krnyniGH9J6fXi8s/gSyU4dCUdUSi/8 oEi5djRBCHWJFU66f310g6eN1uBLW70= 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-269-zZCSfQxwNryQKSXju1aHjg-1; Sat, 25 Apr 2020 06:03:27 -0400 X-MC-Unique: zZCSfQxwNryQKSXju1aHjg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FCFE80B709; Sat, 25 Apr 2020 10:03:25 +0000 (UTC) Received: from treble.redhat.com (ovpn-114-29.rdu2.redhat.com [10.10.114.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FCD760623; Sat, 25 Apr 2020 10:03:24 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Vince Weaver , Dave Jones , Jann Horn , Miroslav Benes , Andy Lutomirski , Thomas Gleixner Subject: [PATCH v2 04/11] x86/entry/64: Fix unwind hints in __switch_to_asm() Date: Sat, 25 Apr 2020 05:03:03 -0500 Message-Id: <03d0411920d10f7418f2e909210d8e9a3b2ab081.1587808742.git.jpoimboe@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UNWIND_HINT_FUNC has some limitations: specifically, it doesn't reset all the registers to undefined. This causes objtool to get confused about the RBP push in __switch_to_asm(), resulting in bad ORC data. While __switch_to_asm() does do some stack magic, it's otherwise a normal callable-from-C function, so just annotate it as a function, which makes objtool happy and allows it to produces the correct hints automatically. Fixes: 8c1f75587a18 ("x86/entry/64: Add unwind hint annotations") Signed-off-by: Josh Poimboeuf Reviewed-by: Miroslav Benes --- arch/x86/entry/entry_64.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 6b0d679efd6b..34a588950fe1 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -279,8 +279,7 @@ SYM_CODE_END(entry_SYSCALL_64) * %rdi: prev task * %rsi: next task */ -SYM_CODE_START(__switch_to_asm) - UNWIND_HINT_FUNC +SYM_FUNC_START(__switch_to_asm) /* * Save callee-saved registers * This must match the order in inactive_task_frame @@ -321,7 +320,7 @@ SYM_CODE_START(__switch_to_asm) popq %rbp =20 jmp __switch_to -SYM_CODE_END(__switch_to_asm) +SYM_FUNC_END(__switch_to_asm) =20 /* * A newly forked process directly context switches into this address. --=20 2.21.1