mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 05:25:11 +00:00
target-i386: avoid overflow in the tsc-frequency property
The TSC frequency fits comfortably in an int when expressed in kHz, but it may overflow when converted to Hz. In this case, tsc-frequency returns a negative value because x86_cpuid_get_tsc_freq does a 32-bit multiplication before assigning to int64_t. For simplicity just make tsc_khz a 64-bit value. Backports commit 06ef227e5158cca6710e6c268d6a7f65a5e2811b from qemu
This commit is contained in:
parent
13b919f5c8
commit
fa2b872b0b
|
@ -954,7 +954,7 @@ typedef struct CPUX86State {
|
|||
uint8_t has_error_code;
|
||||
uint32_t sipi_vector;
|
||||
bool tsc_valid;
|
||||
int tsc_khz;
|
||||
int64_t tsc_khz;
|
||||
void *kvm_xsave_buf;
|
||||
|
||||
uint64_t mcg_cap;
|
||||
|
|
Loading…
Reference in a new issue