Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp410292pxu; Tue, 1 Dec 2020 14:34:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3yuPhzLGaKwgUK8qatlzNNFsRznlEch1QDXdTtPHKpTykpsFkGqNchRI3H+E0a/nTog+w X-Received: by 2002:a17:906:f05:: with SMTP id z5mr5331962eji.8.1606862096967; Tue, 01 Dec 2020 14:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606862096; cv=none; d=google.com; s=arc-20160816; b=RrVpgH6pd+af4QcQs2+4dhuSwagF/HrNtdNF8oZhWj7RTVBnIM+MHx5FtXy0hnaVv+ fPLgJMBfGNVDErPBWWSFUT19Vzqf2fLhj0fkJH3NVySs5gFkb/2jJ4St6mv1Xrz+LmK1 iabplXG/LGTjiSKjwtk8IXpfi40Y2sOKKgwCBgafrOo9gbM3fg3h71h2C6VwKUcQoqbO SLU9s7Z4NWsIgSBPoR8FAS4MHGwaR9to6+SpJtNh+r5turhfcqi5VRlguZvFel0Im/jx ekjU2tqaOuthFfOwJIMFQebXi5i7CcEA6slFsS6fVhCdPhrPXwo7XxbmmXUswSOejCV5 ncTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pgqY6zxee6ZCaD2DcvqSuFjrEVa4ZMu4cAZBVAzGEqU=; b=T+8QwPLOvzNcsW++BcBZSn2UN6pCbx3jvanlfLEhQf216mWCMLZVm+Nmlroz1F6QQe YYalSOy65pv+8Q0GaEdGRsswYXsnY2PQ/FARtuWiRgr7pZvgI1esxutAAiPVRS4mgQqe no4crioWZ3iPzcHUszwyxHdsZVRU18xhq9uFmSn9f6f0GFRQ6yLI9gN8OQMfaeqdGfxh ZyMfLGEnchuIPwEf4BMMXbDi8K+gBWFjWOphunWhNxynR02ao87ZkmJ2zbn6vepFDLM/ iqExLPEZIDk/dWBz2JwvEbCLrc2GJleabRTyUEkUfS2T3EY41dYDCXdQubTDmeuphtak YuzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr1si835668ejc.474.2020.12.01.14.34.34; Tue, 01 Dec 2020 14:34:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729117AbgLAMQH (ORCPT + 99 others); Tue, 1 Dec 2020 07:16:07 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:8479 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgLAMQH (ORCPT ); Tue, 1 Dec 2020 07:16:07 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Clgyx4s0YzhlQd; Tue, 1 Dec 2020 20:15:05 +0800 (CST) Received: from [10.174.184.209] (10.174.184.209) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 1 Dec 2020 20:15:15 +0800 Subject: Re: [RFC PATCH v1 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side To: Marc Zyngier CC: James Morse , Julien Thierry , Suzuki K Poulose , Eric Auger , , , , , Christoffer Dall , Alex Williamson , Kirti Wankhede , Cornelia Huck , Neo Jia , , 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> <274dafb2e21f49326a64bb575e668793@kernel.org> From: Shenming Lu Message-ID: <59ec07e5-c017-8644-b96f-e87fe600c490@huawei.com> Date: Tue, 1 Dec 2020 20:15:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <274dafb2e21f49326a64bb575e668793@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.184.209] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/1 19:50, Marc Zyngier wrote: > 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. I am not familiar with it... > > It is obviously too late to change the userspace interface, but I wonder > whether we missed something at the time. The interface seems to be really asymmetrical?... Or is there a possibility that we could know which irq is hw before the VFIO device calls kvm_vgic_v4_set_forwarding()? Thanks, Shenming > > Thanks, > >         M.