From patchwork Tue May 16 16:06:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94802 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp548627vqo; Tue, 16 May 2023 09:19:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kcbfYtlmhzWwHc1nJ8GqssRMi4WkOu9Uu9ExvhOYr6LRZD5VRVMAsah78zgT+UoYJxK5O X-Received: by 2002:a05:6a21:620d:b0:ff:ddfb:6ed with SMTP id wm13-20020a056a21620d00b000ffddfb06edmr34812414pzb.5.1684253949631; Tue, 16 May 2023 09:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684253949; cv=none; d=google.com; s=arc-20160816; b=0s3VtY+gYPMC8Jd+WnG7BqPeajSx2hFRMnnVAGuQTvquPZScPpDlOFiHHWoX6s/clB CVC4WAHLczVlSwno2VyCP6Qxfxtq1OUPAIcZnaGhJMbJm7COYiLeVWzgvjYrS9FYvGdi W2bq3CWKBrw3kZ17mOzYRJFAGydkn09AQlguMNCtUSJ9wn8g0alk7Bu2Cocgt2KMwDfV CVlS9nSpupeW1mei9EXyO2DxSdtG3nqKx9+KkTo5gWgeXNMJzkSnAt2Ht9PCk3RdnA0I dB0z0YGFrDQFD1/dxb+o9kVXHLxa/xDmRlXq7FkO+UfRkpWfeQItVHN/hVrubNrnwXPo R3aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ErvjZpuGvo1f5aiZTpQplsLfrmpxY8Hb1jPmBfi0W4=; b=LMoX6DgWcK7FVFOsEHjKqnt4RfchjjUWAmuR9GocMlcXZUc76/eAjh5imluaWQoTOZ Y7Z0NGzUOnoesDMKdFmd364V6kHX0hIUjrGSHB7ZorSM3guzctEJIO32xNczBjQRTouv bCGnMmfxxASWvraixRgfcbheUwXGzXOC9/YXQ3r/7qhzBAFfN1PLJQXGmKtzRau8QFZa FUItR45f+MjMjAN6eVGB8V4J+l/2Wop/XI7fZWv8iyH2yxif8jzPCKGIEWsCi73Ot08J zoFHmujigrxpeYo8fjjukY8PhzSb2QtIDRh3xjsYSJ+YAIMDzJJmnukIjFJlXsAPBfRA 1Ewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L7odbrek; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a637a45000000b00519ffeb6d43si19039036pgn.188.2023.05.16.09.18.52; Tue, 16 May 2023 09:19:09 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L7odbrek; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234417AbjEPQHh (ORCPT + 99 others); Tue, 16 May 2023 12:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234437AbjEPQHd (ORCPT ); Tue, 16 May 2023 12:07:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A508B9012; Tue, 16 May 2023 09:07:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E67B63BED; Tue, 16 May 2023 16:07:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14EA4C433A8; Tue, 16 May 2023 16:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684253240; bh=cYFmzH9FV4Ur5p0DAU7gs+tfA3BDiik1KhVfqrr2Y+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L7odbrekxCr+WdXsacMNFYgcL87tFzIydgjXfJfghOud/Or+/fLTisR5cCFmhD4xm zGMGpWatlFXDTYKOeijO/Qq3Og5f0gly2trNoQieyPhOrXBT+q7D/5F46pY5IAyWZY UZFQnBj8hdkFvucYcygeZACvWbHh3ERgVfbboPit0TDD1UibUqUAqTVpU3Fr5kQyII SxArngncxrbh+ozlZ0Wm1N5guqOfnsByoybPZIgrX073iMWCgeYUApZ37KYPqP0aRb dcunCI2jajzK1QiBDtG8X3o6iB+wh8BsMRzn3y41hRnEje2Y1YiGmjXeGBvf9jAlly FnoWszL29Od0A== From: Arnd Bergmann To: Catalin Marinas , Will Deacon Cc: Arnd Bergmann , Ard Biesheuvel , Mark Rutland , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Anshuman Khandual , Kees Cook , Suren Baghdasaryan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, kvmarm@lists.linux.dev Subject: [PATCH 06/15] arm64: kvm: add prototypes for functions called in asm Date: Tue, 16 May 2023 18:06:33 +0200 Message-Id: <20230516160642.523862-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516160642.523862-1-arnd@kernel.org> References: <20230516160642.523862-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766068269451796194?= X-GMAIL-MSGID: =?utf-8?q?1766068269451796194?= From: Arnd Bergmann A lot of kvm specific functions are called only from assembler and have no extern prototype, but that causes a W=1 warnings: arch/arm64/kvm/handle_exit.c:365:24: error: no previous prototype for 'nvhe_hyp_panic_handler' [-Werror=missing-prototypes] arch/arm64/kvm/va_layout.c:188:6: error: no previous prototype for 'kvm_patch_vector_branch' [-Werror=mi ssing-prototypes] arch/arm64/kvm/va_layout.c:287:6: error: no previous prototype for 'kvm_get_kimage_voffset' [-Werror=mis sing-prototypes] arch/arm64/kvm/va_layout.c:293:6: error: no previous prototype for 'kvm_compute_final_ctr_el0' [-Werror= missing-prototypes] arch/arm64/kvm/hyp/vhe/switch.c:259:17: error: no previous prototype for 'hyp_panic' [-Werror=missing-pr arch/arm64/kvm/hyp/nvhe/switch.c:389:17: error: no previous prototype for 'kvm_unexpected_el2_exception' arch/arm64/kvm/hyp/nvhe/switch.c:384:28: error: no previous prototype for 'hyp_panic_bad_stack' [-Werror arch/arm64/kvm/hyp/nvhe/hyp-main.c:383:6: error: no previous prototype for 'handle_trap' [-Werror=missin arch/arm64/kvm/hyp/nvhe/psci-relay.c:203:28: error: no previous prototype for 'kvm_host_psci_cpu_entry' [-Werror=missing-prototypes] Declare those in asm/kvm_asm.h, which already has related declarations. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/kvm_asm.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 43c3bc0f9544..86042afa86c3 100644 --- a/arch/arm64/include/asm/kvm_asm.h +++ b/arch/arm64/include/asm/kvm_asm.h @@ -267,6 +267,24 @@ extern u64 __kvm_get_mdcr_el2(void); __kvm_at_err; \ } ) +void __noreturn hyp_panic(void); +asmlinkage void kvm_unexpected_el2_exception(void); +asmlinkage void __noreturn hyp_panic(void); +asmlinkage void __noreturn hyp_panic_bad_stack(void); +asmlinkage void kvm_unexpected_el2_exception(void); +struct kvm_cpu_context; +void handle_trap(struct kvm_cpu_context *host_ctxt); +asmlinkage void __noreturn kvm_host_psci_cpu_entry(bool is_cpu_on); +void __noreturn __pkvm_init_finalise(void); +void kvm_nvhe_prepare_backtrace(unsigned long fp, unsigned long pc); +void kvm_patch_vector_branch(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); +void kvm_get_kimage_voffset(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); +void kvm_compute_final_ctr_el0(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); +void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr_virt, + u64 elr_phys, u64 par, uintptr_t vcpu, u64 far, u64 hpfar); #else /* __ASSEMBLY__ */