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

Re: [Xen-devel] [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 27 Sep 2019 12:11:10 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; 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-SenderADCheck; bh=tE6l+xvr8bhJHy+hwLIl73fF9zVFiRDjNS6SIm9sEIY=; b=U/4jh0fer3fV9JRkJw/thQGn+Mgpw3TDYQlCaGvOXT57gRwzvts3Ucv6cBz5BQBB1nawW8HxIdFL+cOBorO4mdx5OM5hXjpyxVamaNBdCU2JVLrvuq3s4R24VHOjTNKKAFS02RR/wbx6yqGJCw5VQIehqSuHCfuZWaSaYgCcAPGsCicM2K2zVP/qIAhmMM23W+kMpSe1/3MY45KLUJQota/SAXGHNiQapsoVx3mGUJP3gBplsXN+w8gVnjFTbVGujvtHnMNMOL0WlR7wCt4vE/ZhW/32MT5Ks/cgyBU3cvc9zyRngVD3y8NtbrebN/ixqzeL6hF7HEPsqDsTo4AyMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RlVYFeRIPUgZO5rv1Mm4PKfjzgbSEvrQ3J9XLaG4fZuVnE6RuB5eRBBGvvR7jJXyMY0o1e+pSXpURJLOEEkfgI/BcKcyPd9lGHycBsHx5reKfeftRJRy4Xktr7kZ3Bk6wgDlT1QhiHHF9rmCthPpEk0Z9gS8N1MS3CFFH2Qby5ci/BnMZxZfRSPANkeJmMV8ZTcuULBhtgnjpSU2r1zQwcqrp5JS1Gv+9CY3PmIzXZ9O5YUYUAoWyZNG1pD20jFXXAf/GkTW66CBqc2gI0FKMFdpgZ0WJ2bj/iCKpVzgVPYHlGhR12uEjXz1MdIXDT1ZYACUs1TFzX/JetEHXZtX8A==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "andrii.anisov@xxxxxxxxx" <andrii.anisov@xxxxxxxxx>
  • Delivery-date: Fri, 27 Sep 2019 12:11:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVdJmUKBPyDG2egUGHFlJ2qkDBrKc/cBeA
  • Thread-topic: [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if


Julien Grall writes:

> Using alternative_if makes the code a bit more streamlined.
>
> Take the opportunity to use the new auto-nop infrastructure to avoid
> counting the number of nop in the else part for arch/arm/arm64/entry.S
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
>
> ---
>     This is pretty much a matter of taste, but at least for arm64 this
>     allows us to use the auto-nop infrastructure. So the arm32 is more
>     to keep inline with arm64.
> ---
>  xen/arch/arm/arm32/entry.S | 9 ++++++---
>  xen/arch/arm/arm64/entry.S | 8 +++++---
>  2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
> index 0b4cd19abd..1428cd3583 100644
> --- a/xen/arch/arm/arm32/entry.S
> +++ b/xen/arch/arm/arm32/entry.S
> @@ -65,9 +65,12 @@ save_guest_regs:
>           * If the SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT has been set in the cpu
>           * feature, the checking of pending SErrors will be skipped.
>           */
> -        ALTERNATIVE("nop",
> -                    "b skip_check",
> -                    SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT)
> +        alternative_if SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
> +        nop
> +        alternative_else
> +        b   skip_check
> +        alternative_endif
> +
for the arm32 code you can have my r-b:
Reviewed-By: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

>          /*
>           * Start to check pending virtual abort in the gap of Guest -> HYP
>           * world switch.
> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
> index 458d12f188..91cf6ee6f4 100644
> --- a/xen/arch/arm/arm64/entry.S
> +++ b/xen/arch/arm/arm64/entry.S
> @@ -170,9 +170,11 @@
>           * is not set. If a vSError took place, the initial exception will be
>           * skipped. Exit ASAP
>           */
> -        ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
> -                    "nop; nop",
> -                    SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT)
> +        alternative_if SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
> +        bl      check_pending_vserror
> +        cbnz    x0, 1f
> +        alternative_else_nop_endif
> +
You asked other people to do not introduce new code in one patch and
rewrite it in the following patch. But there you are doing exactly the
same. I believe, it is possible to move all "alternative" patches to the
very beginning of the patch series and only then introduce macro
guest_vector.

>          mov     x0, sp
>          bl      enter_hypervisor_from_guest_noirq
>          msr     daifclr, \iflags


--
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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