From nobody Fri May 17 09:18:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1686728136; cv=none; d=zohomail.com; s=zohoarc; b=SYcax1NO430Ecror+vXePmQikqVpbHaVDdQjTJvwrsxGAGSOCfm2nDA8CrPAWPXZeGKwlgLuZcLFg/r3CSa51faswkhw3jdj5nkPtm9Ejgp33FTiQi8qXJBqAD52zz3SUVGRKHAtXvaXs6r5mQ2BS5j55oWUHDYk+s+H/OaXeYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686728136; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YgJA17a1c7AVDrVoB4HwZlBuwIqmPEUlEc3gzIFv3pY=; b=CZ1gg9Qzhm6IctkiqKOwJIQVHmX1pG+eJeDYEaDD8TW/7RV0h6g7L+/4dTvLae1EESIKGpWXcCTv0ZMUqHanezo4kPxxw6eFe9f2vJ096CC8M8ABTN7IXzTCx02sC5JzjFKxaJk83emhpx05pff0ufkuoBcGIXKv3IXrpSGY/Eo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1686728136445800.746449820254; Wed, 14 Jun 2023 00:35:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.548505.856478 (Exim 4.92) (envelope-from ) id 1q9L2F-0007bl-Qm; Wed, 14 Jun 2023 07:35:19 +0000 Received: by outflank-mailman (output) from mailman id 548505.856478; Wed, 14 Jun 2023 07:35:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9L2F-0007bc-No; Wed, 14 Jun 2023 07:35:19 +0000 Received: by outflank-mailman (input) for mailman id 548505; Wed, 14 Jun 2023 07:35:18 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9L2E-0007aV-3M for xen-devel@lists.xenproject.org; Wed, 14 Jun 2023 07:35:18 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 008c9f71-0a86-11ee-8611-37d641c3527e; Wed, 14 Jun 2023 09:35:14 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 73AED21857; Wed, 14 Jun 2023 07:35:14 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 20CA01391E; Wed, 14 Jun 2023 07:35:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wH2bBrJtiWQyHwAAMHmgww (envelope-from ); Wed, 14 Jun 2023 07:35:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 008c9f71-0a86-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686728114; h=from:from:reply-to: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=YgJA17a1c7AVDrVoB4HwZlBuwIqmPEUlEc3gzIFv3pY=; b=SrM4IiLyt4N7guH1CZIQ0nKGj3L6b9HODrNWAv2YMcYoNAzVz4cSCZUEiGSmZnKipU46r4 2rb0hubPsFyJGeQAp07phllcBHG8owzj2AAk30x9UBgKykWUiR7mPeWxvtj2r6yf+D8NcY MlCT16p+pawSJdSdangqU0dacCuGAAU= From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org, Arnd Bergmann Subject: [PATCH v4 1/2] x86/xen: add prototypes for paravirt mmu functions Date: Wed, 14 Jun 2023 09:35:00 +0200 Message-Id: <20230614073501.10101-2-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230614073501.10101-1-jgross@suse.com> References: <20230614073501.10101-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1686728138259100001 Content-Type: text/plain; charset="utf-8" The paravirt MMU functions called via the PV_CALLEE_SAVE_REGS_THUNK() macro can't be defined to be static, as the macro is generating a function via asm() statement calling the paravirt MMU function. In order to avoid warnings when specifying "-Wmissing-prototypes" for the build, add local prototypes (there should never be any external caller of those functions). Reported-by: Arnd Bergmann Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- arch/x86/xen/mmu_pv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index b3b8d289b9ab..e0a975165de7 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -86,6 +86,22 @@ #include "mmu.h" #include "debugfs.h" =20 +/* + * Prototypes for functions called via PV_CALLEE_SAVE_REGS_THUNK() in order + * to avoid warnings with "-Wmissing-prototypes". + */ +pteval_t xen_pte_val(pte_t pte); +pgdval_t xen_pgd_val(pgd_t pgd); +pmdval_t xen_pmd_val(pmd_t pmd); +pudval_t xen_pud_val(pud_t pud); +p4dval_t xen_p4d_val(p4d_t p4d); +pte_t xen_make_pte(pteval_t pte); +pgd_t xen_make_pgd(pgdval_t pgd); +pmd_t xen_make_pmd(pmdval_t pmd); +pud_t xen_make_pud(pudval_t pud); +p4d_t xen_make_p4d(p4dval_t p4d); +pte_t xen_make_pte_init(pteval_t pte); + #ifdef CONFIG_X86_VSYSCALL_EMULATION /* l3 pud for userspace vsyscall mapping */ static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss; --=20 2.35.3 From nobody Fri May 17 09:18:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1686728139; cv=none; d=zohomail.com; s=zohoarc; b=SbCi0tA98TyWE72WGFOA+l7ri6c6hEKvCJwx5FmMDmWXN6pAEJijFBwvOgwj3d23lnSO0yETQ2xg0aUDke2t+GHK/thvo9cBdhKSuGcaTpCECysPCKI90N3WrxQLoVqxPUWEKFLSlrXpKk7Ie2Uwqm8zpfBCJB9WvYt6YHXQ8kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686728139; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jKTmIuG44BdSii87EddLytcEKZcOQpLokCYRhdq7cjM=; b=ZhLDsAeD/2pchAJOnUmaCUuxQN/icpaR9F0Wh8VcFZYFbdgNyrUm3JJd+3EKK8YWFNnAfgMehaWKjFusdlP0LoWdGy1vN42SgFU2YikFD9JK6N8UVDD549IXthGs8/ewjQVKGQ3NV8tupYVJ7q2ywaTzh/xfnMkY/jsgtdUIuDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1686728139312758.4020494100093; Wed, 14 Jun 2023 00:35:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.548506.856488 (Exim 4.92) (envelope-from ) id 1q9L2J-0007si-4I; Wed, 14 Jun 2023 07:35:23 +0000 Received: by outflank-mailman (output) from mailman id 548506.856488; Wed, 14 Jun 2023 07:35:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9L2I-0007sb-W8; Wed, 14 Jun 2023 07:35:22 +0000 Received: by outflank-mailman (input) for mailman id 548506; Wed, 14 Jun 2023 07:35:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9L2I-0007aV-AA for xen-devel@lists.xenproject.org; Wed, 14 Jun 2023 07:35:22 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 03f7a4a0-0a86-11ee-8611-37d641c3527e; Wed, 14 Jun 2023 09:35:20 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3C98C1FD6A; Wed, 14 Jun 2023 07:35:20 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DA9731391E; Wed, 14 Jun 2023 07:35:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EWQDNLdtiWRVHwAAMHmgww (envelope-from ); Wed, 14 Jun 2023 07:35:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 03f7a4a0-0a86-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686728120; h=from:from:reply-to: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=jKTmIuG44BdSii87EddLytcEKZcOQpLokCYRhdq7cjM=; b=oIvCas+cd9SDP91Ts9iEvkChPfeGhwMxFt/iaiZ5ygGF17F6cJ/XiH08XzsYKrHT8MXhtk 6itKTL5e3Mx72I9S8uNCXhCl8VGkXe5kOsPCRfg2k1Uwuc9pmmZN713yyAOvhkzO+oqPPr l4PHceSRrfbdCugCtHRe4hhYqyrrFUc= From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Arnd Bergmann , Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org Subject: [PATCH v4 2/2] x86: xen: add missing prototypes Date: Wed, 14 Jun 2023 09:35:01 +0200 Message-Id: <20230614073501.10101-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230614073501.10101-1-jgross@suse.com> References: <20230614073501.10101-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1686728141545100001 Content-Type: text/plain; charset="utf-8" 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=3Dmissing-prototypes] arch/x86/platform/pvh/enlighten.c:120:13: error: no previous prototype for = 'xen_prepare_pvh' [-Werror=3Dmissing-prototypes] arch/x86/xen/enlighten_pv.c:1233:34: error: no previous prototype for 'xen_= start_kernel' [-Werror=3Dmissing-prototypes] arch/x86/xen/irq.c:22:14: error: no previous prototype for 'xen_force_evtch= n_callback' [-Werror=3Dmissing-prototypes] arch/x86/entry/common.c:302:24: error: no previous prototype for 'xen_pv_ev= tchn_do_upcall' [-Werror=3Dmissing-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 Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- v4: [jgross]: remove some stubs, carve out mmu_pv.c prototypes into other patch v3: move declations of conditional function in an #ifdef with a stub 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 | 3 +++ include/xen/xen.h | 3 +++ 5 files changed, 12 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 =20 +#include "xen-ops.h" + static efi_char16_t vendor[100] __initdata; =20 static efi_system_table_t efi_systab_xen __initdata =3D { diff --git a/arch/x86/xen/smp.h b/arch/x86/xen/smp.h index 22fb982ff971..c20cbb14c82b 100644 --- a/arch/x86/xen/smp.h +++ b/arch/x86/xen/smp.h @@ -2,6 +2,10 @@ #ifndef _XEN_SMP_H =20 #ifdef CONFIG_SMP + +void asm_cpu_bringup_and_idle(void); +asmlinkage void cpu_bringup_and_idle(void); + 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 a9cf8c8fa074..9ccf9759870d 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= ) =3D { .irq =3D -1 }; static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) =3D { .irq =3D -= 1 }; =20 static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id); -void asm_cpu_bringup_and_idle(void); =20 static void cpu_bringup(void) { diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index a10903785a33..1bbbe216e6e1 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -148,9 +148,12 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned = int), void xen_pin_vcpu(int cpu); =20 void xen_emergency_restart(void); +void xen_force_evtchn_callback(void); + #ifdef CONFIG_XEN_PV void xen_pv_pre_suspend(void); void xen_pv_post_suspend(int suspend_cancelled); +void xen_start_kernel(struct start_info *si); #else static inline void xen_pv_pre_suspend(void) {} static inline void xen_pv_post_suspend(int suspend_cancelled) {} 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; =20 #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); =20 #ifdef CONFIG_XEN_DOM0 #include --=20 2.35.3