Re: [PATCH 2/5] arm64: cpufeature: Track unsigned fields

From: Suzuki K. Poulose
Date: Fri Nov 20 2015 - 08:37:13 EST


On 19/11/15 18:45, Catalin Marinas wrote:
On Thu, Nov 19, 2015 at 10:03:13AM +0000, Suzuki K. Poulose wrote:
On 19/11/15 04:57, AKASHI Takahiro wrote:


a) A precise value (number of breakpoint registers) or a value from
which you derive some precise value. You mentioned these above

b) Fields defining the presence of a feature (1, 2, 3). These would
always be positive since the absence of such feature would mean a
value of 0

c) Fields defining the absence of a feature by setting 0xf. These are
usually fields that were initial RAZ and turned to -1. I don't expect
such field be greater than 0, nor smaller than -1.

So I think we can treat (a) and (b) as unsigned permanently.

Agreed.

We could treat (c) as unsigned as well with a value of 0xf though I'm not sure
how it matches your LOWER/HIGHER_SAFE definitions.

I think we should treat (c) as signed, as we never know what could change,
given that meaning of (0xf - implies unsupported) < meaning of (0 - supported).
Treating them unsigned could break the LOWER/HIGHER_SAFE definitions and makes
the safe value selection ugly.

Cheers
Suzuki

--
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/