From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5gk4-0007zB-Fh for qemu-devel@nongnu.org; Mon, 09 Jun 2008 08:44:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5gk2-0007xf-Rf for qemu-devel@nongnu.org; Mon, 09 Jun 2008 08:44:56 -0400 Received: from [199.232.76.173] (port=47380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5gk2-0007xZ-Kt for qemu-devel@nongnu.org; Mon, 09 Jun 2008 08:44:54 -0400 Received: from kassel160.server4you.de ([62.75.246.160]:53731 helo=csgraf.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K5gk2-0005nk-2s for qemu-devel@nongnu.org; Mon, 09 Jun 2008 08:44:54 -0400 Message-ID: <484D2546.8090605@csgraf.de> Date: Mon, 09 Jun 2008 14:42:46 +0200 From: Alexander Graf MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010502030101070202070608" Subject: [Qemu-devel] [PATCH] SVM: Fix segment attribute clobbering Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------010502030101070202070608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit When SVM segment flags get stored in the VMCB, there is a certain chance that they get clobbered by garbage bits. This patch ANDs the wanted bits correctly and thus makes SVM work again. Alex --------------010502030101070202070608 Content-Type: text/x-patch; name="qemu-svn-segflags.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-svn-segflags.patch" Index: target-i386/op_helper.c =================================================================== --- target-i386/op_helper.c (revision 4707) +++ target-i386/op_helper.c (working copy) @@ -4767,7 +4767,7 @@ stl_phys(addr + offsetof(struct vmcb_seg, limit), sc->limit); stw_phys(addr + offsetof(struct vmcb_seg, attrib), - (sc->flags >> 8) | ((sc->flags >> 12) & 0x0f00)); + ((sc->flags >> 8) & 0xff) | ((sc->flags >> 12) & 0x0f00)); } static inline void svm_load_seg(target_phys_addr_t addr, SegmentCache *sc) --------------010502030101070202070608--