Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp713642ybl; Fri, 13 Dec 2019 03:29:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwubbvZLQHkhtaPWI2eoEepR0Sn+3ngcy7Hj0JQlRLM28taF7T8IYrvAGXGPENpuY47WkqH X-Received: by 2002:a05:6830:1d4c:: with SMTP id p12mr14697596oth.198.1576236599168; Fri, 13 Dec 2019 03:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576236599; cv=none; d=google.com; s=arc-20160816; b=ny/flGN1D7HEVLa0CHEMyvUtQfXLJR2FTsCJO559LncAFDV/RjjtcENwucmXKBnqfZ gnPqQmRBUT91Co+RfI7e8LvqU5358bt2ETNPjEiQzr/JC7xfO0zy1AIdMxI1eoVPXXw3 G2D5S54oXRT6L04+aV5YJXTMGJoAyCFmLSPLujFEys4hkTuLBkdTGYHJcbS++pVyqllB S1riTMy0SJAPEWhFtQD2vKt8+PC+TgeUcRrbqwGIHUeLJtXifDYMeUf0bpcnPQBGe2xQ JVTOeczTrmXgPpM32o3EwMml4R/TxAflns1Wmd4jiZDAppF5K8Gse07BDGtfwoDnWc3L fWwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=UE29IMQ8KlteFfGCFFYAu++RQ+brexG2QAQJK3sPMYQ=; b=BqExvFm8irhEi9LRKHGmAmmejyttPFJd8ywJRdFdnzWrwOjxvKSCFSpDZl6ermmhgx NTb6MR/PQidZM4r5NDrya2eNIZBbNBz/oJZTdeql+/hwTfkg76Q7goIXWTwgTlTtbJTp ZnPBTybKJY4s2USvOGwKSxyxmSsj22u9p0uO7OJgseBFgqgyX5pt9LHHW95K7sQuC+Z3 YUQ6LYZegl+gjcIoAO+sm5FmHn7VExd9mB5yzU6X2+BwFsLv6AHUivf0rDPj6Vj64YrD vmMxEG/gzsf4x9YqZBB4hXpFoxS9r4lWMLczcXBsMBJS8fxKQOS/u8ugeTG7R+rKjyCj LoIw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si5445224otj.114.2019.12.13.03.29.46; Fri, 13 Dec 2019 03:29:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbfLML2u (ORCPT + 99 others); Fri, 13 Dec 2019 06:28:50 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:33168 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfLML2t (ORCPT ); Fri, 13 Dec 2019 06:28:49 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1ifj7k-0004JA-4j; Fri, 13 Dec 2019 12:28:44 +0100 To: Zenghui Yu Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 13 Dec 2019 11:28:43 +0000 From: Marc Zyngier Cc: Eric Auger , , , In-Reply-To: References: <20191213094237.19627-1-eric.auger@redhat.com> Message-ID: <9e9e3ed65ddf40ab72528187089e0997@www.loen.fr> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, eric.auger@redhat.com, eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 - the notion of "interrupts from that device" doesn't match any of the MAPC parameters Do you hate the GIC already? ;-) > 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. M. -- Jazz is not dead. It just smells funny...