Re: [PATCH v6 1/4] kvm: arm64: introduce new flag for non-cacheable IO memory

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

 



>>
>> +     switch (prot & (KVM_PGTABLE_PROT_DEVICE |
>> +                     KVM_PGTABLE_PROT_NORMAL_NC)) {
>> +     case 0:
>> +             attr = KVM_S2_MEMATTR(pgt, NORMAL);
>> +             break;
>> +     case KVM_PGTABLE_PROT_DEVICE:
>> +             if (prot & KVM_PGTABLE_PROT_X)
>> +                     return -EINVAL;
>> +             attr = KVM_S2_MEMATTR(pgt, DEVICE_nGnRE);
>> +             break;
>> +     case KVM_PGTABLE_PROT_NORMAL_NC:
>> +             attr = KVM_S2_MEMATTR(pgt, NORMAL_NC);
>> +             break;
>> +     default:
>> +             WARN_ON_ONCE(1);
>> +     }
>
> Cosmetic nit, but I'd find this a little easier to read if the normal
> case was the default (i.e. drop 'case 0') and we returned an error for
> DEVICE | NC.

Makes sense, will update the logic accordingly.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux