From nobody Mon Mar 10 02:43:37 2025 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=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1741133123; cv=none; d=zohomail.com; s=zohoarc; b=VBqSkWvJjfsFnl1ODcxyOyt4U+82PKo3bHRyCWu3lDn5nkrVjG6vseBH+qdQ/MpVS9zTZMeBdKAQJ1JULDhJqIH33YtWqUbn2PbIEE5OOBO4Zv00xadmTznjLholufj2E+LPG5pusSwIWB7/3AS4zftzqrxmIJqoeaGAdZqGXT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741133123; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fggL8gjJQh3WZv8LFKJP+En/Pq4iqlskBDNzkNbL1nY=; b=G6Nbu9KCxnyWvWuJKyCmPG1jb/uHnaKk0YUmcAdaJ2al85p9er8BxwW3lohwGc9h6Bb9bt9M0s/GXwNjFL+SSkduz8mZ5XkQXrw5yMMA/74w5Byf9JBr43TaAaVAXVLQKgdzTS07+d+Rdoo6JQFbHqyP1AD6b6vpTV5qGh9+BNU= 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=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174113312367537.79364235458229; Tue, 4 Mar 2025 16:05:23 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.901607.1309603 (Exim 4.92) (envelope-from ) id 1tpcFw-00020v-Ts; Wed, 05 Mar 2025 00:05:00 +0000 Received: by outflank-mailman (output) from mailman id 901607.1309603; Wed, 05 Mar 2025 00:05:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tpcFw-0001zx-MZ; Wed, 05 Mar 2025 00:05:00 +0000 Received: by outflank-mailman (input) for mailman id 901607; Wed, 05 Mar 2025 00:05:00 +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 1tpcFw-0000xS-16 for xen-devel@lists.xenproject.org; Wed, 05 Mar 2025 00:05:00 +0000 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [2a00:1450:4864:20::334]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7959ad19-f955-11ef-9898-31a8f345e629; Wed, 05 Mar 2025 01:04:57 +0100 (CET) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43995b907cfso40095025e9.3 for ; Tue, 04 Mar 2025 16:04:57 -0800 (PST) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd435300esm476005e9.29.2025.03.04.16.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 16:04:56 -0800 (PST) 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: 7959ad19-f955-11ef-9898-31a8f345e629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741133097; x=1741737897; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fggL8gjJQh3WZv8LFKJP+En/Pq4iqlskBDNzkNbL1nY=; b=uFQTdDyFPKtk5sLIN50NLkTPhoASoR+pZNMOJDBQCuYMydXwoAKk0MepFLPLduc0fV LkLCBBuQ/dOFr8SfB9JmZdWmt6Fl24LiL5Xyu+J7OcNCndegGvyP/UWBcgAf52sfw2Zi L8MvG1UfCry9ZrChVKQVW9UD4zvfQIWC/svOo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741133097; x=1741737897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fggL8gjJQh3WZv8LFKJP+En/Pq4iqlskBDNzkNbL1nY=; b=FOVcuxSWrx8E6tejhADpDZaqQ5saf3LWb2EYINg61d7S1uaHPSp2pPnH/5yFVp5ydr eI/07yeKfLkURTTLSaPxl780V+ljEGWJ4YHYbebm+zcecyT46ygBM04h9KzjwUiZ2GlU CxPH9Sb4vYRpHmDR/M5CVcz4CwB+zLSzyzbxLRiQKbkIEWJ8SY7yEt97Si99j9sg/+1I L/TZI9VNgAT885UhDqAbIXFyJiitm3AD91yZSTgyFxQyiVjYfK6n5Su8BuqKf4dywc4o pR0uagp/wJBmeM1RolSYvMBY662Ha0hi98GkK3lzJow2F89f88H3PNDG3iOMZ0Yds/+F wLbg== X-Gm-Message-State: AOJu0YxxKgfHcB4QRUTh/wMcWb2834jzNuBjzJgtsuKGUI315yTdobWa HS4qTSDNaHPEqE2z8JXXIohaJKF9dgPDUwEftH1fSQu9YmY6+POdUJ54xWwdh4zPYNAAvQi9Bso E X-Gm-Gg: ASbGnctZFgmm+Jum7FYx91gaUjqY3P35JIIO/VfhOrB6j8fCxL70DBUhKD9qrvLqK4c NDIonrknX3bJASZdI3eQ+dngvZUMTegPvLnticP1ZDOQvpt24Tw7ChXIapklZFgn/bpkNQPweJX wHhmwUpy3pstbjxtzPrQyO5NduUH5JZyCuYOvjJTppcvtj+lCQ9tcUWKg7F98XZlj21Hk4LfzeH 0Er0C4Act80qqlkFBViHBfxix4rMmrYI3sJgC1THqTmhdsmsfgM9iG2WsZM8P2yVAK1vtlIlfX9 keGkw+309bzThLBfoaLlxmGn2S8HsmFQ9+IOXfl6+YfyhJu0QDV/zwzCyN1ZVIM9SGzd6LPNJQK 4TghtgUyOUgxYLHxDA6pYKn8q X-Google-Smtp-Source: AGHT+IE/t7GOoWMZzDu5WPvfmxfaav4VcwRjDgrjwEuQnt5Ss6XOdzCKh7YJr8ieVfW6KpdvCs4tgQ== X-Received: by 2002:a05:600c:1c09:b0:439:9946:af60 with SMTP id 5b1f17b1804b1-43bd2ae76c6mr4347285e9.25.1741133096876; Tue, 04 Mar 2025 16:04:56 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 5/5] x86/traps: Convert pv_trap_init() to being an initcall Date: Wed, 5 Mar 2025 00:02:47 +0000 Message-Id: <20250305000247.2772029-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250305000247.2772029-1-andrew.cooper3@citrix.com> References: <20250305000247.2772029-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1741133125168019100 With most of pv_trap_init() being done at build time, opening of NMI_SOFTIRQ can be a regular initcall, simplifying trap_init(). No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 For Branch: https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1684170631 https://cirrus-ci.com/build/6590097610506240 --- xen/arch/x86/include/asm/pv/traps.h | 4 ---- xen/arch/x86/pv/traps.c | 5 ++++- xen/arch/x86/traps.c | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/include/asm/pv/traps.h b/xen/arch/x86/include/asm= /pv/traps.h index 404f5b169ca8..8c31d5a793c5 100644 --- a/xen/arch/x86/include/asm/pv/traps.h +++ b/xen/arch/x86/include/asm/pv/traps.h @@ -14,8 +14,6 @@ =20 #include =20 -void pv_trap_init(void); - int pv_raise_nmi(struct vcpu *v); =20 int pv_emulate_privileged_op(struct cpu_user_regs *regs); @@ -32,8 +30,6 @@ static inline bool pv_trap_callback_registered(const stru= ct vcpu *v, =20 #include =20 -static inline void pv_trap_init(void) {} - static inline int pv_raise_nmi(struct vcpu *v) { return -EOPNOTSUPP; } =20 static inline int pv_emulate_privileged_op(struct cpu_user_regs *regs) { r= eturn 0; } diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c index 932800555bca..c3c0976c440f 100644 --- a/xen/arch/x86/pv/traps.c +++ b/xen/arch/x86/pv/traps.c @@ -141,10 +141,13 @@ static void cf_check nmi_softirq(void) *v_ptr =3D NULL; } =20 -void __init pv_trap_init(void) +static int __init cf_check pv_trap_init(void) { open_softirq(NMI_SOFTIRQ, nmi_softirq); + + return 0; } +__initcall(pv_trap_init); =20 /* * Deliver NMI to PV guest. Return 0 on success. diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 7698fa580ef7..5addb1f903d3 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1928,8 +1928,6 @@ void __init trap_init(void) /* Replace early pagefault with real pagefault handler. */ _update_gate_addr_lower(&bsp_idt[X86_EXC_PF], entry_PF); =20 - pv_trap_init(); - init_ler(); =20 /* Cache {,compat_}gdt_l1e now that physically relocation is done. */ --=20 2.39.5