Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp901072ybl; Fri, 13 Dec 2019 06:24:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxhhPRlZqG5UDXE6wPnQ8PsXyowe4u3aDuExyjWWyPUc1CPoNv79vIVJOcD4Ytyb/uv3q+O X-Received: by 2002:a9d:6d81:: with SMTP id x1mr15843148otp.9.1576247048219; Fri, 13 Dec 2019 06:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576247048; cv=none; d=google.com; s=arc-20160816; b=Cm3IMacBaU4PzTcttCSSqNgymtKlPY2YrlJ23N6UJ3FkNmTlcp80FT1YCqdHACWN7F d/nWyU1Ujx48YjoeKVrEOw0xzM/wfZ6cE6LIlAc0AtaPdztxBrsySGNJHDsT7lgEos/c buljJz/F6KA8NfWxGzwGjAMPP/och3eEx29+jVumezzLCR2q1b2Q3F5e60pqI3SxKB4v jNoC461xv9UuhJaxcJSqP52u3byQ6pRXXgjOfXNsiH1scBaAKOwJhuvipXYlP1tycpFc w36WxlZQhwPHCaCJI1tpOzp/AzqYr9NseMMJSY+XmhXBR5P3ZomwHWR8fJWHaO29w9FW jV3Q== 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=UJ5j/u2oWhJldWsBYpbgo7aplHsNcQlvyEG9fxKmzp4=; b=J5qB6fI9HcuBjg/vKgXnEAvqQe4tpXXyIi31g0IrCnkhOwFy5bxa97TGrSm7K09evp f5oi+gilLgHNvkfqfzkMJaUVdl2W/6TMnb9N/1vA8rPNwbPxdx11Cs9hRh4Dg9K8/mpm 3r3PcQTubu41Q71s37tw0eNxPLNA1d1erJPfrFzRxAaJpoA6Qzyxr48Bx2w4da7IcMic EvTy+qS4+xn9kCX79U2eVrb5H7ZcaPh4NvRHZiLeRTHQq9UvlhIp9eWrc9sLm71QZMq5 85v8d4CAem3uc+G8dKXuv+saiJveJTli1stP/NVdhIAJxkKW/XwmVkhIXigWSthtSf9p 21PQ== 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 h203si4764105oif.3.2019.12.13.06.23.54; Fri, 13 Dec 2019 06:24:08 -0800 (PST) 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 S1727690AbfLMOXF (ORCPT + 99 others); Fri, 13 Dec 2019 09:23:05 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7234 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727614AbfLMOXF (ORCPT ); Fri, 13 Dec 2019 09:23:05 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 28B05E28028A971DDEF3; Fri, 13 Dec 2019 22:22:56 +0800 (CST) Received: from [127.0.0.1] (10.173.222.27) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Fri, 13 Dec 2019 22:22:47 +0800 Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections To: Marc Zyngier CC: Eric Auger , , , References: <20191213094237.19627-1-eric.auger@redhat.com> <9e9e3ed65ddf40ab72528187089e0997@www.loen.fr> From: Zenghui Yu Message-ID: <066e4f57-9f92-2bd6-130a-b3c8bb0dcfc4@huawei.com> Date: Fri, 13 Dec 2019 22:22:46 +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: <9e9e3ed65ddf40ab72528187089e0997@www.loen.fr> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 2019/12/13 19:28, Marc Zyngier wrote: > Hi Zenghui, > > On 2019-12-13 10:53, Zenghui Yu wrote: >> Hi Eric, >> >> On 2019/12/13 17:42, Eric Auger wrote: >>> Saving/restoring an unmapped collection is a valid scenario. For >>> example this happens if a MAPTI command was sent, featuring an >>> unmapped collection. At the moment the CTE fails to be restored. >>> Only compare against the number of online vcpus if the rdist >>> base is set. >> >> Have you actually seen a problem and this patch fixed it? To be honest, >> I'm surprised to find that we can map a LPI to an unmapped collection ;) >> (and prevent it to be delivered to vcpu with an INT_UNMAPPED_INTERRUPT >> error, until someone had actually mapped the collection). >> After a quick glance of spec (MAPTI), just as you said, this is valid. > > Yes, this is one of the (many) odd bits in the architecture. And there is > a bizarre wording in the MAPC description when V=0: > > "Behavior is unpredictable if there are interrupts that are mapped to the > specified collection, with the restriction that further translation > requests > from that device are ignored." > > It is really odd that: > > - it is unpredictable to unmap the collection with mapped interrupts, >   but mapping interrupts to an unmapped collection is fine Yes, looks odd... Without Eric's patch, I won't even notice it. I guess that unmapping the collection with mapped interrupts will make it difficult for Hardware to manage those interrupts' internal states, but only a guess. > - the notion of "interrupts from that device" doesn't match any of the >   MAPC parameters Looks like a writing mistake, a better statement *might be* "further translation requests targeting that ICID are ignored"? > Do you hate the GIC already? ;-) Not yet! (I'd like to continue being messed with GIC and see when I will hate it :) > >> If Marc has no objection to this fix, please add >> >> Reviewed-by: Zenghui Yu > > Thanks for that, I've applied it to the patch and will push out > the update as soon as ra.kernel.org is reachable again. Thanks, Zenghui