On 11/2/24 12:05, Coekjan Yip wrote:
Dear QEMU Community,

I hope this message finds you well.

I recently started studying the QEMU TCG code, and I have noticed that QEMU
seems to support generating PC-Relative Code (`CF_PCREL`), but this feature
seems currently enabled only for System Emulation in version 9.1.0, while it
is not available for User Emulation. Could you please clarify if there are
specific functionality or performance considerations behind this decision?

User emulation does not have multiple mappings of the same physical page like system mode does. This is because in user emulation we have only one process to emulate.

Additionally, if this feature were to be enabled for User Emulation, could we
consider the code generated by QEMU as Position-Independent Code (PIC)?

No. Treating the guest code as PC as a variable instead of a constant is different from generating position independent host code.


r~

Reply via email to