From patchwork Fri May 19 09:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 96301 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1103280vqo; Fri, 19 May 2023 02:37:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UUC415CLdLRqQ31fLyw0jdg8u0NfQ59+BW1XkA4HoJcwJIwb0DP3KKqKLPVhhj4nvE7PK X-Received: by 2002:a05:6a20:440d:b0:ec:8f81:e9f7 with SMTP id ce13-20020a056a20440d00b000ec8f81e9f7mr1844261pzb.16.1684489048079; Fri, 19 May 2023 02:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489048; cv=none; d=google.com; s=arc-20160816; b=w383kBV+dlTQd5xijtAFKnlZDj3QB3zB1mDkw0YM7LxN7E0LWqFpZY8nd8JYrlp8md +Hw368m8kC65JsIjWXXmkFtBBSsKg8pq1jpp1+ZATa8dMgB+JwisNe1c1wWojAPhIg0D Z6kW4n7/ruwS3d6iKRkDyRLnpSoqqwbNW7lM+RVuRojlaPdn/2bV4YjiwiEFgbsjz8YA kv4YYmSdHOHPxyPPEOWG/5zOW8PUZzLG6QYEdSUqZakBzWm4yoyhCIcmQ0wXyVStV6UG jAaw4aBCkZ85KPu8Ds+lMySd4yQxeVKutgybDmxgkBU9pB1xTrhCQ6SJxvr4rMkNw0wA ni/Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=DwjM5+XQt9wtYIKFEGTVgbsSm7iWf/9ZBrb+ZXUhmlQ=; b=CzQe67C06hTAKtEML40Oo1jP4m63THghtB/3pXna0GTlqIgbH5PMBdow/pR0lfpCV4 QACVi7HfnpRFQZjEKVl/rWYO6V68sKyzEaqLgoX5xHZaNFb5pYlzZJMGvwtd+ialItpm VmkozGO3MLjzR9rXhbmJGYnm2PEpSRpEc8TOHKuTqL8O86vpeMp16QnvyLoGct1JYTo/ nKBQXlKpSXUcC26GBOVBNhwpDZ1+xpkYLhuqf5mbgCaOB4sgvc+UDtZWyUn0nvtr9nky mXbKR/BUTFdDWD0b8XhqUCci5At3yTSlT2z3Aik6CHuPSgKVki63MNstPFHozICFOoIp +upQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F8lhzdDq; 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 c65-20020a633544000000b0053488d41c5asi1389279pga.330.2023.05.19.02.37.16; Fri, 19 May 2023 02:37:28 -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=F8lhzdDq; 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 S229972AbjESJ33 (ORCPT + 99 others); Fri, 19 May 2023 05:29:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjESJ31 (ORCPT ); Fri, 19 May 2023 05:29:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1436E43 for ; Fri, 19 May 2023 02:29:24 -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 2D9516558D for ; Fri, 19 May 2023 09:29:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95151C433D2; Fri, 19 May 2023 09:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684488563; bh=XoazJ8+NY/zUkaU8NzggrB/ghI/4odceV/1JnUi+Dmc=; h=From:To:Cc:Subject:Date:From; b=F8lhzdDq6FFa/B9xQpGC3UMBhg06/S8aUAed0Bx6y3p7D8C0KePzwA28eJ6MwOWnB HCzOB9mw0ArwodrqG93+d2iUANl2qG2+g6/eoIrKQBPQYczyF3XxlvWCzbTErhUzlC GPiDfT2Ni/svQaioieFFywhgVN8es8lASKkH163niPjsMEAF2S/hhKx9UEKU4f68gh UvhCYp96WcUev936+h1S2Dg7pP5GOWLVnlJntnTlGVEu43C36hqbCfHb/tZP+ZWYm/ n9+do87UuZ1KvZwRdyJAhg/zhegv053Vq3jEgxkSNlSa7IaD1Jje2B00yvYt9tcKx/ nDRHkSehZEcng== From: Arnd Bergmann To: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Stefano Stabellini Cc: Arnd Bergmann , Boris Ostrovsky , "H. Peter Anvin" , Oleksandr Tyshchenko , "Peter Zijlstra (Intel)" , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] x86: xen: add missing prototypes Date: Fri, 19 May 2023 11:28:40 +0200 Message-Id: <20230519092905.3828633-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 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?1766314787622604583?= X-GMAIL-MSGID: =?utf-8?q?1766314787622604583?= From: Arnd Bergmann These function are all called from assembler files, or from inline assembler, so there is no immediate need for a prototype in a header, but if -Wmissing-prototypes is enabled, the compiler warns about them: arch/x86/xen/efi.c:130:13: error: no previous prototype for 'xen_efi_init' [-Werror=missing-prototypes] arch/x86/platform/pvh/enlighten.c:120:13: error: no previous prototype for 'xen_prepare_pvh' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:358:20: error: no previous prototype for 'xen_pte_val' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:366:20: error: no previous prototype for 'xen_pgd_val' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:372:17: error: no previous prototype for 'xen_make_pte' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:380:17: error: no previous prototype for 'xen_make_pgd' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:387:20: error: no previous prototype for 'xen_pmd_val' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:425:17: error: no previous prototype for 'xen_make_pmd' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:432:20: error: no previous prototype for 'xen_pud_val' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:438:17: error: no previous prototype for 'xen_make_pud' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:522:20: error: no previous prototype for 'xen_p4d_val' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:528:17: error: no previous prototype for 'xen_make_p4d' [-Werror=missing-prototypes] arch/x86/xen/mmu_pv.c:1442:17: error: no previous prototype for 'xen_make_pte_init' [-Werror=missing-prototypes] arch/x86/xen/enlighten_pv.c:1233:34: error: no previous prototype for 'xen_start_kernel' [-Werror=missing-prototypes] arch/x86/xen/irq.c:22:14: error: no previous prototype for 'xen_force_evtchn_callback' [-Werror=missing-prototypes] arch/x86/entry/common.c:302:24: error: no previous prototype for 'xen_pv_evtchn_do_upcall' [-Werror=missing-prototypes] Declare all of them in an appropriate header file to avoid the warnings. For consistency, also move the asm_cpu_bringup_and_idle() declaration out of smp_pv.c. Signed-off-by: Arnd Bergmann --- v2: fix up changelog --- arch/x86/xen/efi.c | 2 ++ arch/x86/xen/smp.h | 4 ++++ arch/x86/xen/smp_pv.c | 1 - arch/x86/xen/xen-ops.h | 14 ++++++++++++++ include/xen/xen.h | 3 +++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c index 7d7ffb9c826a..863d0d6b3edc 100644 --- a/arch/x86/xen/efi.c +++ b/arch/x86/xen/efi.c @@ -16,6 +16,8 @@ #include #include +#include "xen-ops.h" + static efi_char16_t vendor[100] __initdata; static efi_system_table_t efi_systab_xen __initdata = { diff --git a/arch/x86/xen/smp.h b/arch/x86/xen/smp.h index 22fb982ff971..81a7821dd07f 100644 --- a/arch/x86/xen/smp.h +++ b/arch/x86/xen/smp.h @@ -1,7 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _XEN_SMP_H +void asm_cpu_bringup_and_idle(void); +asmlinkage void cpu_bringup_and_idle(void); + #ifdef CONFIG_SMP + extern void xen_send_IPI_mask(const struct cpumask *mask, int vector); extern void xen_send_IPI_mask_allbutself(const struct cpumask *mask, diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c index a92e8002b5cf..d5ae5de2daa2 100644 --- a/arch/x86/xen/smp_pv.c +++ b/arch/x86/xen/smp_pv.c @@ -55,7 +55,6 @@ static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work) = { .irq = -1 }; static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) = { .irq = -1 }; static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id); -void asm_cpu_bringup_and_idle(void); static void cpu_bringup(void) { diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 6d7f6318fc07..0f71ee3fe86b 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -160,4 +160,18 @@ void xen_hvm_post_suspend(int suspend_cancelled); static inline void xen_hvm_post_suspend(int suspend_cancelled) {} #endif +void xen_force_evtchn_callback(void); +pteval_t xen_pte_val(pte_t pte); +pgdval_t xen_pgd_val(pgd_t pgd); +pte_t xen_make_pte(pteval_t pte); +pgd_t xen_make_pgd(pgdval_t pgd); +pmdval_t xen_pmd_val(pmd_t pmd); +pmd_t xen_make_pmd(pmdval_t pmd); +pudval_t xen_pud_val(pud_t pud); +pud_t xen_make_pud(pudval_t pud); +p4dval_t xen_p4d_val(p4d_t p4d); +p4d_t xen_make_p4d(p4dval_t p4d); +pte_t xen_make_pte_init(pteval_t pte); +void xen_start_kernel(struct start_info *si); + #endif /* XEN_OPS_H */ diff --git a/include/xen/xen.h b/include/xen/xen.h index 0efeb652f9b8..f989162983c3 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -31,6 +31,9 @@ extern uint32_t xen_start_flags; #include extern struct hvm_start_info pvh_start_info; +void xen_prepare_pvh(void); +struct pt_regs; +void xen_pv_evtchn_do_upcall(struct pt_regs *regs); #ifdef CONFIG_XEN_DOM0 #include