[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 5/6] tools: Allow building xen-hptool without CONFIG_MIGRATE


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Wed, 6 May 2026 08:52:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NOFc6pYpQASlrrVU8saUhLQD1bqJYfiCqzt8u7cCUQg=; b=TgMj3uZ4Eboi2y73ssfgnpKNF3KQKuSXi9o4SAkaEHgZQJ07c7JPZluyMKPcdc5rb7LXE/DPOUocQhHAXjh1zEm3XZ4BKnkTT2RmqcaLRljA4kX/BptGLJy3OwAr0aARU6vbCyseNb4wxHH1SAh6VejAWD+q/Zwhh/glyKp+6B/9m+xjaRhNKZnyrQlvPKjN7UMTRCUUV7FBkeSgO+aoxkXTENNbyRP3CYzNu4btrhGYxUq9V1W5Ip3cW+iL9qFRIypvzU7A3qQCVkei9L4/x+1FNoeiH900iAlNyCX803PG3axUD/FzFdRSp1V5u/GUwXKnvZE6jXUIP/7TOoONuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BafhuG5vEHpO3EimdSMGzo3bPUI8e0wBYHzZ/Mo2IjW3CiEZtFtcBY+dVmOZi/k4Tb6f65fA0wPApMbi0K76/NAO4YgS6r122Ogimvh9ibo94ZL9r857tW/iIoUltH8sUG4C5hmObWrlNldoI41o9pBBoogqOlUDkxIczxZbtXjap24rc/n7zgLmQRjQFRo8ZG6gAR6d7WsUGAolGOolFOS3iGYFqxu4S/Vx+wP3Tv+B4LlhWo+eq0ILv6xFVOwkWVclGDbrzb6vr76fXD9q/WE4XjdWv8ezGja7C8Q9UoiS0CcVP/5P289DxDu8bmDF6SIXKuyCEu0zu9qLeczhvQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 06 May 2026 08:52:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcwDy3LJnr4T20vUWAas874pXmi7XHAiYAgBlL+wCAAQu/AIAAGf4AgBTWBoCACqD3AA==
  • Thread-topic: [PATCH v7 5/6] tools: Allow building xen-hptool without CONFIG_MIGRATE

On 4/29/26 17:33, Anthony PERARD wrote:
> On Thu, Apr 16, 2026 at 08:22:32AM +0000, Mykyta Poturai wrote:
>> On 4/16/26 09:49, Jan Beulich wrote:
>>> On 15.04.2026 16:51, Mykyta Poturai wrote:
>>>> On 3/30/26 15:32, Jan Beulich wrote:
>>>>> This looks wrong to me. There are x86-specifics in that file, which 
>>>>> shouldn't
>>>>> be built on Arm. And the name of the file also doesn't indicate any 
>>>>> relation
>>>>> to CPU management.
>>>>
>>>> xen-hptool requires xg_offline_page as it has both CPU and memory
>>>> hotplug commands. Without building xg_offline_page it fails with
>>>>
>>>> xen-hptool: symbol lookup error: xen-hptool: undefined symbol:
>>>> xc_mark_page_offline, version libxenguest_4.22.0
>>>>
>>>> when trying to do memory ops.
>>>>
>>>> Is it an acceptable behavior?
>>>
>>> I don't think so, no. The tool wouldn't, aiui, load at all then if built 
>>> with
>>> "bindnow" enabled.
>>>
>>>> If so I guess we can build xg_offline page only on x86.
>>>
>>> We still need to, imo. But the tool still needs to be usable no matter how
>>> specifically it is built. It should avoid referencing xg_offline_page.c
>>> functions when built for non-x86.
>>
>> As I understand, the usage of arch-specific compile time checks is
>> heavily discouraged in tools. So I don’t think it would be approved by
>> tools maintainers. Do we really need to omit this file if memory ops are
>> already getting blocked by Xen on Arm anyway?
> 
> So you are trying to modify a library and introduced untested
> functionality just to be able to build a different tool? I don't think
> that a good idea especially in this case where it's more than just glue
> code between a binary and xen.
> 
> We could change the library to provide the missing symbols, but it is
> probably best to keep it that way for now.
> 
> So, how about changing `xen-hptool` to have reduced functionality on
> other platform, and keep the 'mem-*' command on x86 only? You could move
> the function that implement the 'mem-*' command into a separate file,
> that compile only on x86 (or more specifically when CONFIG_MIGRATE is
> set) and just have a "#if defined(__i386__) || defined(__x86_64__)" in
> the `main_options` array.
> 
> They are compile-time arch-specific check everywhere in tools. Arch
> specific are often implemented in separated source file, this mean we
> can limit the #ifdefs to a minimum and keep the code readable.
> 
> Thanks,
> 
> 

Should I also do the same thing for SMT operations?

-- 
Mykyta

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.