Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D4A9CD98F2 for ; Thu, 18 Jun 2026 12:41:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1341090.1601638 (Exim 4.92) (envelope-from ) id 1waC3L-0006pY-OZ; Thu, 18 Jun 2026 12:41:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1341090.1601638; Thu, 18 Jun 2026 12:41:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1waC3L-0006pR-LP; Thu, 18 Jun 2026 12:41:03 +0000 Received: by outflank-mailman (input) for mailman id 1341090; Thu, 18 Jun 2026 12:41:02 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1waC3K-0006pK-Sk for xen-devel@lists.xenproject.org; Thu, 18 Jun 2026 12:41:02 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1waC3K-003zui-48 for xen-devel@lists.xenproject.org; Thu, 18 Jun 2026 14:41:02 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a33e741-e002-0a2a0a5209dd-0a2a4507aa68-48 for ; Thu, 18 Jun 2026 14:41:02 +0200 Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.0) (envelope-from ) id 6a33e759-4766-0a2a45070019-888fbc3352a2-3 for ; Thu, 18 Jun 2026 14:40:59 +0200 Received: by mx.zohomail.com with SMTPS id 1781786451748137.6271647654495; Thu, 18 Jun 2026 05:40:51 -0700 (PDT) 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding" ARC-Seal: i=1; a=rsa-sha256; t=1781786454; cv=none; d=zohomail.com; s=zohoarc; b=CsaCKdfsSZYdlS/2H+1B1H0y+rircLnW/iWnwfGdbW/MxyeVt4uq0GkXSLy6E18CXl5XlRO170ZC5uoFKTveiVwbGy6SP6mQVVkSelgB78AkVnzyo8sD4WY46+HEHw4fYjzPxNC6XtT2cYjaEskEUEQXl84B9j7EVVRU5xwIA5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781786454; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=C2ygIbhffl1iDYoikiKD6fli2ANxoIlWi8qio3DbWSs=; b=hqPc774sRahAnVbM5zA119yjXSxK2zE8EeR79AmZ5KpgFVdCldmFQnNdStFlaJZqAt1+Ak7sB6j45J3UIdTFrFG0vi82jI0dkTOVd5eNLD/1U5BFGVc/rHKBWd5dEzpZ6gxO9IGv/8PItpdOfTz+GntoLMl0uCPEKwpUqaNn+AY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1781786454; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=C2ygIbhffl1iDYoikiKD6fli2ANxoIlWi8qio3DbWSs=; b=cX2JRYkNh6WVFcRKWBbgBizoB3GLr9PJoyvpBizTFx6TsQ9C4kKauEQuAYUZlKM5 bR9+799IZpFfASh7hJxWp1tGrUz4S43yZeKuXXt5kqomD2JRLHlT5bAuRv4X1uZjvv7 y4XJLqQ4zUa6GOwyRnDnpqbEC89m0Q0BHbwiAGVE= Message-ID: Date: Thu, 18 Jun 2026 08:40:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH for-4.22] XSM: guard .sysctl() and .readconsole() hooks To: Jan Beulich , Andrew Cooper Cc: Oleksii Kurochko , "xen-devel@lists.xenproject.org" References: <8536e453-423d-45a0-bb82-38283eca4786@citrix.com> <0604a985-96fc-454f-b9a1-242bc6cce9b6@suse.com> Content-Language: en-US From: "Daniel P. Smith" In-Reply-To: <0604a985-96fc-454f-b9a1-242bc6cce9b6@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-purgate-ID: tlsNG-ef75cf/1781786459-881CB979-B2329992/0/0 X-purgate-type: clean X-purgate-size: 1960 On 6/18/26 8:23 AM, Jan Beulich wrote: > On 18.06.2026 14:13, Andrew Cooper wrote: >> On 18/06/2026 12:32 pm, Jan Beulich wrote: >>> Leaving the hook pointers in struct xsm_ops when !SYSCTL would lead to >>> the BUG_ON() in xsm_fixup_ops() triggering for respectively configured >>> hypervisors. >>> >>> While moving the #ifdef for the corresponding xsm_*() wrappers, also move >>> those for xsm_page_offline() (where the hook pointer field already is >>> suitably guarded). >>> >>> Fixes: c9eabaa03a68 ("xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL") >>> Fixes: bddd9af6049f ("xen/sysctl: wrap around XEN_SYSCTL_readconsole") >>> Signed-off-by: Jan Beulich >> >> Ugly.  We probably ought to see about booting the RANDCONFIG hypervisor >> too, which should be able to spot things like this. >> >> This is a regression vs 4.21, so does need including. > > Aiui it's a regression vs 4.20, i.e. will want backporting to 4.21. > >> Reviewed-by: Andrew Cooper , although... > > Thanks. > >>> --- a/xen/include/xsm/xsm.h >>> +++ b/xen/include/xsm/xsm.h >>> @@ -61,8 +61,10 @@ struct xsm_ops { >>> #endif >>> int (*set_target)(struct domain *d, struct domain *e); >>> int (*domctl)(struct domain *d, struct xen_domctl *op); >>> +#ifdef CONFIG_SYSCTL >>> int (*sysctl)(int cmd); >>> int (*readconsole)(uint32_t clear); >>> +#endif >> >> ... this is now the 3rd CONFIG_SYSCTL in xsm_ops. >> >> I know it will grow the diff, but can we see about collecting them into >> a single region, and in dummy_ops too?  It will shrink the overall >> result, and the order of pointers in this ops structure is uninteresting. > > I have a far more consolidating patch in the works, which is how I actually > noticed the issue. I'd prefer to keep things as simple as possible here. Would also be good to clean up flask_ops similarly. v/r, dps