Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request aims at fixing two bugs when dealing with x86 targets.
The first one is related to the gdbstub complaining about the fact that the machine doesn't provide any CPU (as illustrated in this issue: avatartwo/avatar2#110 (comment)). The fix involves plugging the CPU into the QOM hierarchy with
qdev_realize
.Please note that a hardcoded apic-id is used at the moment which could prevent users from creating multiple CPUs on the target. However, I don't know if avatar-qemu could allow such possibility in any cases so I haven't dwelt on this issue.
The second bug is related to a wrong stack alignment when pushing and popping 32 bit values. This impedes the correct functioning of these instructions by preventing the value to be written in memory.
As qemu uses the CPU flag
HF_SS32_MASK
to retrieve the stack pointer size that is needed, the fix is to simply set it when initializing the CPU.For the record, a third bug still remains on this target: the provided
entry_address
is not taken into account by the CPU and the execution instead starts from the beginning of the first ROM memory.I tried to dig into that but without much success. Since this is an issue that can easily be circumvented directly from the python script, I've put it aside for now.