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

Re: [PATCH] xen/decompress: make helper symbols static

  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 18 Jan 2021 15:31:32 +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=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D2VXhsAG90u4qgyD9/9294ksVcVVnQcZKwss/FbXJrA=; b=f1daQpijGgFMCGQvMNW9fYZzqA+XzcYDdGlOBFErb8SabAx7btqGgf70EKWX9hcEeM5Z0Wvgc4AvdB/bcExzPoCXFAIfFviSzIiAcP5IkSAz9gSUqHgbZ76TFYdGd/1dCvCud5gXpL4lvlySDWAi3Q9RifJMSE2gan+kxsc1CTgBkQnctP1lKH7vSyFFU9EThZMtV+0xi7W0a23Lv2IK+yP8iow7G0IVhkf9dvDnHXlFmZ682SdVnDX+xvGPaGJtQI/BdD8LC7cJmCy8+D3MjL81OKVM6nSrwHDCeAW66USlwapck4FO4KZ81Rnko8zliMPNV2hwcBYZhvRM1ANl4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kmXYWaonv2+J4rDVFlkjdbvftEzNYGorm0wx9nbSYR2RomBVoEwSZY6/m2C8YdChIZg/SOzBUFdqVUzZsFjJeSWci7XY1P/W5LM5i8E02jsPIakWFI85xy1FpnRET83xR/Ee21YJRSfIYRz10l4ygjyyQAPP/OCnmngarxG4pUNvKWALTbWTMi6UYIksHgz/aXw1LGQUfBqvfLBejLu82uqnqNg0gR6+FkmgL/m33HR93N2srQ8V6sC1auqziThuOmdrMk5Pk1GhQRHiK/UI8RV+Be36EDErfEcv4yiIv5V0zXgpR9bXjiwBhbVLSe6viEW53vzPDkY6Pc9ZOfhwtA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 15:31:50 +0000
  • Ironport-sdr: DIUwqxJdszkEvKs91Svg8x9an/NtD27kckPxGYGZxgxY4Dw8KzAnN/RI+wUG7NavzI6KLSDmeA ENqxorlr39RpaaY9kI+LYjtHfBqF/XdRNv5QVENf4t8YkfMLMo9+2zLe8Js4jpd9UtkCjRuzLA t6+eAbqPrfTZBprddUZoWXC+k5oN8p9jN4vL9I18cVIVk+mIMa28hVohGnv+EEfXuPdhFyT42j dGe/kc8wHcLRUoaZMREeItEwnDik3SemLbHHLUAVr6Xy4E9lUG6+5zGgijD0XCviNomP4Qqx6l uVk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/01/2021 15:13, Jan Beulich wrote:
> On 18.01.2021 12:58, Andrew Cooper wrote:
>> On 18/01/2021 11:19, Jan Beulich wrote:
>>> The individual decompression CUs need to only surface their top level
>>> functions to other code. Arrange for everything else to be static, to
>>> make sure no undue uses of that code exist or will appear without
>>> explicitly noticing. (In some cases this also results in code size
>>> reduction, but since this is all init-only code this probably doesn't
>>> matter very much.)
>>> In the LZO case also take the opportunity and convert u8 where lines
>>> get touched anyway.
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> ---
>>> The downside is that the top level functions will now be non-static
>>> in stubdom builds of libxenguest, but I think that's acceptable.
>> Yeah - not something to lose sleep over.
>> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Thanks, but this actually breaks the stubdom build, which now sees
> non-static function definitions without prior declaration, which
> with -Werror results in the build to fail. There's this extra hunk
> now which addresses this:
> --- unstable.orig/tools/libs/guest/xg_dom_decompress_unsafe.h
> +++ unstable/tools/libs/guest/xg_dom_decompress_unsafe.h
> @@ -1,8 +1,12 @@
> +#ifdef __MINIOS__
> +# include "../../xen/include/xen/decompress.h"
> +#else
>  typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
>                            int (*fill)(void*, unsigned int),
>                            int (*flush)(void*, unsigned int),
>                            unsigned char *outbuf, unsigned int *posp,
>                            void (*error)(const char *x));
> +#endif
>  int xc_dom_decompress_unsafe(
>      decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
> i.e. strictly speaking I may then also need a tools side ack.

My ack still stands.

>> but I really would
>> like to see the STATIC and INIT defines disappear eventually.
> I too would like to, but I don't see this happen in particular
> for INIT and INITDATA, when we have two distinct environments
> where this code gets built. Unless you envision the tool stack /
> stubdom side of the build to gain
> #define __init
> #define __initdata
> ?

I think that's fine.

One way or another, some header file somewhere needs to plumb this up
for the differing environments.  I just don't see the need for an extra
level of indirection.

> As far as STATIC goes, being in the middle of the DomU side
> work of this, I've found a need to sprinkle around quite a
> few of them in zstd/decompress.c, again to silence similar
> compiler diagnostics.

Do you mean you've had to add more STATIC's in?




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