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

Re: [PATCH 08/65] xen: Annotate fnptr targets from acpi_table_parse()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Dec 2021 09:36:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cGc8cUwvGg7L/5Dgxzq27jqpcFYF9MeWp9OU2x0atT4=; b=PymPTwGbo+uLuo/h4zDDuKyVXIT2zBcGyh1+6pxj71UBN/voeA256JaAjtjVJ/RZSEZ06JX5pBYUBD/vddQGaxg7pFn2Kx/Z24XjhFwDlVvB65pMO5MxoWk7j/5vV7/xUqTwE24mizXydIzxCkm5pbutQYL2xWlZdj6Lph5pt0XrC4KQUsjM1xecQubBOnMbF7ccijBShyUQeKZg3R2SO9m0hP2EUYe32qiDEp4DYodEoYcwD2qpwgn78+RrOpM7z1/0Ebv2dVd+AgwguOPNhz35xni3oyqhTMyLtffubYkPkzejTRteO10kLcysQybOXDrfCMQkl5eqgy3HKhkBHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ey9fYSnLpvkHym19sTIg2AyGQlHR3VIwTgT5DPeKlQVDxrBFokbubXxq/l89+Tdt/KGh5gw/uTJdbvFC4zSY3fvw1W4QeTbj8kdghxS3FTpCm6m8IJIdJ1VCrPcfD5/w+Ne/5YhhDTQPYmDex0wLSHBjcMnaTRkFiPWLeRxZt5pOMHGVkSh0OjFsInn9G9OOaND4oZu0n4J/OQ83rEJ7werTQvuHhvwkitKQpzFJMz9qCByjXT9Fklm2rfD4/qjiqlxdANGZ107cE3opXIezqQvO6RaYOwRa6EmAmjD0AxP8N/30140r2RupiEHrEYXXkWTWZ32K5zbYWypexxvdig==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 06 Dec 2021 08:36:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.11.2021 13:33, Andrew Cooper wrote:
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c

Elsewhere in this file we have

        rc = map ?   map_mmio_regions(d, _gfn(pfn), nr_pages, _mfn(pfn))
                 : unmap_mmio_regions(d, _gfn(pfn), nr_pages, _mfn(pfn));

which has been in this shape only as of commit e3b418ac4919
("x86/pvh-dom0: Remove unnecessary function pointer call from
modify_identity_mmio()"). Aren't we relying on the compiler not
transforming this back into the earlier

        rc = (map ? map_mmio_regions : unmap_mmio_regions)
             (d, _gfn(pfn), nr_pages, _mfn(pfn));

? And aren't we further relying on the compiler not transforming direct
calls into indirect ones for other reasons (I recall Microsoft's compiler
being pretty aggressive about this when the same function was called
more than once in close succession, it at least certain past versions)?
Is the widened effect of the annotation intended to also guarantee that
indirect calls will not be produced by the compiler for any reason when
the annotation is absent on a targeted function's declaration?

I've made an attempt at auditing our code for further similar constructs,
and I couldn't spot any. But the pattern isn't easy to grep for without
producing a very large result set, so there's still the chance that I may
have overlooked something.

Jan




 


Rackspace

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