Messages in this thread | | | Date | Mon, 21 Jul 2014 14:24:50 +0200 | From | Paolo Bonzini <> | Subject | Re: [PATCH kvm-unit-tests 2/3] x86: Test rflags.rf is set upon faults |
| |
Il 21/07/2014 13:39, Nadav Amit ha scritto: > @@ -176,7 +176,7 @@ unsigned exception_vector(void) > unsigned short vector; > > asm("mov %%gs:4, %0" : "=rm"(vector));
"rm" is wrong here, it should be "r". If we make it "q" instead, we can use movb.
unsigned char vector;
asm("movb %%gs:4, %b0" : "=q"(vector));
> - return vector; > + return (u8)vector; > }
> > +bool exception_rflags_rf(void) > +{ > + unsigned short rf_flag; > + > + asm("mov %%gs:4, %0" : "=rm"(rf_flag)); > + return (rf_flag >> 8) & 1; > +} > +
Same here, use "movb %%gs:5, %b0" and an unsigned char.
Paolo
| |