[PATCH 2/12] ldt-accessors

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

 



Chris Wright wrote:

>* zach@xxxxxxxxxx (zach@xxxxxxxxxx) wrote:
>
>Generally nice cleanup.  Couple comments below.
>
>  
>
>>+		desc = &LDT_DESCRIPTOR(seg);
>> 	} else {
>> 		/* Must disable preemption while reading the GDT. */
>>-		desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu());
>>-		desc = (void *)desc + (seg & ~7);
>>+		desc = &per_cpu(cpu_gdt_table, get_cpu())[desc_number(seg)];
>>    
>>
>
>Heh, glad you left the comment.  This one is getting on the edge of
>hiding that get_cpu() is needed for preempt disable.
>  
>

Yes, scarily so ;)

>
>Any compelling reason not to use _s * LDT_ENTRY_SIZE ?
>  
>

Actually, yes.  That requires sizeof(*_s) == sizeof(char), which gives 
no type checking against struct desc_struct.  The lack of type checking 
and easily wrong pointer path as a result is one of the things I've been 
cleaning up.

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux