From patchwork Thu Sep 26 18:38:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 174512 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2438630ill; Thu, 26 Sep 2019 11:40:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtrnMmEqOBUkQVgOC/Y7ZPpwAppYx23ML81s9yq82e0BDKTaWzLwybxtwjvkCv181+Dl7L X-Received: by 2002:a5e:d502:: with SMTP id e2mr4588080iom.279.1569523200663; Thu, 26 Sep 2019 11:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569523200; cv=none; d=google.com; s=arc-20160816; b=f7c3fOUZVPM7S57Hv7PQJFB4cqXUHCX+CSTT4Yn05+IB6fM62y/cowaVy3V1lgO+xf H49+SEhtpjG2afZW5hqOHlZO54SbA69rLi0h7fVWLZsiZgr+I4S0UfZqFLo4i/qxympD X+tpoNast+BXY6SKiVxjqJ0lv2YfIse6d7duJiZhyQOodTu3k4B2qSMDYO8+M8ZeuMJ6 MKD1YoW5CianwaXVa4GopsHVurLKbBMyGv2nfiqBS9ZMC60auDQ4JPV7WcC218mxCCqp IEttVPNTvFAABwkhRk7ImxpF0Nr4g/fx8EhbxRTuCrXzaTZT2AGqnoncuSDeXP6F0e2g 34CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=32L0Z8wYIbL4i89i5/ng56acnJMijNFsQitRLGljrQY=; b=IYWSykXiafCBa7xYkSp8xnE9Iz/VK2LZ07UWBZMp/SMj22AVmSBeTCIaA5mBmT/ifO S+gJU6xkWxhFgUhlL9LVnLblKQ8DnD3xZDvEEOIkI0gUX6AIvk8NncjBJtxfPi27Dto3 QSLHKByf2SiD34xbeiqBowOLrypN4IEXEtw0jBtKTNcHhOAqgnWAuQ2JCUs0lMOYbAU7 HFfefSH/VTTVf/2BWgRULUwYH63ermbPoAfjO5Pv8mZHBNfX6aqe9xm54IcllpgfJvdQ 7M9EkxF1aIG5XoMsomlH4h3a9vdjrsKIbER4bCXydcNWN7fS9JhPPIRxxXGwxEN9pQe2 1ptg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z22si184512ilf.71.2019.09.26.11.40.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Sep 2019 11:40:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDYf3-0002aO-Fx; Thu, 26 Sep 2019 18:38:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDYf3-0002a0-4n for xen-devel@lists.xenproject.org; Thu, 26 Sep 2019 18:38:41 +0000 X-Inumbo-ID: d1bc3ba6-e08c-11e9-965e-12813bfff9fa Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id d1bc3ba6-e08c-11e9-965e-12813bfff9fa; Thu, 26 Sep 2019 18:38:23 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E3DF5142F; Thu, 26 Sep 2019 11:38:22 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 232163F67D; Thu, 26 Sep 2019 11:38:22 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 26 Sep 2019 19:38:07 +0100 Message-Id: <20190926183808.11630-10-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190926183808.11630-1-julien.grall@arm.com> References: <20190926183808.11630-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , andrii.anisov@gmail.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Reviewed-By: Volodymyr Babchuk Reviewed-by: Volodymyr Babchuk --- 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 + /* * 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 + mov x0, sp bl enter_hypervisor_from_guest_noirq msr daifclr, \iflags