From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH kvm-unit-tests v2] x86: Test task-switch with cs.rpl != cs.dpl Date: Tue, 19 Aug 2014 15:37:50 +0200 Message-ID: <53F3532E.7010708@redhat.com> References: <53F32679.6030607@redhat.com> <1408453449-4243-1-git-send-email-namit@cs.technion.ac.il> <53F350F3.1060206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nadav Amit , gleb@kernel.org, kvm@vger.kernel.org To: Nadav Amit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48237 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbaHSNiB (ORCPT ); Tue, 19 Aug 2014 09:38:01 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 19/08/2014 15:34, Nadav Amit ha scritto: > I know, but all the other =91call' tests did. If there is an error, a= t > least it should be consistent. ;-) Right, let's fix it up: diff --git a/x86/taskswitch2.c b/x86/taskswitch2.c index fd9a404..3cfb467 100644 --- a/x86/taskswitch2.c +++ b/x86/taskswitch2.c @@ -190,7 +190,7 @@ void test_kernel_mode_int() /* test that calling a task by lcall works */ test_count =3D 0; - set_intr_task_gate(0, irq_tss); + tss_intr.eip =3D (u32)irq_tss; printf("Calling task by lcall\n"); /* hlt opcode is 0xf4 I use destination IP 0xf4f4f4f4 to catch incorrect instruction length calculation */ @@ -205,7 +205,7 @@ void test_kernel_mode_int() /* test that calling a task by ljmp works */ test_count =3D 0; - set_intr_task_gate(0, jmp_tss); + tss_intr.eip =3D (u32)jmp_tss; printf("Jumping to a task by ljmp\n"); asm volatile ("ljmp $" xstr(TSS_INTR) ", $0xf4f4f4f4"); printf("Jump back succeeded\n"); Paolo