From mboxrd@z Thu Jan 1 00:00:00 1970 From: "joro@8bytes.org" Subject: Re: [PATCH 7/9] Add VMRUN handler v3 Date: Thu, 25 Sep 2008 23:22:42 +0200 Message-ID: <20080925212242.GM27426@8bytes.org> References: <1221658886-14109-3-git-send-email-agraf@suse.de> <1221658886-14109-4-git-send-email-agraf@suse.de> <1221658886-14109-5-git-send-email-agraf@suse.de> <1221658886-14109-6-git-send-email-agraf@suse.de> <1221658886-14109-7-git-send-email-agraf@suse.de> <1221658886-14109-8-git-send-email-agraf@suse.de> <20080919155926.GR24392@amd.com> <319028FA-B559-44C0-BA7C-0A1AD96CDA52@suse.de> <20080925173746.GB27928@amd.com> <60483CCB-2721-4936-A041-7296F900CCE1@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Joerg Roedel , "kvm@vger.kernel.org" , "anthony@codemonkey.ws" , "avi@qumranet.com" To: Alexander Graf Return-path: Received: from 8bytes.org ([88.198.83.132]:34598 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754433AbYIYVWn (ORCPT ); Thu, 25 Sep 2008 17:22:43 -0400 Content-Disposition: inline In-Reply-To: <60483CCB-2721-4936-A041-7296F900CCE1@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Sep 25, 2008 at 10:00:17PM +0200, Alexander Graf wrote: > > On 25.09.2008, at 19:37, Joerg Roedel wrote: > > >On Thu, Sep 25, 2008 at 07:32:55PM +0200, Alexander Graf wrote: > >>>This is a big security hole. With this we give the guest access to > >>>its > >>>own VMCB. The guest can take over or crash the whole host machine by > >>>rewriting its VMCB. We should be more selective what we save in the > >>>hsave area. > >> > >>Oh, right. I didn't even think of a case where the nested guest would > >>have acvess to the hsave of itself. Since the hsave can never be used > >>twice on one vcpu, we could just allocate our own memory for the > >>hsave > >>in the vcpu context and leave the nested hsave empty. > > > >I think we could also gain performance by only saving the important > >parts of the VMCB and not the whole page. > > Is copying one page really that expensive? Is there any accelerated > function available for that that copies it with SSE or so? :-) Copying data in memory is always expensive because the accesses may miss in the caches and data must be fetched from memory. As far as I know this can be around 150 cycles per cache line. Joerg > >-- > > | AMD Saxony Limited Liability Company & Co. KG > >Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany > >System | Register Court Dresden: HRA 4896 > >Research | General Partner authorized to represent: > >Center | AMD Saxony LLC (Wilmington, Delaware, US) > > | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, > >Thomas McCoy > >