Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755227AbdC1Qp2 (ORCPT ); Tue, 28 Mar 2017 12:45:28 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43468 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752729AbdC1QpY (ORCPT ); Tue, 28 Mar 2017 12:45:24 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 663DB601EA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org Subject: Re: [PATCH V13 10/10] arm/arm64: KVM: add guest SEA support To: gengdongjiu , christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, nkaje@codeaurora.org, zjzhang@codeaurora.org, mark.rutland@arm.com, james.morse@arm.com, akpm@linux-foundation.org, eun.taik.lee@samsung.com, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com, rruigrok@codeaurora.org, paul.gortmaker@windriver.com, tn@semihalf.com, fu.wei@linaro.org, rostedt@goodmis.org, bristot@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org, Suzuki.Poulose@arm.com, punit.agrawal@arm.com, astone@redhat.com, harba@codeaurora.org, hanjun.guo@linaro.org, john.garry@huawei.com, shiju.jose@huawei.com, joe@perches.com, wuquanming@huawei.com, huangshaoyu@huawei.com References: <1490136425-4324-1-git-send-email-tbaicar@codeaurora.org> <1490136425-4324-11-git-send-email-tbaicar@codeaurora.org> <5c7f6092-9358-08ac-5341-2364637c2008@huawei.com> From: "Baicar, Tyler" Message-ID: <35db9a6e-7ae3-3326-db1c-5cfff9ea27f3@codeaurora.org> Date: Tue, 28 Mar 2017 10:44:48 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5c7f6092-9358-08ac-5341-2364637c2008@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1762 Lines: 50 Hello, On 3/28/2017 3:53 AM, gengdongjiu wrote: > Hi, > > On 2017/3/22 6:47, Tyler Baicar wrote: >> + fault_ipa = kvm_vcpu_get_fault_ipa(vcpu); >> + >> + /* The host kernel will handle the synchronous external abort. There >> + * is no need to pass the error into the guest. >> + */ >> + if (is_abort_synchronous(fault_status)) >> + sea_status = handle_guest_sea((unsigned long)fault_ipa, >> + kvm_vcpu_get_hsr(vcpu)); >> >> is_iabt = kvm_vcpu_trap_is_iabt(vcpu); >> - if (unlikely(!is_iabt && kvm_vcpu_dabt_isextabt(vcpu))) { >> + if (unlikely(!is_iabt && kvm_vcpu_dabt_isextabt(vcpu)) && sea_status) { >> kvm_inject_vabt(vcpu); >> return 1; >> } > After the host kernel correctly handle the synchronous external abort, the sea_status > will return 0, so the code logical will be continue go-no, whether it is better directly return > after correctly handle the SEA? such as below. > > if (unlikely(!is_iabt && kvm_vcpu_dabt_isextabt(vcpu)) && sea_status) { > kvm_inject_vabt(vcpu); > return 1; > } else > return 1; Yes, I will return after successful SEA handling in the next patch set. Thanks, Tyler > >> >> - fault_ipa = kvm_vcpu_get_fault_ipa(vcpu); >> - >> trace_kvm_guest_fault(*vcpu_pc(vcpu), kvm_vcpu_get_hsr(vcpu), >> kvm_vcpu_get_hfar(vcpu), fault_ipa); >> >> - /* Check the stage-2 fault is trans. fault or write fault */ >> - fault_status = kvm_vcpu_trap_get_fault_type(vcpu); >> if (fault_status != FSC_FAULT && fault_status != FSC_PERM && -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.