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

Re: [PATCH] x86/pv: Inline domain_set_alloc_bitsize() into it's single caller


  • To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 9 Dec 2025 19:54:12 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=NPJDc6Eb3kzVdDowzLmpwXresW43dsdKD8iMDM9CUmo=; b=m1d3iilmj2l63pjOdDbSHaKR7cT/YCMguwFKdIGaLogFNg2mbnO6AfQWt8sqZKjU4VvAM9HkAZk05FH9QVkUiPyQmebS3O0fqiRf/oBpz5hry/TcCw6bIl4ENhWwaL+efA08kRsDqex86eqlrPOQscaa9DtxL8x8u40K3zfW5Cc9b2i6UJWqqaKeqUenZBmMtY9E6OdltZsAgNUMP42KnChrg5WJsL9I3QBpH91pmUrDXqDsj5j/hfu++NAcwes56IwSOD1EI4nZjJjRqSRiG4JUjDtmlEe9khLDi5CJd001Cd004UUNOwVNkKDggZHvuWjaVNM/DsUH6ihoLCdteA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ueQJiMvTGZ4Z/K/9HYzFDt9sIxjO9ytRa01Ckoa6vcH8yuUY6sZH4CI3hHuv7f4VbQ85haVK6lHCBOFQvAwJTFYU5upIe1z3CiwF8pkddjzNo341Yc0vxRvHm8rBDKsm8oSR3P9W228vEhXCdPpolU7YwioNE+qaOydeN+bFxh7jwj2Zu7RO+kP5wlyCWUGpChTP0z+gn/tS0a6ogykc7zKESkJT+l1smr1sDvOusk+59Hy4TKHhcCWNUUXZ4f5mtOBQI+jWC9REfa/k6jmiOC0C8+n/CZa6puUMgxYb+W8JUDyEHDRzpcV6ZeGcWYTRQC6JjqIFpEd2JlAC2uOhWw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 09 Dec 2025 19:54:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09/12/2025 7:29 pm, Andrew Cooper wrote:
> On 09/12/2025 7:21 pm, Grygorii Strashko wrote:
>> Hi Andrew,
>>
>> On 09.12.25 20:07, Andrew Cooper wrote:
>>> Prior to commit 02e78311cdc6 ("x86/domctl: Make
>>> XEN_DOMCTL_set_address_size
>>> singleshot") (Xen 4.9, 2016), it was possible for domains to switch
>>> to being
>>> compat, and back again.  Since then however, becoming compat is a
>>> singleton
>>> action that can't be undone.
>>>
>>>  From the context it's clear to see the is_pv_32bit_domain() check is
>>> redundant, and from the singleton nature being the only place setting
>>> physaddr_bitsize, there's no need to check it for being 0.
>>>
>>> No functional change.
>>>
>>> Co-developed-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>> ---
>>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> CC: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>>
>>> Split out of series to simplify things.
>>>
>>> bloat-o-meter reports:
>>>
>>>    add/remove: 0/1 grow/shrink: 1/0 up/down: 25/-96 (-71)
>>>    Function                                     old     new   delta
>>>    switch_compat                                447     472     +25
>>>    domain_set_alloc_bitsize                      96       -     -96
>>>
>>> which will mostly be the LFENCEs embedded in is_pv_32bit_domain().
>> Thank you for doing this.
>> Not sure if it's needed, any way.
>> Reviewed-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
> It does help.  Technically it lets me commit the patch right now, but
> I'll leave it until at least tomorrow in case anyone else has comments.
>
> ~Andrew
>

FYI, here is the remainder of your patch rebased over this one.

I recommend splitting it into two, one sorting out
domain_clamp_alloc_bitsize() (however that will end up looking), and one
moving physaddr_bitsize into pv_domain.

It's almost always better to separate code movement from logical changes.

~Andrew

Attachment: 0001-xen-x86-move-d-arch.physaddr_bitsize-field-handling-.patch
Description: Text Data


 


Rackspace

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