[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 16/17] xen/arm: vpci: permit access to guest vpci space
- To: Jan Beulich <jbeulich@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- Date: Tue, 24 Oct 2023 15:44:26 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=nkPEFbLCCb2u6fSIy2cDaLpf2HhiawQtoWBdFTj1h+Y=; b=h9zfOVn4RvQptK8DArZ+utZscg9kfb1nZ6oFR4ZXijHztKUrlG22pSPs7Uko+mFgAnGBNWOTKn8XsT4GtWC88qMtgmItKUB1jBDtz7Bw3EcDYg+CD5gygqVEy3DxsVg487AQQC0gktKLVl2UpmUW7M7ABca1CxNHFhNSa4+pS+v/iFC7Hh+F3dPNBdbPYyCwv6tScQReXtJ1hBjJs9dnR9uxJ2ovmGuWIOco14oYUFfvMOCQiXZBh8B+BEtPfy1SEYY8hsxKg9PNHDy0w5/QYnuFobdHl6t9DsMopvjwhB54fFglQIUdEFlsZKiemSWaMiEr46MHuJ/boooI5gHVQQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bsqPCxP5UZXvLV0aN+Tues5wqGR65hEcco90RxANJImF8p/W84KW6uINfkCMxXh0fMx1ppYnDIsC5x44pE7WUoHsCqCfGno0ZBxlS5CWLZ8+75eBEy02BPlzpVYd5XTlctLbAyOT257ryUzj+qjcXV7izh7lzwm5zPM22H6nOBpjv515HCLFbGxXYmyFWzMPKmxBFMzHL5OyGjsuIsYU+ec+NdnsUah/GgIAmcJ4DHAgufbH01rodE/4tv90a4XJFK8hppoeJjC8OEL7Sxlw5j+tE6xGZGFW46SLshRc9q52dzX+B98XOoJZnAOA1QDsrWT1Gijay9/xLoQb43KYOQ==
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 24 Oct 2023 19:44:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10/16/23 07:00, Jan Beulich wrote:
> On 13.10.2023 00:09, Volodymyr Babchuk wrote:
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -695,6 +695,9 @@ struct domain *domain_create(domid_t domid,
>> radix_tree_init(&d->pirq_tree);
>> }
>>
>> + if ( !is_idle_domain(d) )
>> + d->iomem_caps = rangeset_new(d, "I/O Memory",
>> RANGESETF_prettyprint_hex);
>> +
>> if ( (err = arch_domain_create(d, config, flags)) != 0 )
>> goto fail;
>> init_status |= INIT_arch;
>> @@ -704,7 +707,6 @@ struct domain *domain_create(domid_t domid,
>> watchdog_domain_init(d);
>> init_status |= INIT_watchdog;
>>
>> - d->iomem_caps = rangeset_new(d, "I/O Memory",
>> RANGESETF_prettyprint_hex);
>> d->irq_caps = rangeset_new(d, "Interrupts", 0);
>> if ( !d->iomem_caps || !d->irq_caps )
>> goto fail;
>
> It's not really logical to move one, not both. Plus you didn't move the
> error check, so if the earlier initialization is really needed, you set
> things up for a NULL deref.
>
> Jan
Good catch, I'll move both along with the error check (and I'll coordinate the
update with Volodymyr). Thanks.
|