Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5378659iog; Wed, 22 Jun 2022 18:54:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ssVZ9SpgmsjmCy67XFQA+f1wHUMqr/rQjIzcUk/Y7r3OGcEFqYoZnNx6KIAq7jJLvKixAS X-Received: by 2002:a17:90a:8413:b0:1ea:ebf4:7079 with SMTP id j19-20020a17090a841300b001eaebf47079mr1441997pjn.48.1655949287898; Wed, 22 Jun 2022 18:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655949287; cv=none; d=google.com; s=arc-20160816; b=wlo0VrgfW4MUDZXkYAK2o3/5F7WQQYiFt6rqCfLPTN6g405q48v+e7D+YHAS7sZJ7o yVmLk0w4yOffC1tzEqeCbZ3Y6PhMuG1QIpeM3KtqCAozRB4utW/Yrx05mBSpDqdcLcxN 4lzyIVrQ26UOaxVjiqA44yW+KH+Ee9HHfwGeosRLWh+YANctRqcClHsoW5ZfB1f6poqK 6pP5v/5o/TDpk6wPfy74UYbQDXVRGVE+c27zV1MYYxHpqgBv51y1EbDTnGLVmhl67YST EoqvYikfELIBmbUMzj1Uhu/zmAPMjvN5e7c+0JNqld1BT0mpoNF4YCaRvYTFuRojL8fU 2JJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=f+tU1IgCCfJtuhBYom4cF+3TtqAlAUXDsw8ObtgkoZ0=; b=Nu866xXDR4osEbQCBwbZIheaD3xVloBk2BoeRQPtwfzDPI1zquS2jldNCWiznisaw9 j2xl/POx7qN3K/VUChDMn80EKe9Qz3Ae9hz7wuu3Z2oV0EZFK4KSs+6Qoeb9iOrKAY/e l9FEPxipwNKEN+9V+dsGhIIkBlvC2n61sROk5p0RQhLxJpv3gVbjFhPfW86bTePvl1vx MALeKZKv299MRiGMO+2b526mj7HEdeXkGRuNt1GR5YKAT6ucU4vz6wtwk4aSkVbZfANT hdEwMebUVrqgh1eCjzmHbEy+klasPRe2RnW6weQy6z3dp3CWeZ5WcT1xD929TquaGvs5 kzGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a63f804000000b003fdb58f085dsi26613231pgh.374.2022.06.22.18.54.36; Wed, 22 Jun 2022 18:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378206AbiFWBxp (ORCPT + 99 others); Wed, 22 Jun 2022 21:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377467AbiFWBwI (ORCPT ); Wed, 22 Jun 2022 21:52:08 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2299C43AED; Wed, 22 Jun 2022 18:51:52 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LT38k20bzz1KC8s; Thu, 23 Jun 2022 09:49:42 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 09:51:50 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 09:51:49 +0800 From: Chen Zhongjin To: , , , , , CC: , , , , , , , , , , , , , , Subject: [PATCH v6 21/33] arm64: kvm: Annotate unwind_hint for hyp entry Date: Thu, 23 Jun 2022 09:49:05 +0800 Message-ID: <20220623014917.199563-22-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220623014917.199563-1-chenzhongjin@huawei.com> References: <20220623014917.199563-1-chenzhongjin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Symbol __guest_enter and kvm_hyp_vector saved x0, x1 on stack. Symbol __guest_exit and __guest_exit_panic is reached when resuming EL2 execution, and the previous stack pointer gets restored. Add adequate unwind hints. Signed-off-by: Julien Thierry Signed-off-by: Chen Zhongjin --- arch/arm64/kvm/hyp/entry.S | 5 +++++ arch/arm64/kvm/hyp/hyp-entry.S | 3 +++ 2 files changed, 8 insertions(+) diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S index 045d4481c820..81e30d56bf28 100644 --- a/arch/arm64/kvm/hyp/entry.S +++ b/arch/arm64/kvm/hyp/entry.S @@ -15,6 +15,7 @@ #include #include #include +#include .text @@ -22,6 +23,7 @@ * u64 __guest_enter(struct kvm_vcpu *vcpu); */ SYM_CODE_START(__guest_enter) + UNWIND_HINT_FUNC // x0: vcpu // x1-x17: clobbered by macros // x29: guest context @@ -88,6 +90,7 @@ SYM_INNER_LABEL(__guest_exit_panic, SYM_L_GLOBAL) // vcpu x0-x1 on the stack // If the hyp context is loaded, go straight to hyp_panic + UNWIND_HINT_FUNC get_loaded_vcpu x0, x1 cbnz x0, 1f b hyp_panic @@ -110,6 +113,7 @@ SYM_INNER_LABEL(__guest_exit, SYM_L_GLOBAL) // x1: vcpu // x2-x29,lr: vcpu regs // vcpu x0-x1 on the stack + UNWIND_HINT_FUNC sp_offset=16 add x1, x1, #VCPU_CONTEXT @@ -199,6 +203,7 @@ abort_guest_exit_end: msr daifset, #4 // Mask aborts ret + UNWIND_HINT_FUNC _kvm_extable abort_guest_exit_start, 9997f _kvm_extable abort_guest_exit_end, 9997f 9997: diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S index 4a65262a4f3a..d72143c59707 100644 --- a/arch/arm64/kvm/hyp/hyp-entry.S +++ b/arch/arm64/kvm/hyp/hyp-entry.S @@ -151,6 +151,7 @@ SYM_CODE_END(\label) .macro valid_vect target .align 7 + UNWIND_HINT_FUNC 661: esb stp x0, x1, [sp, #-16]! @@ -162,6 +163,7 @@ check_preamble_length 661b, 662b .macro invalid_vect target .align 7 + UNWIND_HINT_FUNC 661: nop stp x0, x1, [sp, #-16]! @@ -209,6 +211,7 @@ SYM_CODE_END(__kvm_hyp_vector) .macro hyp_ventry indirect, spectrev2 .align 7 1: esb + UNWIND_HINT_FUNC .if \spectrev2 != 0 spectrev2_smccc_wa1_smc .else -- 2.17.1