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 914F9CD98F2 for ; Thu, 18 Jun 2026 14:51:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1341245.1601702 (Exim 4.92) (envelope-from ) id 1waE52-0006bC-V7; Thu, 18 Jun 2026 14:50:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1341245.1601702; Thu, 18 Jun 2026 14:50:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1waE52-0006b5-RK; Thu, 18 Jun 2026 14:50:56 +0000 Received: by outflank-mailman (input) for mailman id 1341245; Thu, 18 Jun 2026 14:50:55 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1waE50-0006av-Vh for xen-devel@lists.xenproject.org; Thu, 18 Jun 2026 14:50:55 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1waE50-00EvFC-8u for xen-devel@lists.xenproject.org; Thu, 18 Jun 2026 16:50:54 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a3405cb-2eae-0a2a0a5409dd-0a2a4509bc50-6 for ; Thu, 18 Jun 2026 16:50:54 +0200 Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.0) (envelope-from ) id 6a3405cd-4999-0a2a45090019-d155dd2bc0a3-3 for ; Thu, 18 Jun 2026 16:50:54 +0200 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-45eea68dd6fso609584f8f.2 for ; Thu, 18 Jun 2026 07:50:54 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4620b1083e3sm20785780f8f.20.2026.06.18.07.50.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2026 07:50:52 -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=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781794253; x=1782399053; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=OnAsW+mOMZlaoSSRnLfmPqdezOhqrvG1MnW48XYmMwo=; b=eFRXMBhOzfDhLjlNlFgqN6vyBSZtxlMoICwr+1Tondtww10XxOJPaTO/GUzXESm24d FXpYu3ADxnsgy6XyATnA/grihzALMkbrGBL9VA7VqqiETcsw1FhSZ6tIxpyatKKgpUH/ wnyHNI/BwDSlsnzs0tee2RDx1fM4JjTt5B/Xg82I8el5IcazvGC+BC23fV5bs5L//0+H M1LBVfVMlUE0HX+PZ0+JTHp5X/Kv2hiZStPqtr9UqzXrBVm6vU83c/OMpIwbqmqjsPzU d+/CJj6VxgVfuGLgu1gb+aXqxTMwgE7Kx0iyod9lp9tfqSlqcyo60Uv82Ebn2/EjpxgV C+9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781794253; x=1782399053; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OnAsW+mOMZlaoSSRnLfmPqdezOhqrvG1MnW48XYmMwo=; b=O7FyiicycKQVMgmaMVLssZ0ARmIGSoqf7LReC0y9dWKwE+StAN4rz7bTutNFjt1/Fp HMHqvCMvfwQIKHq8N0wVb+HjdKyaiqE9DiBfW4+WLkoZd4WvN8lMhcbG0VNFQsQTD0Mj Lvi2W0N0bpbbokw5CfIVGR4i75TJY6eqjfaiym7jegRD5BhibSVy1Wd0cMgoj0pbw8Oy Ofq/eeoV/oCmeQHMIZL6GRCapuxCguSTgBCfc1FjNt7G9jxl+pfc/nUIw/plT/ZlLLrb 3slupZi5KV0wClFFUDUUmhe42TKs1UfkyT+hyzfsR98/9cmGXh2oaexIME4zaSjpWYTg HZFg== X-Forwarded-Encrypted: i=1; AFNElJ/bL/auH8W4szqksYGq1pJIWm8T0XANyxifKfLknwRLGjIAPz2yulSMb+01Est/di42xy4D00O1GrQ=@lists.xenproject.org X-Gm-Message-State: AOJu0YzKgOWV9uNJsV+LQKdRyN//h3d3edczyA/0mUEQ1vDzf9gwwz11 /IE6HVtxPYDO5dx08DEGcy+jzbGmMiivm18mp/0Jz4iMznvcHPmrRsfXCdZ7g/f1Bg== X-Gm-Gg: AfdE7cnggdg0pi7QApgYa7SU/p1gdyCsanmeD5Rl+SJaQ65diOlLBJL0zlvndPe2BQ6 6ivmcAinWDckvsLo/0L/a0lD0UvFM+AXQ5Fnvaf4RRQrcXq43TA9702fQDDuqgBV8aA59viu7tO AFbNtinp596VnaNZODfNosQQ6um7/z85aA2mmDRvr85uvVpMy+lSHAyd+8SfsZ6OuxijA+QjYla 7Ax4/O1PJarrR4qIxbFTGxHBIxHjgPd99NLTNwmV9xnjvxiP8Nh8jNOE7k+yYKQuQwkOwv9/xIM AYtbUTSU1Sgv2wzUSX2yMTkDb86ybNsHrIe3g43AVPhkMfmUzbhdtIm0fdXwpZ7i9qgTXHeJ3AL wdaaGzwGFPPFsP4Iv6ig4IyByXqDfHPxYhohCu/32qAIW6B8mw/dlV8wNdwwh4tuFHwPzM6w9hb vSYXHiTtFfxyQ4lEFASnBGJdgzYwbgfR9NAETIwfM38Ii6fZGpRjdbAM5i8rPRRCHxODoiBb7Nt oqv X-Received: by 2002:adf:e612:0:b0:44b:5398:4e85 with SMTP id ffacd0b85a97d-462410d3e44mr12154680f8f.22.1781794253243; Thu, 18 Jun 2026 07:50:53 -0700 (PDT) Message-ID: <0d5d4fda-d296-4027-a62a-134fd8aaae53@suse.com> Date: Thu, 18 Jun 2026 16:50:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH for-4.22] XSM: guard .sysctl() and .readconsole() hooks From: Jan Beulich To: "Daniel P. Smith" Cc: Oleksii Kurochko , "xen-devel@lists.xenproject.org" , Andrew Cooper References: <8536e453-423d-45a0-bb82-38283eca4786@citrix.com> <0604a985-96fc-454f-b9a1-242bc6cce9b6@suse.com> <243c5119-a016-49f4-919e-efa492b02e5e@suse.com> <12468fb6-0cf7-4e27-89ca-8ec4640e569b@suse.com> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+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CH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <12468fb6-0cf7-4e27-89ca-8ec4640e569b@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-bad1c0/1781794254-F59FF744-868519D4/0/0 X-purgate-type: clean X-purgate-size: 2829 On 18.06.2026 14:51, Jan Beulich wrote: > On 18.06.2026 14:48, Daniel P. Smith wrote: >> On 6/18/26 8:42 AM, Jan Beulich wrote: >>> On 18.06.2026 14:34, Daniel P. Smith wrote: >>>> 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. >>>> >>>> By the way, I was going back through this and notices that they are not >>>> ifdef out in xsm/dummy.h. Are we relying on them being inlines to ensure >>>> that they do not result in dead code? >>> >>> I think so. Maybe it's unhelpful that we have >> >> To be clear, you want to leave as is for now (or at least pick up in >> another patch)? > > It's up to you - I can add the #ifdef there, but it doesn't look to strictly > be needed. Can you please make explicit which way you'd like it in order to provide an ack, so this bug fix can go in? Jan