[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <538459C2.90408@redhat.com>
Date: Tue, 27 May 2014 11:24:18 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Nadav Amit <namit@...technion.ac.il>
CC: gleb@...nel.org, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, x86@...nel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH kvm-unit-tests] x86: test mov DR with ignored mod bits
Il 26/05/2014 23:06, Nadav Amit ha scritto:
> Tests whether the emulator ignores the mod bits on mov DR instruction. The
> test performs regular mov to DR0 and reads back the data using custom mov from
> DR0 while mod bits are set to zero. The expected result is obviously the value
> which was written to DR0 before.
>
> The test is performed in realmode and is only expected to fail if the CPU does
> not support unrestricted mode. Note that mov-CR/DR in protected mode are
> usually not handled by the emulator, as their data is available in the exit
> information fields.
>
> Signed-off-by: Nadav Amit <namit@...technion.ac.il>
> ---
> x86/realmode.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/x86/realmode.c b/x86/realmode.c
> index 9c22d41..839ac34 100644
> --- a/x86/realmode.c
> +++ b/x86/realmode.c
> @@ -1636,6 +1636,16 @@ static void test_perf_memory_rmw(void)
> print_serial(" cycles/emulated memory RMW instruction\n");
> }
>
> +void test_dr_mod(void)
> +{
> + MK_INSN(drmod, "movl %ebx, %dr0\n\t"
> + ".byte 0x0f \n\t .byte 0x21 \n\t .byte 0x0\n\t");
> + inregs.eax = 0xdead;
> + inregs.ebx = 0xaced;
> + exec_in_big_real_mode(&insn_drmod);
> + report("mov dr with mod bits", R_AX | R_BX, outregs.eax == 0xaced);
> +}
> +
> void realmode_start(void)
> {
> test_null();
> @@ -1681,6 +1691,7 @@ void realmode_start(void)
> test_xlat();
> test_salc();
> test_fninit();
> + test_dr_mod();
> test_nopl();
> test_perf_loop();
> test_perf_mov();
>
Thanks, applied.
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