Received: by 10.223.164.221 with SMTP id h29csp706940wrb; Wed, 1 Nov 2017 04:12:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QtAnRukli9QzGwjniloaKuqULXMx+YhjaVW8dONpdeMwsowlIkH3uZkF9NFdxtGslQa3LN X-Received: by 10.101.90.133 with SMTP id c5mr5765324pgt.441.1509534772345; Wed, 01 Nov 2017 04:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509534772; cv=none; d=google.com; s=arc-20160816; b=lcquIZL5vl7e2XsQmIpHsgDWbVPp2YXRIdWwfGDGV05cd4Gaur24b0bgY4MzYemJN6 BfawI6p92klYwfXjqzK+sikBqLb8cUH2hEWkJa61cGCYnpRftcJQbYP7qSeb1eDG6als U5d219Apqp4kHr55yqSc06PCkaz45YbIEdnIoBzRbMtfryQcEI61snBmuCcfXJwwi6o3 GFleuLMB34V2lahGuLRPpWW1dHga3XVlQ6XcarPOEBCu8ySfl7xtNz/2AS0LhQlTWivx T/caEjsA8tUWZ17MpGBNdEhoIJMw7Cfj2TYc1PonH2Mb9fudGnZMxSQpoPj5RXNqZJjc A3Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:arc-authentication-results; bh=ep3Hb0/4q7fLbieFwHxuY0SeWlNdYpKTRjASPVeLHxM=; b=dVD1CeF7kEy2MO/01GzKta4OhUOdVJZo5ovnTTQCDDmAXCOHi4ahL0f+Tk45PiOiWA Nmty0d9602M0BYvTLUtftUs6D7nnhoeh0Iui7P96Lh4A+AGrpPKVRg+/hCBPlqtI2KIF 9BlMn28I/Gf00d1fSTC+BlDgEyJBCOm0qiZFhZVPVKkKzJXj0YMdou1oZNf9eBijIYNC 7MpBDUpKHfdKPlWdpOH5UvbboQlgPe58E8JMwsJR/YinllPYPKP8CfzBw5DGAPF21q2k 8GSNI6s8TphryMlWT9m8dfkBIMzDACnUhXv2szQpm6ZSWkme+nU73nKCgEOU9fmLXQIE ugnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si655280pfd.118.2017.11.01.04.12.39; Wed, 01 Nov 2017 04:12:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbdKALKZ (ORCPT + 99 others); Wed, 1 Nov 2017 07:10:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9930 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754490AbdKALKU (ORCPT ); Wed, 1 Nov 2017 07:10:20 -0400 Received: from 172.30.72.59 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKC78228; Wed, 01 Nov 2017 19:09:16 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Wed, 1 Nov 2017 19:08:59 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , Subject: [PATCH v1 3/3] KVM: arm64: add ESB in exception handler entry and exit. Date: Thu, 2 Nov 2017 03:14:57 +0800 Message-ID: <1509563697-6359-4-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509563697-6359-1-git-send-email-gengdongjiu@huawei.com> References: <1509563697-6359-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59F9AB5D.0035,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a3cd88a192f2d09ada2178fcb9119a01 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some hardware platform can support RAS Extension instead of support IESB, so software need to insert Synchronization Barrier operations at exception handler entry and exit. In the __guest_exit(), it added a ESB instruction, but can not cover the path which is not guest exit. For example, if EL1 host call HVC instruction enter to hypervisor, it will not call __guest_exit(). In the kvm_arm_vhe_guest_enter(), it synchronised any host RAS errors for VHE mode, but it can not handle the non-VHE mode. For example, if EL1 host is pending a SError, the error can be propagated to guest without error synchronization operation. Only add the ESB in the important exception handler path to reduce the impact on performance. Signed-off-by: Dongjiu Geng --- arch/arm64/kvm/hyp/entry.S | 2 ++ arch/arm64/kvm/hyp/hyp-entry.S | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S index 96caa53..fce6806 100644 --- a/arch/arm64/kvm/hyp/entry.S +++ b/arch/arm64/kvm/hyp/entry.S @@ -84,6 +84,8 @@ ENTRY(__guest_enter) // Restore guest reg x18 ldr x18, [x18, #CPU_XREG_OFFSET(18)] + // synchronize host pending asynchronous error + error_synchronize // Do not touch any register after this! eret ENDPROC(__guest_enter) diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S index 5170ce1..ac85029 100644 --- a/arch/arm64/kvm/hyp/hyp-entry.S +++ b/arch/arm64/kvm/hyp/hyp-entry.S @@ -54,6 +54,7 @@ ENTRY(__vhe_hyp_call) ENDPROC(__vhe_hyp_call) el1_sync: // Guest trapped into EL2 + error_synchronize stp x0, x1, [sp, #-16]! alternative_if_not ARM64_HAS_VIRT_HOST_EXTN -- 1.9.1 From 1583302747053326296@xxx Mon Nov 06 07:59:24 +0000 2017 X-GM-THRID: 1583298837747810129 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread