From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXmeu-0007Jr-9M for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXmeq-00083I-99 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:47:44 -0400 Received: from mail-vk0-f53.google.com ([209.85.213.53]:33557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXmeq-00083E-5I for qemu-devel@nongnu.org; Fri, 04 Sep 2015 04:47:40 -0400 Received: by vkbf67 with SMTP id f67so7874313vkb.0 for ; Fri, 04 Sep 2015 01:47:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <012101d0e6de$88ed5dd0$9ac81970$@samsung.com> References: <5f481e4c8a35808c7e4a511100f9417d75b49670.1440584396.git.p.fedin@samsung.com> <012101d0e6de$88ed5dd0$9ac81970$@samsung.com> From: Peter Maydell Date: Fri, 4 Sep 2015 09:47:20 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v12 2/5] intc/gic: Extract some reusable vGIC code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: Shlomo Pongratz , Shlomo Pongratz , QEMU Developers , Eric Auger On 4 September 2015 at 07:54, Pavel Fedin wrote: > Hello! > >> > + >> > +#define kvm_gicd_access(s, offset, cpu, val, write) \ >> > + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_DIST_REGS, \ >> > + KVM_VGIC_ATTR(offset, cpu), val, write) >> > + >> > +#define kvm_gicc_access(s, offset, cpu, val, write) \ >> > + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_REGS, \ >> > + KVM_VGIC_ATTR(offset, cpu), val, write) >> >> Can you make these two static inline functions, not #defines, please? > > I can, of course, and i did in previous versions, but you disliked it > because inline functions would require dev_fd instead of 's', because > 's' is different in GICv2 and GICv3. Macro approach allowed to work > around this difference. Or do you mean you strictly don't want them > to be reusable? Oh, right. In that case, yes, I don't think they're worth trying to share between the two devices. -- PMM