News on my problem: I was able to fix this by using Target.Cpu.baseline(.x86_64)
.
But now QEMU greets me with the following when the bootloader tries to get the memory map and to exit boot services.
!!!! X64 Exception Type - 06(#UD - Invalid Opcode) CPU Apic ID - 00000000 !!!!
RIP - 00000000061890A4, CS - 0000000000000038, RFLAGS - 0000000000000046
RAX - 0000000000000000, RCX - 0000000007EFA4E0, RDX - 0000000000000006
RBX - 0000000000000000, RSP - 0000000007EFA340, RBP - 0000000007EFA340
RSI - 0000000000000000, RDI - 00000000062A5D18
R8 - 00000000061924C1, R9 - 000000000000001E, R10 - 00000000076E6860
R11 - 000000009172BA06, R12 - 0000000000000000, R13 - 0000000006B5ECF0
R14 - 0000000000000000, R15 - 0000000007F131A0
DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030
GS - 0000000000000030, SS - 0000000000000030
CR0 - 0000000080010033, CR2 - 0000000000000000, CR3 - 0000000007801000
CR4 - 0000000000000668, CR8 - 0000000000000000
DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 00000000075DC000 0000000000000047, LDTR - 0000000000000000
IDTR - 0000000007248018 0000000000000FFF, TR - 0000000000000000
FXSAVE_STATE - 0000000007EF9FA0
What is the reason for that?