Skip to contentSkip to conversation

4gb_segments & movzbl

DISCUSSION Samuel Thibault 3 participants 4 messages Mar 7, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I'm using VMASS_4gb_segments for now, and tried the following program:

__thread char a;

int main(void) {
	printf("%d\n",a);
}

And I'm getting a SIGILL at

8048450: 65 0f b6 05 ff ff ff movzbl %gs:0xffffffff,%eax

When turning `a' into an int, the program works. I guess this is because movzbl is somehow not correctly supported by the 4gb segment emulation?

Samuel

#1 lore raw

Hi,

Quoted 7 lines · Samuel Thibault, le Wed 07 Mar 2007 01:25:28 +0100, a écrit :

I'm using VMASS_4gb_segments for now, and tried the following program:

__thread char a;

int main(void) {
	printf("%d\n",a);
}
Quoted 7 lines

And I'm getting a SIGILL at

8048450: 65 0f b6 05 ff ff ff movzbl %gs:0xffffffff,%eax

When turning `a' into an int, the program works. I guess this is because movzbl is somehow not correctly supported by the 4gb segment emulation?

That said, my hypervisor may be a bit old (3.0.3-0, more recent versions fail to boot on my laptop).

Samuel

#2 lore raw
Quoted 10 lines
Quoted 7 lines

And I'm getting a SIGILL at

8048450: 65 0f b6 05 ff ff ff movzbl %gs:0xffffffff,%eax

When turning `a' into an int, the program works. I guess this is because movzbl is somehow not correctly supported by the 4gb segment emulation?

That said, my hypervisor may be a bit old (3.0.3-0, more recent versions fail to boot on my laptop).

Which shouldn't matter - -unstable doesn't seem to have changed in that
respect: no 2-byte opcodes (i.e. such starting with a 0x0f byte) are being emulated here.

Jan

#3 lore raw
Quoted 6 lines · Jan Beulich
Quoted 2 lines

That said, my hypervisor may be a bit old (3.0.3-0, more recent versions fail to boot on my laptop).

Which shouldn't matter - -unstable doesn't seem to have changed in that
respect: no 2-byte opcodes (i.e. such starting with a 0x0f byte) are being emulated here.

It's yet another sucky emulator to be changed to use x86_emulate.c... We have plenty of them. :-)

-- Keir