From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB3A9C433B4 for ; Fri, 7 May 2021 05:59:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9761613E8 for ; Fri, 7 May 2021 05:59:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9761613E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:CC:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=71TQ9ja9Qy2+JHWxgQhouNWaq8EbhjMoR9MMT9QdUNc=; b=of11IJwe/76SFi4XVrzlpsBhMF QEKSZsu6qhtzh6lCwVi7iSSSHL2zb8FWV+EJ674v3IOQz+gglMRL1LrLRTRpFJGgqvQSWOtkqPnAA FnpFuDV4rAEdnwR98EMCuI2ViezheuE++Z2piw6hft3f1CGfbLcZs0J2WHE3Z26h1HrbeXklDmafC gH2Oa5n/2U+w3QM+JlmeC0HvnpupHiKvySMaM3p7L8nEL6Y+1sCmbaZrvCv8AYyDWkB3IR6Cf2RpB CzrMVM7kDd7QRZRvEHHRUswu/dvbVSDujrzjyf0GvmjHGTECqliwZgQ528w4yDdUxfCikhVZ+PbNf 9TO+QVgg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1letUQ-006CiL-0g; Fri, 07 May 2021 05:57:30 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1letUN-006Ci9-8D for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 05:57:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:CC:To:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=0VdlX9To/ZrpyCDVW8ze2y15Ppk95jxzIThnBqQZQts=; b=lu670crAzdT2v0KQ5BlC/p65nW PdBH42xYB5GOoz/WEimH75xRyduklDRx/Dzfhadm8ArEU6IQq51tQ8SGSSaEOHHqeTUbRPTXzvj1q lYmL9s9N+YTTjfwdXWDnSM+P/lKa7WxwlMwIdqfEFOKCpt2dufEnQpnebL155m73iM5rtDPbvq3IA 0iXnOuzh+U4YcQxB17GbhDW+puOYwrKRAXZgjeYr85VZHJleOzHyVGqmnRE7atI1ce6rVkHI1SA68 izKV0IwFe313QYLenVWOmhqwEedPghUVbtqkZP/lHpV6kF26seB1PXl6SN7H/fDBudTQKj168j52Q z2fQpVOg==; Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1letUK-006bcM-9K for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 05:57:25 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Fc04j1xbLzqSvh; Fri, 7 May 2021 13:53:57 +0800 (CST) Received: from [10.67.77.175] (10.67.77.175) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Fri, 7 May 2021 13:57:04 +0800 To: , , , CC: Marc Zyngier , Alex Williamson , Cornelia Huck , Nianyao Tang , Bjorn Helgaas From: Shaokun Zhang Subject: Question on guest enable msi fail when using GICv4/4.1 Message-ID: <3a2c66d6-6ca0-8478-d24b-61e8e3241b20@hisilicon.com> Date: Fri, 7 May 2021 13:57:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [10.67.77.175] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_225724_542282_0D9DACD0 X-CRM114-Status: UNSURE ( 5.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [This letter comes from Nianyao Tang] Hi, Using GICv4/4.1 and msi capability, guest vf driver requires 3 vectors and enable msi, will lead to guest stuck. Qemu gets number of interrupts from Multiple Message Capable field set by guest. This field is aligned to a power of 2(if a function requires 3 vectors, it initializes it to 2). However, guest driver just sends 3 mapi-cmd to vits and 3 ite entries is recorded in host. Vfio initializes msi interrupts using the number of interrupts 4 provide by qemu. When it comes to the 4th msi without ite in vits, in irq_bypass_register_producer, producer and consumer will __connect fail, due to find_ite fail, and do not resume guest. Do we support this case, Guest function using msi interrupts number not aligned to a power of 2? Or qemu should provide correct msi interrupts number? Thanks, Shaokun _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel