From patchwork Thu Sep 26 18:38:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 174506 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2438511ill; Thu, 26 Sep 2019 11:39:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzajZow1ePK1Z1ZcFby0sfB7rkiE3f2aUSdfFwLkNTCpaZ68TYZogDJX9xq549mONRibSZ X-Received: by 2002:a5d:8851:: with SMTP id t17mr4669285ios.250.1569523195303; Thu, 26 Sep 2019 11:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569523195; cv=none; d=google.com; s=arc-20160816; b=MoamT5QktyDvhB7FkunaiRxTmJp2v2tBKrMNyXuCWQyl72y2pSdctBx85reIJ7Ih9Z 4hZSE3ltP+/L8fg/wUAGlLazOXabcaJW+zpuBW+BIZcRrV/TQsEZuFb48Hq11xL4t/d+ pUAjI9cjL3fZxqoh9gKWWgfFY7tu2cm0MNeqN44baS/yf6444QUz0C0Fvrbrl8xn05+d Ot2Zi68w7+60IRcApviKg7nqQeRcOsuwMmeLH1Ch+GAPj7SLR6LZ0A/EtoOcyF6cD3lh FvZ9bl4wai5/CTWW4gX/DLenuYdg37V3+urZFsAyaLfuMoEYxEmnjk6h278cszPG9sO4 Uvrw== 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=12Gpp2LuYCSKfYI8cf4cC7TmJMqRitLQTVo4r62EI8Q=; b=xMvNHieXQjimmvfT5NoXNwMLkrSSN+l2PaLPPo+wtgr9/0n1JTNW9S08iNTJbVEzQc nFrN4cwZ7kc8X67a/Lu4m25phlTNFHJwvtfGSEtglh+YDlcY35qQlJWgfJ3B8mCJoypx nFjUEzuKmYIYkPU/AYl5M82Hg9G2jROUFgyIy0bcWYX9W0mr8smdf7z+yDMugnc6MXGe 2CwDmkusFQKiXRzwDN87iMkO9vbf6jV7nvs2zvwTkB3Ytk4cCzffCdiO8Q5NcrMXJgRt EBm4lX/oBmJVl7nJ/pgwMvhEHPcxikj1BiTWzrh2yu3f13VSFH7Xe9kOw7nlPw42pLGV kPWQ== 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 n6si149440ile.150.2019.09.26.11.39.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Sep 2019 11:39:55 -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 1iDYek-0002OS-Gz; Thu, 26 Sep 2019 18:38:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDYei-0002OC-Qo for xen-devel@lists.xenproject.org; Thu, 26 Sep 2019 18:38:20 +0000 X-Inumbo-ID: cd4a7fb0-e08c-11e9-97fb-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id cd4a7fb0-e08c-11e9-97fb-bc764e2007e4; Thu, 26 Sep 2019 18:38:15 +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 50DD81596; Thu, 26 Sep 2019 11:38:15 -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 8487C3F67D; Thu, 26 Sep 2019 11:38:14 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 26 Sep 2019 19:38:00 +0100 Message-Id: <20190926183808.11630-3-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 02/10] xen/arm64: head: 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: 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" 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: Volodymyr Babchuk Reviewed-by: Stefano Stabellini --- 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 8665d2844a..40d9f3ec8c 100644 --- a/xen/arch/arm/arm64/entry.S +++ b/xen/arch/arm/arm64/entry.S @@ -324,11 +324,7 @@ guest_fiq_invalid: invalid BAD_FIQ guest_error: - entry hyp=0, compat=0 - msr daifclr, #6 - mov x0, sp - bl do_trap_guest_serror - exit hyp=0, compat=0 + guest_vector compat=0, iflags=6, trap=guest_serror guest_sync_compat: guest_vector compat=1, iflags=6, trap=guest_sync @@ -341,11 +337,7 @@ guest_fiq_invalid_compat: invalid BAD_FIQ guest_error_compat: - entry hyp=0, compat=1 - msr daifclr, #6 - mov x0, sp - bl do_trap_guest_serror - exit hyp=0, compat=1 + guest_vector compat=1, iflags=6, trap=guest_serror ENTRY(return_to_new_vcpu32) exit hyp=0, compat=1