On 8/14/25 20:43, ger...@altlinux.org wrote:
1) I’m not entirely sure why using long long is considered “always wrong,” especially since just a few lines above there’s a similar usage here:
Because "long" has host-specific length, we eschew it completely in favor of types with definite length like "int32_t" or "int64_t". Because we prefer int64_t, there is zero benefit to using "long long".
Just because there are other mis-uses of "long" or "long long" doesn't mean we should introduce more.
2) If len can approach INT32_MAX, why wouldn’t the calculation len * TARGET_PAGE_SIZE cause an overflow?
Because we're computing a 32-bit value for pa1.1, a 32-bit guest. If the guest asks for a nonsense computation, it should get it.
r~