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

RE: [PATCH-for-4.17] xen: fix generated code for calling hypercall handlers


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 3 Nov 2022 16:50:16 +0000
  • Accept-language: zh-CN, 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=vS9rGZjA096Wtu2NF9SeKTN/1BqZDtC152/38ubEOJQ=; b=hWb8AAsZnUiYRUpFvw36wj9lOZ+KzK1PAcEpN622rchKFyQ2KRcm2EZPBlDn5FMviGN1tkRRGe/EK+pav06dkqc5WEVR+QIGxjqCd+Lxe1w6OH7NksLV8KbNgrifNM3ZYqjpos3Z9KL2sh8FwGljqhbBsaEmc1nsdAiTwH2FF7b0JIytQCdi78UL74wTFg41FB7iY+EYoM2le7Q/MvUi0vJx7r+t5jHnEryU/0vCkJF12q6G30kFGlin0q1SqWG2kB4vs9bHVpO1QvQ/g4fIfiibZMmRnd5/p3uQVkRbIAdiKgb4rYJb18nF9XvhwP7c3GYIX3jt3xFkYf0HrHLduw==
  • 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=vS9rGZjA096Wtu2NF9SeKTN/1BqZDtC152/38ubEOJQ=; b=llCgle65p4XTwqOCSnINQ9CMDN/slFoQVI+nv3kO5IjuUI3TmJ169SbiFZRWwJZhH0ISHsA10jXC7Ht2L3R2WuHspzBY7HAqwS+LIkpSferwMb5P3hSkb2XiOAHV3D0ZeikV9bRO/EA4+LJeQOgZZuwFrjiH2m5nS5qthtboriZHW2LCl3EvpJ/c4gLMjhNCb7XFTBju177tOjJtH5/bnKHr6XM1gDb36szzjSmk5lTKEOlQfTgHadDmoJ3kcVKmPch61k9BYfBopAwJfOsiqVLV+P5U0/Xx0LMHGgqrxcxcX7C5tmwlx1+Pnv+CY8pvmXx5GOkQ6jk692okPL0DVg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BOhWv29djl2GBgLYIWiBcREszHUCEGInsOxcMWkOOOxBouWllYyr7foWZmaIaP3uyy3BO8yCDqs9Q1cdVIemFtWLKbR2+zSqoTHVQcho1k2LuE2wyFMSH2YeLY3OM94TgeTJJ1zdyC12RyIvZ8+C575Hkm0elAISsOhwrc2YMlqBnwZoLW2/Hh5MOtgsN3qJRpBbrgun5wTMYLh+aerF8GIbIPIG59dThfMS4NXVtRA/VFWmohIdczDlrq7RbEZz0JPYhLEhGgPHloljEQET7F0bsw/Oqr3OL8MJMcQSEjaZ05kUiWJ3Q1NpYUs4XyevVYgiV87an3qGyhEyFq9nTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L2EXT93chYEM5IywsclRGTj7+SdptJVjRIO+GGkHpne08O9soQd0o20UEUo4bpFC4yZAe7lIPho+3NUvExQcqHCcDX7t5N6wNEGXWT7MoB7hi0nW2KSZAHOjgdaPclF2gQoJWo1Vi1Go37ZxrDkpi0ZzrOX3hcV6JqTcLUH/hUv4hheziKCPkLqV+tVI4jId+nAciYqk/jgC5vKJMayBVFNTgTzMcYngtlSJZlwqzRG7kUaMA0hzB6amaFdizN9DcRUza8bVkARBqr2I5DE1RKpWIwQLDojGMpV5A3o8UoiP1oGZwombzV2j2r8fAEdsJakX0dpmBRORB4Q0HTp3hw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 03 Nov 2022 16:50:40 +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: AQHY76J0n3XAu9trAECn0VzPTwDhaq4taCGAgAAA7RA=
  • Thread-topic: [PATCH-for-4.17] xen: fix generated code for calling hypercall handlers

Hi Juergen and Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH-for-4.17] xen: fix generated code for calling hypercall
> handlers
> 
> On 03.11.2022 17:36, Juergen Gross wrote:
> > The code generated for the call_handlers_*() macros needs to avoid
> > undefined behavior when multiple handlers share the same priority.
> > The issue is the hypercall number being unverified fed into the macros
> > and then used to set a mask via "mask = 1ULL << <hypercall-number>".
> >
> > Avoid a shift amount of more than 63 by setting mask to zero in case
> > the hypercall number is too large.
> >
> > Fixes: eca1f00d0227 ("xen: generate hypercall interface related code")
> > Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

With...

> albeit preferably with ...
> 
> > --- a/xen/scripts/gen_hypercall.awk
> > +++ b/xen/scripts/gen_hypercall.awk
> > @@ -263,7 +263,7 @@ END {
> >          printf("#define call_handlers_%s(num, ret, a1, a2, a3, a4, a5) 
> > \\\n",
> ca);
> >          printf("({ \\\n");
> >          if (need_mask)
> > -            printf("    uint64_t mask = 1ULL << num; \\\n");
> > +            printf("    uint64_t mask = (num > 63) ? 0 : 1ULL << num; 
> > \\\n");
> 
> ... "num" also properly parenthesized (this is part of a macro definition
> in the output after all). Easy enough to take care of while committing.

...Jan's comment fixed (or agreement to let the committer fix on commit).

Kind regards,
Henry

> 
> Jan

 


Rackspace

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