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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AF21C43334 for ; Tue, 12 Jul 2022 12:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbiGLMzZ (ORCPT ); Tue, 12 Jul 2022 08:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbiGLMzW (ORCPT ); Tue, 12 Jul 2022 08:55:22 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68256AB6AB; Tue, 12 Jul 2022 05:55:21 -0700 (PDT) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Lj0yz4JJYz1L8sH; Tue, 12 Jul 2022 20:52:43 +0800 (CST) Received: from [10.40.193.166] (10.40.193.166) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 12 Jul 2022 20:55:16 +0800 From: "chenxiang (M)" To: Alex Williamson , , CC: , chenxiang via , linux-kernel Subject: [QUESTION] Exception print when enabling GICv4 Message-ID: <6d6d61fb-6241-4e1e-ddff-8ae8be96f9ff@hisilicon.com> Date: Tue, 12 Jul 2022 20:55:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.193.166] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500016.china.huawei.com (7.221.188.220) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I encounter a issue related to GICv4 enable on ARM64 platform (kernel 5.19-rc4, qemu 6.2.0): We have a accelaration module whose VF has 3 MSI interrupts, and we passthrough it to virtual machine with following steps: echo 0000:79:00.1 > /sys/bus/pci/drivers/hisi_hpre/unbind echo vfio-pci > /sys/devices/pci0000\:78/0000\:78\:00.0/0000\:79\:00.1/driver_override echo 0000:79:00.1 > /sys/bus/pci/drivers_probe Then we boot VM with "-device vfio-pci,host=79:00.1,id=net0 \". When insmod the driver which registers 3 PCI MSI interrupts in VM, some exception print occur as following: vfio-pci 0000:3a:00.1: irq bypass producer (token 000000008f08224d) registration fails: 66311 I find that bit[6:4] of register PCI_MSI_FLAGS is 2 (4 MSI interrupts) though we only register 3 PCI MSI interrupt, and only 3 MSI interrupt is activated at last. It allocates 4 vectors in function vfio_msi_enable() (qemu) as it reads the register PCI_MSI_FLAGS. Later it will call system call VFIO_DEVICE_SET_IRQS to set forwarding for those interrupts using function kvm_vgic_v4_set_forrwarding() as GICv4 is enabled. For interrupt 0~2, it success to set forwarding as they are already activated, but for the 4th interrupt, it is not activated, so ite is not found in function vgic_its_resolve_lpi(), so above printk occurs. It seems that we only allocate and activate 3 MSI interrupts in guest while it tried to set forwarding for 4 MSI interrupts in host. Do you have any idea about this issue? Best regards, Xiang Chen