From nobody Fri Oct 23 15:33:33 2026 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=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1790864927; cv=none; d=zohomail.com; s=zohoarc; b=jmLneAESc+RSfQlBvbgIUrvlvzz88iC00aSImHZ1TEapCShOukE1UVbkv5RzuoTL2offF+HFKK6iBg4G40CH/9C/UTyVN0omXVWBPtn4Yb6NTDnaEDRfvfrxm2Xc93v9E9zxzeRsR9AeusBz+I2D8W3gOqUZc9vScgAdWnzBv+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790864927; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1QxjtvUklegWRfBANHigZ/YREbPg51Bp8Po4VD0WCg0=; b=bV7EJ4odB514/cTsvl/kXTTEjrB9hnZsN6S2qQL7lkrrVpNkWSRc+nGQ1xRswdmbylf/WgnkTRgLyMe3Xp8OCtnYoaEP/6GVy2F16pr9piZP86n49A1gy3BA1dBlNDl+AEMbA6gp7kmbaHZSnIIZnfeNiHEF5c1itCXp3ZMJ18c= 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1790864927176979.6135239345627; Thu, 1 Oct 2026 07:28:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1438411.1657249 (Exim 4.92) (envelope-from ) id 1xCHla-0003vA-Of; Thu, 01 Oct 2026 14:28:10 +0000 Received: by outflank-mailman (output) from mailman id 1438411.1657249; Thu, 01 Oct 2026 14:28:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xCHla-0003v3-M1; Thu, 01 Oct 2026 14:28:10 +0000 Received: by outflank-mailman (input) for mailman id 1438411; Thu, 01 Oct 2026 14:28:09 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xCHlZ-0003uw-I3 for xen-devel@lists.xenproject.org; Thu, 01 Oct 2026 14:28:09 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1xCHlY-009ShJ-24; Thu, 01 Oct 2026 14:28:09 +0000 Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224] helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xCHlY-003pfC-1q; Thu, 01 Oct 2026 14:28:09 +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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From; bh=1QxjtvUklegWRfBANHigZ/YREbPg51Bp8Po4VD0WCg0=; b=WbTKhTcywiEDiH2oNhMrI/XtQ1 Gr0QQQDY1OYw+Y5Otd66+i+7pO7SyDck3684YanG6x7CL4oOLLk0/5lmnsQisLIswvu5J6PLGcR8W uI/zEPHR41Yof3WhsaSG9n9kpeFH7KKgyN0Y8Pqsh0a728wc2759gcchPeQxpMHbzwgo=; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Grygorii Strashko , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie Subject: [PATCH] x86/domain: restrict context switch hooks for the idle domain Date: Thu, 1 Oct 2026 16:27:57 +0200 Message-ID: <20261001142757.98255-1-roger@xenproject.org> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1790864929293158500 From: Grygorii Strashko The arch_init_idle_domain() initializes struct arch_csw idle_csw as: static const struct arch_csw idle_csw =3D { .from =3D paravirt_ctxt_switch_from, .to =3D paravirt_ctxt_switch_to, .tail =3D idle_loop, }; but only place where d->arch.ctxt_switch->{to,from}() are used is __context_switch() where they are both guarded by !is_idle_domain(pd) which makes the callbacks in idle_csw unreachable. Drop to/from() callbacks initialization in idle_csw. Signed-off-by: Grygorii Strashko Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jason Andryuk Reviewed-by: Juergen Gross --- I don't think there's a suitable Fixes candidate here. The idle domain hooks used to piggyback on the PV ones, and commit ab914e04a6272 split those out into it's own structure. At that point the to/from hooks could have been left zeroed, but that wasn't the point of that commit anyway. --- xen/arch/x86/domain.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 996b50af7a17..464ca6f39026 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -813,8 +813,6 @@ static bool emulation_flags_ok(const struct domain *d, = uint32_t emflags) void __init arch_init_idle_domain(struct domain *d) { static const struct arch_csw idle_csw =3D { - .from =3D paravirt_ctxt_switch_from, - .to =3D paravirt_ctxt_switch_to, .tail =3D idle_loop, }; =20 --=20 2.55.0