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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 4AAD3C64E7B for ; Tue, 1 Dec 2020 11:41:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC07B2086A for ; Tue, 1 Dec 2020 11:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730836AbgLALlH (ORCPT ); Tue, 1 Dec 2020 06:41:07 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:8901 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730664AbgLALlH (ORCPT ); Tue, 1 Dec 2020 06:41:07 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4ClgBR4j31z6vLd; Tue, 1 Dec 2020 19:39:59 +0800 (CST) Received: from [10.174.184.209] (10.174.184.209) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Tue, 1 Dec 2020 19:40:14 +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> From: Shenming Lu Message-ID: <9b80d460-e149-20c8-e9b3-e695310b4ed1@huawei.com> Date: Tue, 1 Dec 2020 19:40: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: <2ad38077300bdcaedd2e3b073cd36743@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 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. Thanks, Shenming > > Thanks, > >         M.