From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 07/13] KVM: SVM: Add intercept checks for descriptor table accesses Date: Sat, 26 Mar 2011 12:10:50 +0100 Message-ID: <20110326111050.GC28219@8bytes.org> References: <1301045356-25257-1-git-send-email-joerg.roedel@amd.com> <1301045356-25257-8-git-send-email-joerg.roedel@amd.com> <4D8DB553.7080508@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Joerg Roedel , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from 8bytes.org ([88.198.83.132]:50567 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753453Ab1CZLKv (ORCPT ); Sat, 26 Mar 2011 07:10:51 -0400 Content-Disposition: inline In-Reply-To: <4D8DB553.7080508@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Mar 26, 2011 at 11:43:47AM +0200, Avi Kivity wrote: > On 03/25/2011 11:29 AM, Joerg Roedel wrote: >> This patch add intercept checks into the KVM instruction >> emulator to check for the 8 instructions that access the >> descriptor table addresses. >> >> >> +static struct opcode group6[] = { >> + DI(ModRM, sldt), >> + DI(ModRM, str), >> + DI(ModRM | Priv, lldt), >> + DI(ModRM | Priv, ltr), >> + N, N, N, N, >> +}; >> + >> static struct group_dual group7 = { { >> - N, N, DI(ModRM | SrcMem | Priv, lgdt), DI(ModRM | SrcMem | Priv, lidt), >> + DI(ModRM | DstMem | Priv, sgdt), DI(ModRM | DstMem | Priv, sidt), >> + DI(ModRM | SrcMem | Priv, lgdt), DI(ModRM | SrcMem | Priv, lidt), >> DI(SrcNone | ModRM | DstMem | Mov, smsw), N, >> DI(SrcMem16 | ModRM | Mov | Priv, lmsw), >> DI(SrcMem | ModRM | ByteOp | Priv | NoAccess, invlpg), > > You're adding decode info for instructions that aren't emulated. Safe > AFAICT because of 'default: goto cannot_emulate', I guess. Right, all that can happen is that the nested guest shoot itself in the foot by getting an #UD. Same for the SVM instructions. Joerg