From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 04/41] KVM: arm64: Rework hyp_panic for VHE and non-VHE Date: Fri, 9 Feb 2018 10:55:18 +0000 Message-ID: <82ed8658-383e-4b10-866f-10389f697b73@arm.com> References: <20180112120747.27999-1-christoffer.dall@linaro.org> <20180112120747.27999-5-christoffer.dall@linaro.org> <20180208132416.GP29286@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Cc: Marc Zyngier , Shih-Wei Li , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org To: Christoffer Dall Return-path: In-Reply-To: <20180208132416.GP29286@cbox> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: kvm.vger.kernel.org Hi Christoffer, On 02/08/2018 01:24 PM, Christoffer Dall wrote: > On Mon, Feb 05, 2018 at 06:04:25PM +0000, Julien Grall wrote: >> On 12/01/18 12:07, Christoffer Dall wrote: >>> + >>> panic(__hyp_panic_string, >>> spsr, elr, >>> read_sysreg_el2(esr), read_sysreg_el2(far), >>> read_sysreg(hpfar_el2), par, vcpu); >>> } >>> -static hyp_alternate_select(__hyp_call_panic, >>> - __hyp_call_panic_nvhe, __hyp_call_panic_vhe, >>> - ARM64_HAS_VIRT_HOST_EXTN); >> >> Out of interest, any specific rather to remove hyp_alternate_select and >> "open-code" it? >> > > Not sure I understand your question. > > Are you asking why I replace the hyp alternatives with the has_vhe()? > If so, has_vhe() uses a static key and should therefore have the same > performance characteristics, but I find the has_vhe() version below much > more readable. That what I was asking. Thank you for the explanation. Cheers, -- Julien Grall From mboxrd@z Thu Jan 1 00:00:00 1970 From: julien.grall@arm.com (Julien Grall) Date: Fri, 9 Feb 2018 10:55:18 +0000 Subject: [PATCH v3 04/41] KVM: arm64: Rework hyp_panic for VHE and non-VHE In-Reply-To: <20180208132416.GP29286@cbox> References: <20180112120747.27999-1-christoffer.dall@linaro.org> <20180112120747.27999-5-christoffer.dall@linaro.org> <20180208132416.GP29286@cbox> Message-ID: <82ed8658-383e-4b10-866f-10389f697b73@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Christoffer, On 02/08/2018 01:24 PM, Christoffer Dall wrote: > On Mon, Feb 05, 2018 at 06:04:25PM +0000, Julien Grall wrote: >> On 12/01/18 12:07, Christoffer Dall wrote: >>> + >>> panic(__hyp_panic_string, >>> spsr, elr, >>> read_sysreg_el2(esr), read_sysreg_el2(far), >>> read_sysreg(hpfar_el2), par, vcpu); >>> } >>> -static hyp_alternate_select(__hyp_call_panic, >>> - __hyp_call_panic_nvhe, __hyp_call_panic_vhe, >>> - ARM64_HAS_VIRT_HOST_EXTN); >> >> Out of interest, any specific rather to remove hyp_alternate_select and >> "open-code" it? >> > > Not sure I understand your question. > > Are you asking why I replace the hyp alternatives with the has_vhe()? > If so, has_vhe() uses a static key and should therefore have the same > performance characteristics, but I find the has_vhe() version below much > more readable. That what I was asking. Thank you for the explanation. Cheers, -- Julien Grall