Re: [PATCH v2] x86: make DR*_RESERVED unsigned long

From: H. Peter Anvin
Date: Fri Apr 26 2013 - 12:44:35 EST


On 04/26/2013 09:38 AM, Oleg Nesterov wrote:
> DR6_RESERVED and DR_CONTROL_RESERVED are used to clear the set
> bits in the "unsigned long" data, make them long to ensure that
> "&~" doesn't clear the upper bits.
>
> This is only cleanup, the usage of ~DR*_RESERVED is safe but
> doesn't look clean and the pattern is error prone.
>
> - do_debug:
>
> dr6 &= ~DR6_RESERVED;
>
> this also wrongly clears 32-63 bits. Fortunately these
> bits are reserved and must be zero.
>

I don't think this is wrongly at all. The whole point is to mask out
the bits that the handler doesn't want to deal with, so masking out the
reserved bits [63:32] seems reasonable to me.

The comment should probably be corrected, though.

-hpa


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/