Re: [PATCH 15/17] ARM: KVM: KVM_GET_MSR_INDEX_LIST/KVM_GET_MSRS/KVM_SET_MSRS for cp15 regs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20 August 2012 08:52, Alexander Graf <agraf@xxxxxxx> wrote:
> Am 20.08.2012 um 06:57 schrieb Rusty Russell <rusty.russell@xxxxxxxxxx>:
>> To be precise, you'd prefer:
>>
>>        #define KVM_ARM_MSR_COPROC_MASK_START          16
>>        #define KVM_ARM_MSR_COPROC_MASK_LEN            16
>>
>> vs:
>>        #define KVM_ARM_MSR_COPROC_MASK                0xFFFF0000
>>
>> What a huge readability lose.  I can't describe how distasteful it is to
>> do this because QEMU would have to write a macro :(
>
> The usual way this is done in the kernel is
>
> #define xxx_SHIFT 16
> #define xxx_MASK (0xffff << xxx_SHIFT)
>
> Right? Would that work for you guys? It'd certainly be easier to read.

I now realise that the qemu code needs its macro to encode an
index from a tuple independently of whether KVM is enabled, so
it couldn't really use the kvm header macros anyway. (we might be
able to throw in an assertion that they match up somewhere I guess).

So you should probably use whatever standard kernel style is for
telling userspace about aa set of bitmasks.

-- PMM
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux