From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9D1DC64E7B for ; Tue, 1 Dec 2020 11:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D0FF2080A for ; Tue, 1 Dec 2020 11:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="S4VW9Sgn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbgLALuo (ORCPT ); Tue, 1 Dec 2020 06:50:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:53900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgLALuo (ORCPT ); Tue, 1 Dec 2020 06:50:44 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9726820770; Tue, 1 Dec 2020 11:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606823402; bh=UE/XVXCsi7+x/uyIjMjMl6em1uv7ikjqa7mp1FXveyA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S4VW9Sgn7iW1ndWIZxYcNhZNcYzrdu4YLpAlGR+L9NWq1kn48g6Y4AjQsLMUboqDi px82TrnsP+fOea64waKx9MDPGYbxyC/mmTjMV2SDQGdhlKvlPPX3OrDSqCpOMwmDfU pi97M7j6fHneG9TEh+N29owEJN700T5yy5JzU9kQ= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kk4AS-00F1ps-IO; Tue, 01 Dec 2020 11:50:00 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 01 Dec 2020 11:50:00 +0000 From: Marc Zyngier To: Shenming Lu Cc: James Morse , Julien Thierry , Suzuki K Poulose , Eric Auger , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Christoffer Dall , Alex Williamson , Kirti Wankhede , Cornelia Huck , Neo Jia , wanghaibin.wang@huawei.com, yuzenghui@huawei.com Subject: Re: [RFC PATCH v1 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side In-Reply-To: <9b80d460-e149-20c8-e9b3-e695310b4ed1@huawei.com> References: <20201123065410.1915-1-lushenming@huawei.com> <20201123065410.1915-4-lushenming@huawei.com> <5c724bb83730cdd5dcf7add9a812fa92@kernel.org> <2d2bcae4f871d239a1af50362f5c11a4@kernel.org> <49610291-cf57-ff78-d0ac-063af24efbb4@huawei.com> <48c10467-30f3-9b5c-bbcb-533a51516dc5@huawei.com> <2ad38077300bdcaedd2e3b073cd36743@kernel.org> <9b80d460-e149-20c8-e9b3-e695310b4ed1@huawei.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <274dafb2e21f49326a64bb575e668793@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: lushenming@huawei.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, eric.auger@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, cohuck@redhat.com, cjia@nvidia.com, wanghaibin.wang@huawei.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-01 11:40, Shenming Lu wrote: > On 2020/12/1 18:55, Marc Zyngier wrote: >> On 2020-11-30 07:23, Shenming Lu wrote: >> >> Hi Shenming, >> >>> We are pondering over this problem these days, but still don't get a >>> good solution... >>> Could you give us some advice on this? >>> >>> Or could we move the restoring of the pending states (include the >>> sync >>> from guest RAM and the transfer to HW) to the GIC VM state change >>> handler, >>> which is completely corresponding to save_pending_tables (more >>> symmetric?) >>> and don't expose GICv4... >> >> What is "the GIC VM state change handler"? Is that a QEMU thing? > > Yeah, it is a a QEMU thing... > >> We don't really have that concept in KVM, so I'd appreciate if you >> could >> be a bit more explicit on this. > > My thought is to add a new interface (to QEMU) for the restoring of > the pending states, which is completely corresponding to > KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES... > And it is called from the GIC VM state change handler in QEMU, which > is happening after the restoring (call kvm_vgic_v4_set_forwarding()) > but before the starting (running) of the VFIO device. Right, that makes sense. I still wonder how much the GIC save/restore stuff differs from other architectures that implement similar features, such as x86 with VT-D. It is obviously too late to change the userspace interface, but I wonder whether we missed something at the time. Thanks, M. -- Jazz is not dead. It just smells funny...