From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCH] add sysenter/syscall emulation for 32bit compat mode Date: Wed, 17 Jun 2009 09:51:57 +0200 Message-ID: <4A38A09D.9090104@amd.com> References: <1245158713-15054-1-git-send-email-andre.przywara@amd.com> <20090617050236.GA23051@amit-x200.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, kvm@vger.kernel.org, Christoph Egger To: Amit Shah Return-path: Received: from sg2ehsobe003.messaging.microsoft.com ([207.46.51.77]:51582 "EHLO SG2EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751863AbZFQHtO (ORCPT ); Wed, 17 Jun 2009 03:49:14 -0400 In-Reply-To: <20090617050236.GA23051@amit-x200.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Amit Shah wrote: > Hi Andre, > > On (Tue) Jun 16 2009 [15:25:13], Andre Przywara wrote: >> sysenter/sysexit are not supported on AMD's 32bit compat mode, whereas >> syscall is not supported on Intel's 32bit compat mode. To allow cross >> vendor migration we emulate the missing instructions by setting up the >> processor state accordingly. >> The sysenter code was originally sketched by Amit Shah, it was completed, >> debugged, syscall added and made-to-work by Christoph Egger and polished >> up by Andre Przywara. >> Please note that sysret does not need to be emulated, because it will be >> exectued in 64bit mode and returning to 32bit compat mode works on Intel. > > Thanks for picking this up. You also had a testcase for this, right? Yes. We started a Linux 64bit guest on an AMD host and migrated it to an Intel box. On both boxes we ran a test benchmark which is measuring the time needed for a few million syscalls (GETPID via syscall()), both as a 64bit and a 32bit binary. Then we repeated the test the other way round (started on Intel, migrated to AMD). Without the patch the 32bit test was aborted with SIGILL. With the patch everything went well, excecpt that the execution time was much longer. Earlier we observed that this shouldn't be much of an issue in real life, as a tight-loop execution of GETPID is a real corner case. Regards, Andre. -- Andre Przywara AMD-OSRC (Dresden) Tel: x29712