Possible QEMU bug or something else
Posted: Sun May 31, 2020 12:18 pm
Hey all,
So I've began work on implementing APIC support in my kernel. However, this required me to do some fiddling around with what happened first (e.g.: the memory manager is initialized before anything else in the system). However, I'm now getting really strange warnings from QEMU, like:
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
I've never seen these warnings emitted by Qemu before, and am wondering if they're a bug with Qemu on windows, a bug with Qemu in general, or something in my kernel (or its dependencies) is attempting to utilize a feature I'm unaware of. Or something else I haven't thought of yet. To further exacerbate the problem, my kernel prints its "Loading kernel" message, then Qemu immediately triple faults (though I can't tell that this is actually happening). Debugging it with GDB gives me nothing -- Qemu just immediately exits. I can't enable interrupts at this stage because I need to map the APIC, and I can't do that until my memory manager is initialized. I'd prefer not to set up the PIC, then have to disable it to switch over to the APIC later on, but is this something I should do? Or should I just go immediately to the APIC or PIC depending on what's supported? Finally, is there any way around these strange QEMU warnings? Some of these, like X2APIC, should be supported, I'd think. For reference, I'm using Qemu version 5.0.0. This does, however, also happen on Qemu 4.2.0.
So I've began work on implementing APIC support in my kernel. However, this required me to do some fiddling around with what happened first (e.g.: the memory manager is initialized before anything else in the system). However, I'm now getting really strange warnings from QEMU, like:
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
I've never seen these warnings emitted by Qemu before, and am wondering if they're a bug with Qemu on windows, a bug with Qemu in general, or something in my kernel (or its dependencies) is attempting to utilize a feature I'm unaware of. Or something else I haven't thought of yet. To further exacerbate the problem, my kernel prints its "Loading kernel" message, then Qemu immediately triple faults (though I can't tell that this is actually happening). Debugging it with GDB gives me nothing -- Qemu just immediately exits. I can't enable interrupts at this stage because I need to map the APIC, and I can't do that until my memory manager is initialized. I'd prefer not to set up the PIC, then have to disable it to switch over to the APIC later on, but is this something I should do? Or should I just go immediately to the APIC or PIC depending on what's supported? Finally, is there any way around these strange QEMU warnings? Some of these, like X2APIC, should be supported, I'd think. For reference, I'm using Qemu version 5.0.0. This does, however, also happen on Qemu 4.2.0.