Re: [PATCH 1/3] i915/gvt: seperate tracked MMIO table from handlers.c
From: Christoph Hellwig
Date: Tue Nov 09 2021 - 02:51:14 EST
On Tue, Nov 09, 2021 at 09:00:39AM +0200, Jani Nikula wrote:
> On Mon, 08 Nov 2021, Zhi Wang <zhi.wang.linux@xxxxxxxxx> wrote:
> > From: Zhi Wang <zhi.wang.linux@xxxxxxxxx>
> >
> > To support the new mdev interfaces and the re-factor patches from
> > Christoph, which moves the GVT-g code into a dedicated module, the GVT-g
> > MMIO snapshot still needs to be saved in i915 so that the inital clean HW
> > state can be used for the further vGPU. Seperate the tracked MMIO table
> > from GVT-g, so that GVT-g and i915 can both use it.
>
> Do you really have to both put code in a header and then include that in
> multiple places?
>
> I think you may need to rethink the whole approach, maybe make them
> actual tables instead of code.
Without understanding this code too well: an approach that makes in
actual table and uses an accessor seems more useful to me as well.