From mboxrd@z Thu Jan 1 00:00:00 1970
From: Pavel Fedin
Subject: RE: [PATCH 3/3] KVM: arm64: Implement accessors for vGIC CPU interface
registers
Date: Mon, 31 Aug 2015 10:43:27 +0300
Message-ID: <014001d0e3c0$b9d6ea40$2d84bec0$@samsung.com>
References:
<2857f7cad7c17109dfa3028f79af28893c0171ce.1440766141.git.p.fedin@samsung.com>
<20150830165015.GE24113@cbox>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8BIT
Cc: 'Marc Zyngier' ,
kvmarm@lists.cs.columbia.edu, 'kvm-devel'
To: 'Peter Maydell' ,
'Christoffer Dall'
Return-path:
Received: from mailout3.w1.samsung.com ([210.118.77.13]:29690 "EHLO
mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S1751256AbbHaHnb convert rfc822-to-8bit (ORCPT
); Mon, 31 Aug 2015 03:43:31 -0400
Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244])
by mailout3.w1.samsung.com
(Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014))
with ESMTP id <0NTX009R4S4G0Q90@mailout3.w1.samsung.com> for
kvm@vger.kernel.org; Mon, 31 Aug 2015 08:43:29 +0100 (BST)
In-reply-to:
Content-language: ru
Sender: kvm-owner@vger.kernel.org
List-ID:
Hello!
> > I had imagined we would encode the GICv3 register accesses through the
> > device API and not through the system register API, since I'm not crazy
> > about polluting the general system register handling logic with GIC
> > registers solely for the purposes of migration.
>
> There's an interesting design question lurking under this
> about the extent to which you expose the h/w design split
> between the CPU interface and the GIC proper as part of the
> KVM APIs.
I could split up handling logic from access logic. So that in sys_regs.c we would have something like:
static bool access_gic_ctlr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p,
const struct sys_reg_desc *r)
{
return vgicv3_access_ctlr(vcpu, vcpu_reg(vcpu, p->Rt), p->is_write);
}
And in vgic-v3-emul.c we would have the handler itself with the prototype:
bool vgicv3_access_ctlr(struct kvm_vcpu *vcpu, u64 *val, bool write);
Would this be OK?
In my personal opinion system register access API fits perfectly well for this task, because after all these are system registers. And implementing this as device attribute would, i guess, give no difference from code's point of view. We would have to encode system register numbers into attribute, then perform table lookup, actually duplicating our system register access code. Does it worth that?
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia