From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkuFn-0003kD-Vi for qemu-devel@nongnu.org; Tue, 18 Dec 2012 05:18:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkuFm-0000cn-RC for qemu-devel@nongnu.org; Tue, 18 Dec 2012 05:18:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkuFm-0000ch-KB for qemu-devel@nongnu.org; Tue, 18 Dec 2012 05:18:26 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBIAIPUF005610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Dec 2012 05:18:25 -0500 Message-ID: <50D0437B.80106@redhat.com> Date: Tue, 18 Dec 2012 11:20:43 +0100 From: Hans de Goede MIME-Version: 1.0 References: <1355492147-5023-1-git-send-email-hdegoede@redhat.com> <1355492147-5023-10-git-send-email-hdegoede@redhat.com> <50CF1B33.7060708@redhat.com> <50CF2AFB.2050705@redhat.com> <50CF2EB3.9020501@redhat.com> <50CF308C.70204@redhat.com> <50CF3167.7080707@redhat.com> In-Reply-To: <50CF3167.7080707@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/26] ehci: Use uframe precision for interrupt threshold checking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Hi, On 12/17/2012 03:51 PM, Gerd Hoffmann wrote: > On 12/17/12 15:47, Hans de Goede wrote: >> Hi, >> >> On 12/17/2012 03:39 PM, Gerd Hoffmann wrote: >>> On 12/17/12 15:23, Hans de Goede wrote: >>>> Hi, >>>> >>>> On 12/17/2012 02:16 PM, Gerd Hoffmann wrote: >>>>> On 12/14/12 14:35, Hans de Goede wrote: >>>>>> Note that a shadow variable is used instead of changing frindex to >>>>>> uframe accuracy because we must send a frindex which is a multiple >>>>>> of 8 >>>>>> during migration for migration compatibility, and rounding it down to >>>>>> a multiple of 8 pre-migration, can lead to frindex going backwards >>>>>> from >>>>>> the guest pov. >>>>> >>>>> Jumping forward instead? >>>> >>>> You mean rounding the send frindex up pre-migration, I didn't really >>>> consider >>>> that as it will cause us skipping processing an entry in the periodic >>>> frame >>>> list. I guess doing that on migration isn't too bad. OTOH giving the >>>> guest >>>> only frame accuracy like we've been doing till now also works fine... >>>> >>>> Your choice :) >>> >>> I'm looking for a way to avoid the shadow variable, but of course >>> without breaking migration. giving the guest only frame accuracy looks >>> good to me. >> >> Ok, but then we need the shadow variable, iow then the patch stays as is >> ... > > Can't we (a) switch frindex to microframe resolution, (b) round to frame > resolution in pre_save and (c) return frindex & ~7 on guest register reads? Ah yes we can. I thought about that myself, but I was under the impression that we were using mmap tricks to allow the guest to read the ioregs directly without going through a vmexit. But it turns out we've: static uint64_t ehci_opreg_read(void *ptr, hwaddr addr, unsigned size) { EHCIState *s = ptr; uint32_t val; val = s->opreg[addr >> 2]; trace_usb_ehci_opreg_read(addr + s->opregbase, addr2str(addr), val); return val; } Can qemu not handle an mmio range where writes are trapped, but reads are not? That would force the use of the shadow variable, but should otherwise provide a nice speedup. Regards, Hans