[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Fri, 15 Nov 2024 14:56:25 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=EQm5PRmAqPol3vKxgkvAEAE38jM0XehU8n7J78c1Av8=; b=tdslc9+Vs1uZCh1CMeJsu8+CFVm/89lUPQv4xrM6+FFdivjhuywq+7oWa5A6v2PCQGkp+Fz8OUq17lmYBp87yn1lGQtvrn5HZMuQ4Y8ql28gICJbBc2krLM2jrVZO5IL0Z+MRGga3chqq4DHcvFtekDSNqwU38oWMDAS3IQbAogmpkPtGkspwUhA2EZJL4U64yH3R5Y8S9Pf/rxhOIBqzrUwvk6TJE39rT+3M5gNd1jSoCgkX8btr5qpzirxnaNZiyP73KlJS2vzO5OU9/ExQiOZZH0F3fc1B0KJz6qFFBdt8uB/otCg9bJC/qm3bjjTEK/H8WMNJQf+qGly7Cd5Ug==
- 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=EQm5PRmAqPol3vKxgkvAEAE38jM0XehU8n7J78c1Av8=; b=bqNVcsBnViCHYn2qedMWnAtRtlPKZJZwuxpezw9Lw1l1UCqikEfyicAZfZldNrCe2TaDBmzipiKY0yaKTqmg++GXRVVz5tWrTHivXHezz4KNlg+dCsaLk2cA7aGZT1o6AwmUdIKwOEYQCjLitwsn75EmM9zbg+CLj0MxJZEKZpzoIPDQ3SjTk/iZL4CsjeZiTosMTd0LITCpOWH3P4Dq2zFl/Si01dczQb3Nbe8nc/Ie86XT4fcsUDS/eZA3fLsJdw/Rnx9De2xBLAbb0jABi3629uc5VfIAGtdFornBDoQfFYizx9CP6NnlOrSYpzZxNS+B/NX9l83wDjHPy7PjIw==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=MhTbpO0gfdDguiiHb6Z5FCVqFidtjUjf6yVS93WIQRGiHKlNPMHZci2cj5gQbtfbJwaSyVBSyyNOaH+3tkdxrBmgpMfc8kvCJC6w8rLK3cT3fjTe7Yk1T6fqDPE8wM0e2gj5BaWr3YcdVQygXZ5UIT2XREQYro81rxfG9gXq6bbxVqF2Jj2/EyFIPPgK6KbfOQZES57YrVC1XcsOSgnD67K3Db1RJzH55pyi6hdmNH82ze7uEaWpbz6BxtwfRaDXhW+NzgdwSCQOsBHzeqFtY3Wc420gO3RFcBQnkv213ZcoRJ1plmHgnKArtzTFkVQzXVRH5Mzbd1rUx+DbHz6rRg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KKDrUQa9BaM+lMXLoVNlhnRKJEkgl/jP8gHn4vWax/FZwEswPy/R/8hsS+Pukn/z3Ri36kqJk9Ku/Ozl7kGaajBQdn8edlWp1b7fofApNuMZ3iGhc6S+Lb6M/WH6PpUY3C2pqmG/HrkTjyL8GQGYxB/baE26zyLIF+csqpnYNIigSYb60bDG9OJiS06ncJ7rcn7BCEWwjGbLKD5+TLxIP32X/RW0e8UCCDKsxB6wcBIKdc53lNgT26RdMilwHGBgoC/POfaqWqMtsaVzReMBhCRSdAQS028CMxHRtrTF8d5KjjBEKAF8YX2EEee2AdgKOd1ba/bOhuSTuINCQq4/Bw==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Fri, 15 Nov 2024 14:56:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHbN0xEMVIvN3HbzEuhbXugN/BCZLK4PUmAgAAELwCAAANMAIAAKZWA
- Thread-topic: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP
Hi Andrew,
>>>> +
>>>> +void *_xvrealloc(void *va, size_t size, unsigned int align)
>>>> +{
>>>> + return _xrealloc(va, size, align);
>>>> +}
>>>> +
>>>> +#endif
>>> Does this really compile with the wrappers not being static inline ?
>>>
>>> That aside, could we not do this using conditional aliases, rather than
>>> wrapping the functions? It would certainly be shorter, code wise.
>> Do you mean something like below?
>>
>> #define xvfree xfree
>> #define _xvmalloc _xmalloc
>> […]
>
> I mean __attribute__((__alias__("")))
>
> There are two examples in tree already. See efi_compat_get_info() being
> aliased to efi_get_info()
>
> In this case, in the !HAS_VMAP case, we'd just declare _xmalloc() to
> have an alias called _xvmalloc() too.
>
> This avoids needing to wrap every function in the headers.
I’m getting:
error: ‘xvfree’ aliased to undefined symbol ‘xfree’
looking into the documentation it says:
“It is an error if the alias target is not defined in the same translation unit
as the alias."
So I think I can’t use this one here.
Should I continue to do in the other way? Or using #define?
>
> ~Andrew
|