On 4/2/20 8:50 AM, David Gibson wrote: > On Thu, Apr 02, 2020 at 08:41:24AM +0200, Cédric Le Goater wrote: >> On 4/2/20 2:31 AM, David Gibson wrote: >>> On Wed, Apr 01, 2020 at 05:26:33PM +0200, Cédric Le Goater wrote: >>>> Most of QEMU definitions of the register fields of the PowerNV machine >>>> come from skiboot and the models duplicate a set of macros for this >>>> purpose. Make them common under the pnv_utils.h file. >>>> >>>> Signed-off-by: Cédric Le Goater <c...@kaod.org> >>> >>> Hrm. If we're touching these, would it make sense to rewrite them in >>> terms of the cross-qemu generic extract64() and deposit64()? >> >> I won't do that because we will loose compatibility with skiboot. > > Uh.. how so?
What would be very nice is to use the QEMU FIELD() from "hw/registerfields.h". But that's a complete different approach from what skiboot does and it would mean rewriting all the register definitions we include in QEMU for the powernv models and the code using the fields. It is a major change and I would rather have the same files on both side (without tabs on the QEMU side). I think it is safer. Using extract64() and deposit64() raises the same kind of problem AFAICT. If we find a clean way to keep the register definition files the same, I am OK with any changes. C.