From patchwork Thu Oct 31 15:09:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 178192 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2980221ill; Thu, 31 Oct 2019 08:11:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfZfy9qBLqHyRjKEEkuExNg06UaQow+POJgyFi9KClbqQooBlX7MDd2sG3abSGmpkDtiW+ X-Received: by 2002:a5d:9808:: with SMTP id a8mr884724iol.2.1572534679595; Thu, 31 Oct 2019 08:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572534679; cv=none; d=google.com; s=arc-20160816; b=ujHCkOIvyXGKUZxDBR3RLz+22dOz9vqCLIF8yVhB+eqpfGlCGItF3MbD3ZQR46Lf4w xUbXHIzucPJS1+NATOs/rFxAE9qIrvUXDsOyUZgj24nu7g+bGFit3IYYSS5uj4gNRiNA VX+ZeVigJP2lhEsS2l3waXDAxq5kKLi2SjBbWxXgOWJjdW0daHKhcoccmuOOkOSM8llS Nct5Jqv3ziTAF1guEV3lPhrsmC0PSSYzPHawtLtSSidESwwL4UKuoz4M4ucnrHAkK7Zs wBqH1E5DlSzlqMvDrdXz5+vsFvgNj0/AOkdQAzEsCnpzKbk072ccxlKLKb/WkL4LfScB FRlQ== 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=c77n/GLT3qijT32dYnb/keZw9W73/TWl6JRwr0iQBAM=; b=qjm1Ml3ZP303ocMLja9adwyTdsh4sydO8c1rJ+xbHZ0cMErG6tmP2fpVmXuVdsRekD oYd1CO5wy6LBrSyd3BHBnelsiFwOQew2SZPHX7+KlzZnyW911NjGeGKnQs9q8GCGFV1i ZH13+6TsO4ntICyhv/d91QTZnMyS7WjuBy25MvYFVFZmVZkvuez/tCu6UH9V5+P0qaui Wwiv9EbEU6M6YRtJRh5FZNz5hRipxuAxsuLYJzzXoe6k6VvI6O3W5SnSOQQKIOUMNfu1 43a/gfP4r4nLcyEdwP04D7JD2bCxI9TXISV1XfhKhbD+VLRiCV9TSbyE2aOAFECCaUQC ImmQ== 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 b15si7264372ilh.56.2019.10.31.08.11.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2019 08:11:19 -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 1iQC5D-0006bI-9c; Thu, 31 Oct 2019 15:09:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC5C-0006ai-Bp for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 15:09:54 +0000 X-Inumbo-ID: 795405f0-fbf0-11e9-bbab-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 795405f0-fbf0-11e9-bbab-bc764e2007e4; Thu, 31 Oct 2019 15:09:45 +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 8CD3A7A7; Thu, 31 Oct 2019 08:09:45 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (unknown [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A11F73F71E; Thu, 31 Oct 2019 08:09:44 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Oct 2019 15:09:13 +0000 Message-Id: <20191031150922.22938-11-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191031150922.22938-1-julien.grall@arm.com> References: <20191031150922.22938-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.13 v4 10/19] xen/arm32: entry: Rename save_guest_regs() 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: jgross@suse.com, Volodymyr Babchuk , Julien Grall , Stefano Stabellini , Julien Grall MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The function save_guest_regs() is doing more than saving guest registers. It also restore the vectors table and consume any pending SErrors generated by the guest. So rename the function to arch_enter_hypervisor_from_guest_preirq(). Take the opportunity to use ENDPROC() for the benefits of static analizer and the reader. Signed-off-by: Julien Grall --- The name of the label is quite long but this was the best I came up. Other suggestions made were guest_vector() and guest_entry(). I think guest_vector() is a no-go because we are only implementing part of the vector. Regarding guest_entry(), this is debatable because from the guest PoV, you exit it so it can be misleading. I actually got confused more than one time. Another possibility would be enter_from_guest(), but this is fairly close to enter_hypervisor_from_guest(). The code would look like: bl enter_from_guest csie ... bl enter_hypervisor_from_guest Any other suggestion for the name? Changes in v3: - Patch added --- xen/arch/arm/arm32/entry.S | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index 5abff24e91..cea4e0e302 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -24,7 +24,11 @@ #define RESTORE_BANKED(mode) \ RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode) -save_guest_regs: +/* + * Actions that needs to be done after entering the hypervisor from the + * guest and before the interrupts are unmasked. + */ +arch_enter_hypervisor_from_guest_preirq: #ifdef CONFIG_ARM32_HARDEN_BRANCH_PREDICTOR /* * Restore vectors table to the default as it may have been @@ -115,6 +119,7 @@ abort_guest_exit_end: skip_check: mov pc, lr +ENDPROC(arch_enter_hypervisor_from_guest_preirq) /* * Macro to define a trap entry. @@ -173,7 +178,7 @@ skip_check: 1: /* Trap from the guest */ - bl save_guest_regs + bl arch_enter_hypervisor_from_guest_preirq .if \guest_iflags != n cpsie \guest_iflags .endif @@ -363,7 +368,7 @@ return_to_hypervisor: * HVBAR very late. * * Default vectors table will be restored on exit (see - * save_guest_regs). + * arch_enter_hypervisor_from_guest_preirq). */ mov r9, #0 /* vector tables = NULL */ /*