[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53CD0692.5070700@redhat.com>
Date: Mon, 21 Jul 2014 14:24:50 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Nadav Amit <namit@...technion.ac.il>
CC: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, gleb@...nel.org, linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists