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

Re: [PATCH 1/5] x86/altcall: allow compound types to be passed


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 5 Nov 2021 10:09:05 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636121480; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=rfUbYO0yhwfzz0H0V1T3veDUs7oHHuqMmGxL+oZifDM=; b=SmRphK0CTOzpLxRv5V2itr6LDuYKtrTt9zyuHWaFifb4RWT7nyidC2tUeD+wWbKNkvPZDpmu2DMAjaD3MgYY7f3/ark4b9BoFW0u6znwl0+qc8vhCHCXd+KdiDjKnChp9/AMQvuCEYTvjC0qmOWMGjojFkgxGGGmn2O8XySdTdM=
  • Arc-seal: i=1; a=rsa-sha256; t=1636121480; cv=none; d=zohomail.com; s=zohoarc; b=c2IDRfn5CUF8QQMG3JO5C9O1JZ5yN3ExQaqbLCTCCrWer+YMj1D/FDX0HfvP9LMo6+sZ6PMVnD9ErYniOhYtLh3+uW/Re7A+HQHYEIkhDivlMEy7FGzh9TLxW6ULQfkE9fS7SQDuyc9T7Lt0tiSrteyF5w6NCZKaZ3y+GzScKyA=
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 05 Nov 2021 14:11:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 11/5/21 9:55 AM, Andrew Cooper wrote:
From: Jan Beulich <jbeulich@xxxxxxxx>

Replace the conditional operator in ALT_CALL_ARG(), which was intended
to limit usable types to scalar ones, by a size check. Some restriction
here is necessary to make sure we don't violate the ABI's calling
conventions, but limiting to scalar types was both too restrictive
(disallowing e.g. guest handles) and too permissive (allowing e.g.
__int128_t).

Note that there was some anomaly with that conditional operator anyway:
Something - I don't recall what - made it impossible to omit the middle
operand.

Code-generation-wise this has the effect of removing certain zero- or
sign-extending in some altcall invocations. This ought to be fine as the
ABI doesn't require sub-sizeof(int) values to be extended, except when
passed through an ellipsis. No functions subject to altcall patching has
a variable number of arguments, though.

Requested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>


Reviewed-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

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