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

Re: [PATCH v4] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 18 Oct 2022 15:07:42 +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=armh.onmicrosoft.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=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=h8h5zhdoolhHEZDPCk4VVAhcd7l812chy8Q6UHj2YS4=; b=cDFMhaDJf1okfq+2kyMa4QRbnZkafbONDGFGg0pBIj/e4M/307HHQzv7mlpDV1wqIp9KAoarCt/kBeNl4hBYl2A3Y/uzCTvc4Kzp0F1eYyy8lUiNyvLzvMgpY5F7/4p0kieho5C77X0Y/6UVEeNT40JwjOgSWncOE//Z2Hb+heQeOemK/ToKvqo7wNh/DquREnz2tZcuOOnuH5vv/GB5yYvfqrbLOa3umizUXmFP4OHQxY8lxuoHJIYiZkkPHVTUP6od59qSVfX47bsyGV5zDYS08YWITEEqVopFvOrOz0279QYI4K/BkENqWxTdcn9FcQZcRbfpGyGo2eJneTMGUw==
  • 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=h8h5zhdoolhHEZDPCk4VVAhcd7l812chy8Q6UHj2YS4=; b=NeGCKaAl5pYhnST3g2Xv2hoTma/2vh6HWV7ZlaBgBL43Ly3Wo/iuhXLXOKJx1tSxzOnChfFDzhIg6gbXeQa+rFI083xFSlWkK/f6NmqXyOK/nZh9UM5L2Ipy4N3VsmWMMAV0HArVwtVe6yT18wyTEI+OeyanF+CMV+Q+XvGbklRcyNKu2CkY+7wfOV+MZp0sNBCEJWPS9JpD4/Ga+PIVIF1vchq+niKn4Fg4wrT6+W3INlR41f4CYUM10EnahxrGoQR+k+BNNmqLaJF1EIMpZwCKSneN4SWt0Rxui17E1EpBbf4eIM/LQabiwNx1F1U8lUroyPEF11qkZWbhZlnRaw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=m05hvVSrnetaqlSbheSuJesKOn84OawYLkEFdQrWyDC8NQwDQPnmlfdWWUcKuNrxeg/NbLUc5ZoyOZuCbM31r1Dh0v1nWfrubj0wKCvpfMWjhIBsFQyrNeBMl0v/+xNT8vtu4QW5dQutUCg+cMZ8Hlya8ZQhfN6KFMUpF3U/0IkthtlxO5wzQXp7PrDkLszJE/jgpJCGxthtdyvI6Zu+AiV8gpI07O25ovJrjUmW2ehyBo6R6tyJOKK6pBQNUZ/d2J6cwqIHkeaWpUMPX3+BdfcG86CxMstNRLnmhwr6AYHMZpVoQ1dhSjFkB5lBmYW5/Werz0JwcJ7TS5JJD8ksoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jWm4hwSTweo9UMAKcHt/tIKGsHFx2KESIAPFCW9M4rfBjk6UM2EdJC3fZVE7ObBjDHoqWIfFUbxtBsQNkUcUAriNcxlppiBuXU277OFdrd08sJMeyuwE/zGQbZZb5bA6HmlQRSL47sGY5kzsYQNz3xJfP8lNYjgwh4GeExzfImMNnXuXd6VddbxtfiBhGK3waA02SVkcCmslTlCZXsy/B1ihRl855eKuSa72ZBkticJxkkezw4JJIH+6h78L7Vrf1xA5E057o1IYd3c2+bAnC0UGb9ADF+MrEvBINd1Lb81e+Hj3Ec1vk/VWaf0YxD2UAkkyYDLx21Eeq0PeI6WmPA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Henry Wang <Henry.Wang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 18 Oct 2022 15:08:08 +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: AQHY4kjE5QulsJtPN02L0AHtsxk0ra4S8tkAgAFPUgA=
  • Thread-topic: [PATCH v4] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()

Hi Andrew,

> On 17 Oct 2022, at 20:07, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> wrote:
> 
> On 17/10/2022 17:51, Henry Wang wrote:
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index f17500ddf3..0b4e24218e 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -1784,6 +1800,8 @@ int p2m_init(struct domain *d)
>>         !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
>> 
>>     rc = p2m_alloc_table(d);
>> +    if ( rc != 0 )
>> +        return rc;
> 
> This error path now leaks the VMID.
> 
> And to preempt the obvious change, if you simply move this lower, you'll
> introduce a path where p2m_teardown() falls over a NULL pointer.

Could you explain me the in which case we would end up with a NULL pointer ?
If the list is empty we bail out so I do not see how this could happen.

Cheers
Bertrand

> 
> ~Andrew




 


Rackspace

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