From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: x86: drop alignment checks from KVM_MSR_SYSTEM_TIME address Date: Thu, 11 Apr 2013 13:05:45 -0300 Message-ID: <20130411160544.GA20855@amt.cnet> References: <20130322191407.GA23681@amt.cnet> <20130322192100.GA9382@redhat.com> <20130322194735.GA21288@amt.cnet> <20130322211947.GA2685@amt.cnet> <20130322215708.GB9382@redhat.com> <20130323141211.GA26995@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Honig , kvm , Eric Northup To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63099 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099Ab3DKQFv (ORCPT ); Thu, 11 Apr 2013 12:05:51 -0400 Content-Disposition: inline In-Reply-To: <20130323141211.GA26995@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Mar 23, 2013 at 04:12:11PM +0200, Gleb Natapov wrote: > On Fri, Mar 22, 2013 at 05:17:38PM -0700, Andrew Honig wrote: > > kvm_write_guest would work, but it will hurt performance a bit because > > it'll be doing the address translation each time the time is updated, > > which happens on most guest enters. > > > Time updates are rare, so this should no be an issue. Marcelo? Yes, performance is not an issue at this level. > > Another possibility would be to change kvm_gfn_to_hva_cache_init to > > accept a size parameter. If the requested range is all on one page > > then it operates the same as it currently does. If the address range > > is on more than one page then it falls back to kvm_write_guest. This > > preserves the good performance for all cases that currently work, > > while still supporting the unlikely case of page straddling requests. > > It also makes it harder to write a security bugs for other callers of > > kvm_gfn_to_hva_cache_init by explicitly requiring a size parameter. > > > > I can write a patch if you like the idea. > Nice idea. Send a patch please. >