Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1134904pxf; Fri, 12 Mar 2021 02:49:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+n6iWB7LUPRJwqkSyAhxCKPffOyciuk18e+pSf0G+PLJk8yHhiVyNSvYbIDXETCliOG4M X-Received: by 2002:a17:907:2062:: with SMTP id qp2mr7860824ejb.397.1615546186941; Fri, 12 Mar 2021 02:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615546186; cv=none; d=google.com; s=arc-20160816; b=0S8BFIIieolWnQx4zvSP9GC+hSSGzDI8ydOQokcZUsfTRx/tR0infKfUYX3o6xfvR8 1iO3yygx+bonuqyLQRowxUKlZ2vat5JRLDTDxHjgS/LLN6jnRlgG2VHmUfcyyJ7xD6i9 rmczP2PIkqKMrVA11RkVkPMLHwf2rGqPIrhPYe1cWSyRlbZHcyvGHN5BgVJs8FWmQdJT 6S6vNJATXsqdU5A1MK19bUWp/Vhvltyt4i/5PTDVaS9DD58LkZp5G/ybQzT4aK+GT+v9 ooTfINGTHDtyK/GVLmAo6nQirG/BYkEjfeIMVqCzBhkqRnuPX8HwmVQAu140T9jPJokl RONQ== 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=488vDjtiQ+tXa2V0QqqOhi6IVIddABE5UF3YLXDFk/Y=; b=l9qETSSk0A2MiE1881CsblU4iDq8KEit1bu0+Pf3fcEkdH6fYyHxsmwjewLMs+Fx7O BlNKL6Nymahwr3Z6RybOosqe7pDfY8N/ZYhWrUtQ12JvtMsjXF3IlSzMNsqiZvbTQ1Ru IJqmBrvgxWImCBQi4BQmQ9+XcUWL8sGUIvBTdqL4DRDLz0nwJq2SUHmydKuK1QzVfupo HWIrbKqdBNct/uzhDOHcHjQUPxkhOpxVLS7Qamwn+Zzb/835MPVv4rIDTUta43z38mDW KXi7HH4liknODPrKo7FpgQVejrUQmhSZl/5n/HEjdM1U3gEi+4x3kSxKfNa0BLBYTHRJ sr5w== 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 w16si3985719edd.471.2021.03.12.02.49.24; Fri, 12 Mar 2021 02:49:46 -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 S231752AbhCLKrr (ORCPT + 99 others); Fri, 12 Mar 2021 05:47:47 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:13886 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233497AbhCLKrP (ORCPT ); Fri, 12 Mar 2021 05:47:15 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DxjBr137Kz8x4p; Fri, 12 Mar 2021 18:45:24 +0800 (CST) Received: from [10.174.184.135] (10.174.184.135) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Fri, 12 Mar 2021 18:47:04 +0800 Subject: Re: [PATCH v3 2/4] KVM: arm64: GICv4.1: Try to save hw pending state in save_pending_tables To: Marc Zyngier CC: Eric Auger , Will Deacon , , , , , Alex Williamson , Cornelia Huck , "Lorenzo Pieralisi" , , References: <20210127121337.1092-1-lushenming@huawei.com> <20210127121337.1092-3-lushenming@huawei.com> <87v99yf450.wl-maz@kernel.org> <3b47598f-0795-a165-1a64-abe02258b306@huawei.com> <87lfasg2wt.wl-maz@kernel.org> From: Shenming Lu Message-ID: Date: Fri, 12 Mar 2021 18:47:04 +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: <87lfasg2wt.wl-maz@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.184.135] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/12 17:02, Marc Zyngier wrote: > On Thu, 11 Mar 2021 12:31:48 +0000, > Shenming Lu wrote: >> >> On 2021/3/11 17:09, Marc Zyngier wrote: > >>> I have asked that question in the past: is it actually safe to remap >>> the vPEs and expect them to be runnable >> >> In my opinion, logically it can work, but there might be problems like the >> one below that I didn't notice... > > One thing is that you will have lost interrupts in the meantime > (assuming your devices are still alive). How will you make up for > that? I think that devices should be paused for (not only) saving interrupt states, and in fact, that's exactly what such as VFIO devices do... > >> >>> >>> Also, the current code assumes that VMAPP.PTZ can be advertised if a >>> VPT is mapped for the first time. Clearly, it is unlikely that the VPT >>> will be only populated with 0s, so you'll end up with state corruption >>> on the first remap. >> >> Oh, thanks for pointing it out. >> And if we always signal PTZ when alloc = 1, does it mean that we >> can't remap the vPE when the VPT is not empty, thus there is no >> chance to get the VLPI state? Could we just assume that the VPT is >> not empty when first mapping the vPE? > > I think we should drop the setting of PTZ altogether. It is a silly > micro-optimisation, and if the HW can't parse the VPT efficiently when > it is empty, then the HW is pretty bad, PTZ or not. agree :-) Thanks, Shenming > > Thanks, > > M. >