From patchwork Thu Oct 31 15:09:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 178198 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2980154ill; Thu, 31 Oct 2019 08:11:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUX3Ie53rNili419C9c8hsPrqMdwIGng3TtUKK7dUdaac6QawkrUrRn7pO8Zl6wTr2bght X-Received: by 2002:a5d:9059:: with SMTP id v25mr5307333ioq.58.1572534677192; Thu, 31 Oct 2019 08:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572534677; cv=none; d=google.com; s=arc-20160816; b=K2FC02xxu4fJ2RW3jD8s8T35Rl8nT/dApYzeNPa4N/qula9SQLmfwr9nMaFPvWt/g1 ZQf6LZJ8QOpFkD89Lw0UploO/0kKsdMqV7agARqsR81hWnWFRLELxTg1EzR0T9CN43D5 7Pe8tFOIzkunrZrDIOpC/YD03KLW2+P00JEJCIQOOoP+Nb6dTV9iolUUXeZ9n2VsXlU/ xWJF48H9GcMqHuniirM59lZjAEBAFLr1dWlhcvGo8tFp77R8Ajm1bmz0zP/SLdb3KmE2 MIeKjZTzi1sEiweKrdHxyb6ChtpDk6jUk2edZNoLUIGtAtPihBfdyis8przWSJgqdFs3 1lSg== 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=fTz0HATC195JmE1Ve91RC73QX4s6IhXdLT+g4B9v6OQ=; b=TsmgEUNQr0KZPUmkmkcxduQCWGGUVZx1CTa31KfyFXVFZDNsszV9EcA5mZtq7bwjbc l74scuQKpPKDXp1YDDXsKRcRMh8QzO+1NL7GZi4b+QXGruWF16DOpr/1WWH6A/j2/jup oRjJoFAiv8IPdOp3nzPE+eB8vVyfcYUmMyj4tXd10RK1OyUj4Rqo4/CKpu63TbJbqD61 6pi//+l2jbSvyAsuZs8IDRVkUsRjU5a0IR48I8iptCYV//2UWexjKEXF32JZC9QTypy4 BWznGIVYDe6LifcatWs+3xmf/UNlgHzT0u96jQnOLoWwGgwxefGL8g3sbHD+ujTapd2u m+4Q== 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 j19si7377660ioo.134.2019.10.31.08.11.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2019 08:11:17 -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 1iQC58-0006Xc-Jo; Thu, 31 Oct 2019 15:09:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC57-0006Wv-Bt for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 15:09:49 +0000 X-Inumbo-ID: 77ea8f2c-fbf0-11e9-bbab-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 77ea8f2c-fbf0-11e9-bbab-bc764e2007e4; Thu, 31 Oct 2019 15:09:43 +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 4E3F74F5; Thu, 31 Oct 2019 08:09:43 -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 6682C3F71E; Thu, 31 Oct 2019 08:09:42 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Oct 2019 15:09:11 +0000 Message-Id: <20191031150922.22938-9-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 08/19] xen/arm64: entry: Check if an SError is pending when receiving a vSError 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" At the moment, when we receive an SError exception from the guest, we don't check if there are any other pending. For hardening the code, we should ensure any pending SError are accounted to the guest before executing any code with SError unmasked. The recently introduced macro 'guest_vector' could used to generate the two vectors and therefore take advantage of any change required in the future. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v3: - Add Stefano's reviewed-by Changes in v2: - Title: s/head/entry/ - Use the new short-hands --- xen/arch/arm/arm64/entry.S | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S index 2867c499da..d94c13e7bf 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -381,11 +381,7 @@ guest_fiq_invalid: invalid BAD_FIQ guest_error: - entry hyp=0, compat=0 - msr daifclr, #IFLAGS__AI_ - mov x0, sp - bl do_trap_guest_serror - exit hyp=0, compat=0 + guest_vector compat=0, iflags=IFLAGS__AI_, trap=guest_serror guest_sync_compat: guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_sync @@ -398,11 +394,7 @@ guest_fiq_invalid_compat: invalid BAD_FIQ guest_error_compat: - entry hyp=0, compat=1 - msr daifclr, #IFLAGS__AI_ - mov x0, sp - bl do_trap_guest_serror - exit hyp=0, compat=1 + guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_serror ENTRY(return_to_new_vcpu32) exit hyp=0, compat=1