From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: vtime accounting Date: Tue, 14 Mar 2017 08:55:09 +0000 Message-ID: <87zigos0eq.fsf@on-the-bus.cambridge.arm.com> References: <20170308105700.GA109453@lvm> <20170313162259.GE18298@potion> <20170314082601.GC1277@cbox> Mime-Version: 1.0 Content-Type: text/plain Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , Christoffer Dall , Paolo Bonzini , kvm@vger.kernel.org, Rik van Riel To: Christoffer Dall Return-path: Received: from foss.arm.com ([217.140.101.70]:58168 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbdCNIzS (ORCPT ); Tue, 14 Mar 2017 04:55:18 -0400 In-Reply-To: <20170314082601.GC1277@cbox> (Christoffer Dall's message of "Tue, 14 Mar 2017 09:26:01 +0100") Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 14 2017 at 8:26:01 am GMT, Christoffer Dall wrote: > On ARM, I think the main benefits of implementing something like > handle_external_intr would come from two things: (1) You'd avoid the > context synchronization and associated cost of taking an exception on > the CPU, and (2) you'd also (potentially) avoid the additional > save/restore of all the GP regiters from the kernel exception entry path > to create a usable gp_regs. > > I have to look more careful at whether or not (2) is possible, because > it would mean we'd have to store the guest register state on a pt_regs > structure in the first place and pass that directly to > arch_handle_irq. For that to be useful on pre-VHE HW and avoid the extra exception handling, we'd also have to perform that arch_handle_irq call as part of the exception return to EL1. That's not going to be very pretty, as we need to build two return contexts (EL2->EL1 IRQ on the host, followed by EL1->EL1). This is all perfectly doable, but as always, we need numbers. I had similar stuff for VHE a long while ago (back when I wrote WSINC), but faking the pt_regs was absolutely horrible. But maybe it is time to exhume this again... > Additionally, if we had something like handle_external_intr, the > guest_exit thing would be kinda moot, since we'd do our ticks like > x86... Indeed. Which brings the obvious question: are we the only ones not taking the interrupt early? Thanks, M. -- Jazz is not dead, it just smell funny.