From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH v2 03/25] KVM: arm64: Make kvm_condition_valid32() accessible from EL2 Date: Sun, 4 Jun 2017 14:11:29 +0200 Message-ID: <20170604121129.GB9464@cbox> References: <20170601102117.17750-1-marc.zyngier@arm.com> <20170601102117.17750-4-marc.zyngier@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoffer Dall , David Daney , Catalin Marinas , Mark Rutland , Robert Richter , Eric Auger , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org To: Marc Zyngier Return-path: Received: from mail-wm0-f52.google.com ([74.125.82.52]:35583 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbdFDMLr (ORCPT ); Sun, 4 Jun 2017 08:11:47 -0400 Received: by mail-wm0-f52.google.com with SMTP id b84so54719064wmh.0 for ; Sun, 04 Jun 2017 05:11:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170601102117.17750-4-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jun 01, 2017 at 11:20:55AM +0100, Marc Zyngier wrote: > As we're about to trap CP15 accesses and handle them at EL2, we > need to evaluate whether or not the condition flags are valid, > as an implementation is allowed to trap despite the condition > not being met. > > Tagging the function as __hyp_text allows this. is the cc_map also guaranteed to work (by simple reference) in EL2 then? Thanks, -Christoffer > > Reviewed-by: Eric Auger > Signed-off-by: Marc Zyngier > --- > virt/kvm/arm/aarch32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/virt/kvm/arm/aarch32.c b/virt/kvm/arm/aarch32.c > index 528af4b2d09e..79c7c357804b 100644 > --- a/virt/kvm/arm/aarch32.c > +++ b/virt/kvm/arm/aarch32.c > @@ -60,7 +60,7 @@ static const unsigned short cc_map[16] = { > /* > * Check if a trapped instruction should have been executed or not. > */ > -bool kvm_condition_valid32(const struct kvm_vcpu *vcpu) > +bool __hyp_text kvm_condition_valid32(const struct kvm_vcpu *vcpu) > { > unsigned long cpsr; > u32 cpsr_cond; > -- > 2.11.0 >