From mboxrd@z Thu Jan 1 00:00:00 1970 From: marc.zyngier@arm.com (Marc Zyngier) Date: Tue, 15 Dec 2015 14:20:14 +0000 Subject: [PATCH v7 06/19] KVM: ARM64: Add access handler for PMCEID0 and PMCEID1 register In-Reply-To: <1450169379-12336-7-git-send-email-zhaoshenglong@huawei.com> References: <1450169379-12336-1-git-send-email-zhaoshenglong@huawei.com> <1450169379-12336-7-git-send-email-zhaoshenglong@huawei.com> Message-ID: <5670219E.1050207@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 15/12/15 08:49, Shannon Zhao wrote: > From: Shannon Zhao > > Add access handler which gets host value of PMCEID0 or PMCEID1 when > guest access these registers. Writing action to PMCEID0 or PMCEID1 is > ignored. > > Signed-off-by: Shannon Zhao > --- > arch/arm64/kvm/sys_regs.c | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index c21f91b..e043224 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -486,6 +486,24 @@ static bool access_pmselr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, > return true; > } > > +static bool access_pmceid(struct kvm_vcpu *vcpu, struct sys_reg_params *p, > + const struct sys_reg_desc *r) > +{ > + u64 pmceid; > + > + if (p->is_write) > + return write_to_read_only(vcpu, p); This register in UNDEFINED in that case. You should call kvm_inject_undefined() for that vcpu and return. Thanks, M. -- Jazz is not dead. It just smells funny...