Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp613286ybb; Fri, 20 Mar 2020 05:10:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtGQ1NMgaHVBf0z7IwKnfs7jQehPzxjAgsUlZxhVsER+MPHLYFr1c7Dnvf1kfAzL65VNxBV X-Received: by 2002:a05:6808:8:: with SMTP id u8mr5928878oic.37.1584706216166; Fri, 20 Mar 2020 05:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584706216; cv=none; d=google.com; s=arc-20160816; b=F72uj1DCeLF8SKm/klgEnZ3LNN7wGt8i1wDXkcaTBKXdEBygliEh3FNBORm936JxvZ H0xPpjK42/vx7Euz4Fm3z9vp1RGNbycyaxoUx41ywlZprneB4ePXgAVpR9S5/eKWA6Ni wzqBwEDnUhXL7MlqYQCjYvb1JNZO59TxGhQBTpT7v2232uIgZm9RjcY5lK5MRzEy4kr1 tmqo6kVUhiQ8v0UGogBZx1uoxPbtHclNKipuFw2WINoQujzUPEvtUMHZRF4yWWHnu+ep C26STx4/VH29yUfHuonvE2oTK9YulOs56v7f9LKiTqIt1b4tXbd7d+gMhSTuK7NjpsfI bbPg== 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=blBKBsHU7MUiwDzp9KlaA3j1LWIIYHaSE9ArpnHoo38=; b=FSs6p9rC/31WIBOxUJyjyOm3X26TsxkXJW/yo0XURn1NV7pXpkH1ZXXS4TbITsKKg5 o4eW8djP115kUqOVHSI2A0BsIAhg6pLpzFCi6alS4BQBFbZccH6Zb7VG8DxE1wXRF+we 6Qg6OGr3PkyXPMxOym5qDTT/DVoXBBpNCiptP3LsoeuludMo0TYZLq2NGZL0z3gXgkl0 +DOBmbp++El77IV8bfexTe1hcu6O5fZ8kGmp7LRIuDcD0UoPvJsoDC/0koWed9khNwsI 9QMY2s2iuhz9tlePJFYWzFgBzu0az/yZ0g3/MKpUThBGGFQoW2f3NPO7iNWyGa6OHw8X eBFQ== 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 v22si2671140oia.165.2020.03.20.05.09.41; Fri, 20 Mar 2020 05:10:16 -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 S1727015AbgCTMJ0 (ORCPT + 99 others); Fri, 20 Mar 2020 08:09:26 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:43746 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726969AbgCTMJ0 (ORCPT ); Fri, 20 Mar 2020 08:09:26 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 01604CD906C56B9B967F; Fri, 20 Mar 2020 20:09:21 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Mar 2020 20:09:13 +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> <8d7fdb7f-7a21-da22-52a2-51ee8ac9393f@huawei.com> <40cbdf23c0f8bfc229400c14899ecbe0@kernel.org> From: Zenghui Yu Message-ID: Date: Fri, 20 Mar 2020 20:09:11 +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: <40cbdf23c0f8bfc229400c14899ecbe0@kernel.org> 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 19:46, Marc Zyngier wrote: >>> 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. > > Interesting. The ideal behaviour would be that the VPT is up-to-date and > the caches clean when Valid is cleared (and once Dirty flips to 0). > >> 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. > > The VMAPP stuff is purely v4.1. > >> 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)? > > No. But on VM termination, the memory will be freed, and will eventually be > reallocated. If the GIC can still write to that memory after it has been > freed, you end-up with memory corruption... Which is why I'm curious of > what ensures that on your implementation. Ah, I got it. I will check it with HiSilicon people next week and go back to you if the code becomes unsafe due to the incomplete GICv4. Thanks, Zenghui