Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp583402ybb; Fri, 20 Mar 2020 04:37:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtHuoy3gqNtG/wTBdFdapInsAPV8l9x6bR+TONwIqFIs5TDzWmuhq3AEKbU7QIeFdprdpuz X-Received: by 2002:a9d:22e9:: with SMTP id y96mr6204183ota.217.1584704273698; Fri, 20 Mar 2020 04:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584704273; cv=none; d=google.com; s=arc-20160816; b=IVUCe6yDj4YJxdzyr7o13jA12mon3KlDLOra7uDCgtsoNKNe/hGSV0EXa1K46NhnFX weF5bI4lt+5PItRMbNTijAnK7taI4GkGmRkHyHgokqpLhosR61SiZN6Wf7iLtrMuLNbJ RkVLipPaDqM0LYSBvp2t4a1KrE9lOmH/gXCWdWXEIgRJIQYPh2pYArgjxUKW7uHsVFYA hYcZNgv1Qe/78JHdCH8h+3S5fAOwyD1KlAnpflE+60jaeyZwCezcVzoYNGIAMe9uooNc O9ya1Yh6jUZjJetaFQITtf4VMXBP+EZUI/2EiBJWOCGTsSFaJsnwk85MC3ZqVRBB/nIP /jBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YAs2WghHMJKytIm5IbC1vOUMe0bvEYHrJPl2O3ZuEus=; b=LFhQugOQnF/DXWAD+0PWnqiLlA25YmnxpI4iQFw53lW1pXHonZNgyIuNl8sTGqPiay iAqkMrUdCoyBirSFFsMtQrp9H/yJSSAYiDKeo/Dnbou4kjy1ZPS1xd0UR2Abzb43SCeM S1QKwYL1IM5eu47TIN+/SaEZOLL5lCIj4FfWniS9yLStRogIToTGEfz1tTeOK1hc7ZLv L02LSfaGSP5hmoIwA6zlVrlXXvLBzP4JtYrO9tV/7vWPPwzK2X/uXl/Asdur21CSKmjN Jl3opx6qC7o6wuyuOqTKualvUKJWsROEIsXWt8b9nQs2bOMsVpiqAGrepZEVCmQcFkUK tjwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si2850298otn.285.2020.03.20.04.37.40; Fri, 20 Mar 2020 04:37:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbgCTLgB (ORCPT + 99 others); Fri, 20 Mar 2020 07:36:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:48830 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726814AbgCTLgA (ORCPT ); Fri, 20 Mar 2020 07:36:00 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 83C19E8B7FC2A4E3E951; Fri, 20 Mar 2020 19:35:48 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Mar 2020 19:35:41 +0800 Subject: Re: [PATCH v5 23/23] KVM: arm64: GICv4.1: Expose HW-based SGIs in debugfs To: Marc Zyngier CC: Auger Eric , , , , , Lorenzo Pieralisi , Jason Cooper , "Robert Richter" , Thomas Gleixner , "James Morse" , Julien Thierry , Suzuki K Poulose References: <20200304203330.4967-1-maz@kernel.org> <20200304203330.4967-24-maz@kernel.org> <4cb4c3d4-7b02-bb77-cd7a-c185346b6a2f@redhat.com> <45c282bddd43420024633943c1befac3@kernel.org> From: Zenghui Yu Message-ID: <8d7fdb7f-7a21-da22-52a2-51ee8ac9393f@huawei.com> Date: Fri, 20 Mar 2020 19:35:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.222.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 2020/3/20 17:09, Marc Zyngier wrote: > Hi Zenghui, > > On 2020-03-20 04:38, Zenghui Yu wrote: >> Hi Marc, >> >> On 2020/3/19 23:21, Marc Zyngier wrote: >>> With GICv4.1, you can introspect the HW state for SGIs. You can also >>> look at the vLPI state by peeking at the virtual pending table, but >>> you'd need to unmap the VPE first, >> >> Out of curiosity, could you please point me to the "unmap the VPE" >> requirement in the v4.1 spec? I'd like to have a look. > > Sure. See IHI0069F, 5.3.19 (VMAPP GICv4.1), "Caching of virtual LPI data > structures", and the bit that says: > > "A VMAPP with {V,Alloc}=={0,1} cleans and invalidates any caching of the > Virtual Pending Table and Virtual Configuration Table associated with the > vPEID held in the GIC" > > which is what was crucially missing from the GICv4.0 spec (it doesn't say > when the GIC is done writing to memory). OK. Thanks for the pointer! > > Side note: it'd be good to know what the rules are for your own GICv4 > implementations, so that we can at least make sure the current code is > safe. As far as I know, there will be some clean and invalidate operations when v4.0 VPENDBASER.Valid gets programmed. But not sure about behaviors on VMAPP (unmap), it may be a totally v4.1 stuff. I'll have a talk with our SOC team. But how can the current code be unsafe? Is anywhere in the current code will peek/poke the vpt (whilst GIC continues writing things into it)? Thanks, Zenghui