On 18/12/2019 12:51, Jan Beulich wrote:
>>>> +        scale = tsc_page->tsc_scale;
>>>> +        offset = tsc_page->tsc_offset;
>>>> +
>>>> +        smp_rmb();
>>>> +
>>>> +    } while (tsc_page->tsc_sequence != seq);
>>>> +
>>>> +    /* x86 has ARCH_SUPPORTS_INT128 */
>>>> +    ret = (uint64_t)(((__uint128_t)tsc * scale) >> 64) + offset;
>>> The final cast isn't really needed, is it? As to the multiplication
>>> - are you sure all compilers in all cases will avoid falling back
>>> to a library call here? In other similar places I think we use
>>> inline assembly instead.
>> What library call? A function in libgcc (or clang's equivalence)?
>> ISTR libgcc is always linked, but I could be wrong here.
> No, the hypervisor (at least the x86 one) doesn't link libgcc afaik.

x86 can multiply uint128_t by uint64_t without a library call.  If this
compiles, then it should be fine.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to