[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] xen/cpupool: Reject attempts to add a domain to CPUPOOLID_NONE
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Wed, 18 May 2022 10:27:13 +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=C/u9bsegGF40ABK22xm6M3A046Sjx9mDSLTJX5HtTVE=; b=I4VR6YA68Jk3I7h3OiWkaF5C3+vpFVaAonNo+vL8Xw7YQUn9TYBHGdDZ0Nz73LAHMt4OT7gaVM7rBpCA3CE6cVdssR3k+yR4SiihNXx7M0wyYeuna40QIhzPic5Uu0S2yW9gsrptiFPIbVXM7lNvSE2zopPdN6jdMtM7TSUAJyUOzRfz/qQdfASoTuSoAgOtv4Pz7Mjpfojagzz8RlBbNpkHKEyEtLZMAXZH+Df662O76iwq7ut2iOMvXAtd+1CboiU+xh0pdRKwnrPigSTk+c0KjCA7UFylkdoC+QDUgSkhn/E2U77RO8mabVt1iC47UsHovc+VAvzegROXve7njg==
- 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=C/u9bsegGF40ABK22xm6M3A046Sjx9mDSLTJX5HtTVE=; b=jY8G4o0cNPX23fvNjSC2CIMfvx3oHOrY3NjflmWTm8ChC/0nwet6NsISW9v46yOQP1Wghe8+HC3mCf/mU+gSw+8PAOngEuDWBDfB2AOnVPunkxNTsSn43JE3gYuKRsVG8AIaCHglhc8U9TFsXKbDTakghp/YwaFnf24wVUb5C+eA8O8VKxXmNyyyWDmxN3kuIr9UrRIaCwqQxWa2nsrn4b707ezXkVCg1eTjPs8ENdaGaxxaKIa1mEuVLpqEQxrRIUiCPVr6gGLNMiEjVjk0uswJ2Y6YtAGTlasqWTQsaay6YcTy2R8CUoWBoo14tVmx3pToVoQ5gDz9KBySzUkn2Q==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jWMslMfbM4UYrt0Nj4VIMwFBHltbbcVUm2MDOKQfLdYbX6Vqzvc2LetGDT9vvAQDZznxCf4fQe1+5CF+IxvnsPt6+u3v6twsrWpEMfXVXAhiCKC4gZSddZb+xOUpvCtSixIDStoahG0WNYWXxj7+OdLNfm+AN2iE6UtPtMPzjSVVDSrDDsWaWjqf6+Hozi+n7Ax59TVyUxF+uBDhKWW6dOBLYvk8eTDtkQFaRobV8lhsN3YAkBzcPRnUokuxHNbI3nxe0gzcHvYZ0gEpPiQJ+yCGru+czOT+XhgfE0Ng1PGGn9aH2Qx4ZLPR+pMgc4vOHOEZxuVks7sSpBuy0tzKqw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DuZR1uozdd4xlgKJbBNwFGQShPhCBzOnZtNmFXy4O+aGRg7/r7luh4b9t+Lj3kiM8TtLwNHcAkztNBqp8T+9aqaAHLSKOAOEccFzw++83Mg6epM/FbcADzrc/W0YFbpm+MKCY/JXBDp/1VryF37Xcf1LVZHUafnKOZ6atkF3WdtCyqYQ31QNTFD85kGOBRgYZAzzvCg54S3JXzcNCzBzP19Ps8EOGvB8a9hZmi3Z8buY4v3o4KIxD6raz3pzMQenuABWDoMfiY+gQ5I3zRw3MaIuZFGbgGhAn89dE/wrrf6ycOnNGADAnRe3KtAM0QjHrZUf2qLas5FTfukJH+DsrQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
- Delivery-date: Wed, 18 May 2022 10:27:27 +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: AQHYaiYsSobfX0tA0kCIIfR0OlvQlq0kb2CA
- Thread-topic: [PATCH 1/2] xen/cpupool: Reject attempts to add a domain to CPUPOOLID_NONE
Hi Andrew,
> On 17 May 2022, at 20:41, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>
> c/s cfc52148444f ("xen/domain: Reduce the quantity of initialisation for
> system domains") removed the path in domain_create() which called
> sched_init_domain() with CPUPOOLID_NONE for system domains.
>
> Arguably, that changeset should have cleaned up this path too.
>
> However, c/s 92ea9c54fc81 ("arm/dom0less: assign dom0less guests to cpupools")
> changed domain_create() from using a hardcoded poolid of 0, to using a value
> passed by the toolstack.
>
> While CPUPOOLID_NONE is an internal constant, userspace can pass -1 for the
> cpupool_id parameter and attempt to construct a real domain using default ops,
> which at a minimum will fail the assertion in dom_scheduler().
>
> Fixes: 92ea9c54fc81 ("arm/dom0less: assign dom0less guests to cpupools")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Thanks for this fix, with the introduction of 92ea9c54fc81 ("arm/dom0less:
assign dom0less guests to cpupools”)
we’ve checked all the path passing struct xen_domctl_createdomain, and at that
time it seems to be that
the new cpupool_id member would have been always zero when created from the
tool stack, am I wrong?
I’m asking so that I will keep in mind for the future.
However with your second patch of this serie, the tool stack is able to write
it, so I guess this fix now is mandatory.
I’ve tested your patch, enabling boot time cpupools, on an arm machine and
booting Xen+Dom0 and another DomU
by dom0less feature, and all works.
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Cheers,
Luca
|