From nobody Wed May 8 10:31:18 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622211837; cv=none; d=zohomail.com; s=zohoarc; b=SEiKe0ni7XQsfa6t87G3GYiRIuAPD88o1Zn5DwFF4zClw8tPRzIDFRLVyZYQ5J55g+dqlXK9C9FO1kR1o1OvqAWH99IhVgA9aT5bn00LFRtJnaDN6wEM/9Ezdy34DNG+AUYbtfm0KzW6Kxs9M3VMSgtVskAgayuBm427fRbdC8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622211837; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CJJnb/9LohL+6En9kA/oSnMYQrdF0TbGdKM6ZAV+UBM=; b=Sm0UoVjkcLhXO2uJYxniYuYOdH1XMBjD+vBqkDW63iXu/kXWQDTZzhfIKKGAdvgI2Inv38rm+8yNmVX6727ULWI3Dfatcg6e9lacGBiCD2IodUgpIxJyMyhbMBC4O3FCnzQvumJSWLy0MqPxyJvtwiOAONTKw8CaeJ4ZtraI8po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622211837082583.0402879114862; Fri, 28 May 2021 07:23:57 -0700 (PDT) Received: from localhost ([::1]:37404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmdP0-0005Gb-Ll for importer2@patchew.org; Fri, 28 May 2021 10:23:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNO-0003qt-KE for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNL-0001nI-JR for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:14 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-Y5mQ-EVaMdiKB6QFdtlytg-1; Fri, 28 May 2021 10:22:08 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A120425D1; Fri, 28 May 2021 14:22:07 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-84.ams2.redhat.com [10.36.112.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 202F0E16F; Fri, 28 May 2021 14:22:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B79EB18003AF; Fri, 28 May 2021 16:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622211730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJJnb/9LohL+6En9kA/oSnMYQrdF0TbGdKM6ZAV+UBM=; b=EXycgrE0JaDJFxbj6Xa2kJBm4yO6HGJK9hNdOZ+td3QDayI1kZo+Al69xyHVogyVV1j4EK S82Ad4CAckI/RBSfqdx6qtY1bnSzyf5AlJCAImSW6+C2xe2WpCmWYXJr07PzYuercYPVAb 7yoglg+TvM0XOYim6rcHJT5Ux/PnslY= X-MC-Unique: Y5mQ-EVaMdiKB6QFdtlytg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/3] hw/input/hid: Add support for keys of jp106 keyboard. Date: Fri, 28 May 2021 16:22:00 +0200 Message-Id: <20210528142202.2154592-2-kraxel@redhat.com> In-Reply-To: <20210528142202.2154592-1-kraxel@redhat.com> References: <20210528142202.2154592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Katsuhiro Ueno Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Katsuhiro Ueno Add support for the following keys: KATAKANAHIRAGANA, HENKAN, MUHENKAN, RO, and YEN. Before this commit, these keys did not work as expected when a jp106 keyboard was connected to the guest as a usb-kbd device. Signed-off-by: Katsuhiro Ueno Message-Id: Signed-off-by: Gerd Hoffmann --- hw/input/hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/input/hid.c b/hw/input/hid.c index e1d2e4608374..8aab0521f405 100644 --- a/hw/input/hid.c +++ b/hw/input/hid.c @@ -51,8 +51,8 @@ static const uint8_t hid_usage_keys[0x100] =3D { 0x45, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0xe8, 0xe9, 0x71, 0x72, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0xe7, 0x65, + 0x88, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x89, 0xe7, 0x65, =20 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, --=20 2.31.1 From nobody Wed May 8 10:31:18 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622211941; cv=none; d=zohomail.com; s=zohoarc; b=Rnv9gXWG1AuH+e5OTfD3FkU75CidbsYQaWmaxJlQh5N3++vB3IYbxEeGCuZ6+bgw0u8rVGpZU4omdtr0VlYeG7uiWnj9jsKmtFCzYDhr27ns/Bo3/V7LyBeU41nFzaexuJPZVmIIKGzM4ccdF9OYoENg6dQAKJYaYJKeh3wEtug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622211941; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pd+QmVgA1uX4NS1J5obOlelK6DlI/Xr4wVltSdty+l0=; b=e8oghCJOBz1IjV1cp4HbwE+XrKeReYxFA/iXy+0pnPsBx+pN8udFP7s1j2l1e+M3kyNpTZC15UD1LoEUWUmxFAf3WjLyLTLkV983rYYJrAtXWCPR2aNmYM2oko7PFdg6PoFPrpYxVEIJhy4UFHtKhRYeGrNXjDfvjQB7N5sCklY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622211941869760.2780249782571; Fri, 28 May 2021 07:25:41 -0700 (PDT) Received: from localhost ([::1]:41514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmdQi-00084K-4F for importer2@patchew.org; Fri, 28 May 2021 10:25:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNV-0003zD-LI for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNU-0001rz-2C for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-J1J7RTUmNmelqFIRwQy19w-1; Fri, 28 May 2021 10:22:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E00C107ACE4; Fri, 28 May 2021 14:22:12 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-84.ams2.redhat.com [10.36.112.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D4E460CD0; Fri, 28 May 2021 14:22:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C2942180079C; Fri, 28 May 2021 16:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622211737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pd+QmVgA1uX4NS1J5obOlelK6DlI/Xr4wVltSdty+l0=; b=DHyepadWeyVsUG0PNJAdNsKK7LHKNnwnAwNike1gpYAvhRkeBwuj5D7yyNvLj87oNfgpa+ YxeJsWAz/FVvQvgYlha9K/GFzQ12SXOysDjbXN9eiainCYnt3a6brMb96D+BoYsjkRrT7c qqFslePC9pZ4EF6GY6wNsUDp2Qd2fuk= X-MC-Unique: J1J7RTUmNmelqFIRwQy19w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/3] hw/usb: hcd-xhci-pci: Raise MSI/MSI-X interrupts only when told to Date: Fri, 28 May 2021 16:22:01 +0200 Message-Id: <20210528142202.2154592-3-kraxel@redhat.com> In-Reply-To: <20210528142202.2154592-1-kraxel@redhat.com> References: <20210528142202.2154592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bin Meng , Ruimei Yan , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Ruimei Yan At present MSI / MSI-X interrupts are triggered regardless of the irq level. We should have checked the level to determine whether the interrupt needs to be delivered. The level check logic was present in early versions of the xhci model, but got dropped later by a rework of interrupt handling under commit 4c4abe7cc903 ("xhci: rework interrupt handling"). Fixes: 4c4abe7cc903 ("xhci: rework interrupt handling") Signed-off-by: Ruimei Yan Signed-off-by: Bin Meng Message-Id: <20210521024224.2277634-1-bmeng.cn@gmail.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci-pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index 9421734d0fe2..b6acd1790c1a 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -67,12 +67,13 @@ static void xhci_pci_intr_raise(XHCIState *xhci, int n,= bool level) msi_enabled(pci_dev))) { pci_set_irq(pci_dev, level); } - if (msix_enabled(pci_dev)) { + + if (msix_enabled(pci_dev) && level) { msix_notify(pci_dev, n); return; } =20 - if (msi_enabled(pci_dev)) { + if (msi_enabled(pci_dev) && level) { msi_notify(pci_dev, n); return; } --=20 2.31.1 From nobody Wed May 8 10:31:18 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622211944; cv=none; d=zohomail.com; s=zohoarc; b=AV+j0Ql90BTSAfgntkDZLDBtlXKxl3JmyYnZaQNS2G6Q2gd7iA4Dwd9XwF3UfrtRRUzgtAlsNA1BqEwvQ7RtyO7eEfo5wK1/oT/lKgCBz4NUM6YNmpzLWSH1dE13LMlss4EUBsjhFv4W+vzA5bFUpMFmqGn3Qqpnc0y7BFj87Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622211944; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=foWSAqxuvmHuom0aGMBD1aSVCP5GIGA4uzRRkkgJuj4=; b=jfYeMxCOpo+HV0VKewDytGKOOv1q2oIe0KMEYmbXAswc0ESYiKbhoqeLxdeps0A+V2wwqKs1SJY24uAEj8JXTKtWbaNT4zwq+nP1dzYm6/YbUQnlXezxW5ttmgDBuPxLJBBAUNd8neI/y8RNPA3OciWiyz0jJJ085c1zluc962U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622211944848320.5117496441592; Fri, 28 May 2021 07:25:44 -0700 (PDT) Received: from localhost ([::1]:41618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmdQl-00088T-Td for importer2@patchew.org; Fri, 28 May 2021 10:25:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNV-00040C-VX for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmdNU-0001qs-10 for qemu-devel@nongnu.org; Fri, 28 May 2021 10:22:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-ep_QpBHzOMiH1N_TGLw1cA-1; Fri, 28 May 2021 10:22:13 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAF7C1007467; Fri, 28 May 2021 14:22:12 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-84.ams2.redhat.com [10.36.112.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3048B1002D71; Fri, 28 May 2021 14:22:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D32D71800982; Fri, 28 May 2021 16:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622211736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=foWSAqxuvmHuom0aGMBD1aSVCP5GIGA4uzRRkkgJuj4=; b=E8ZGICLsdjbi8RBg8AMfI7X7w601NApjrTvlRD06t/QX2Lsen8Tk14auS00n/Vg5GMLihP IDMm0Wd1YGMlb/Aaf2Y25bSw8h1u/JhKbgYONavRXn4REG7eh/5AYHswgv2P7US49dHBga Rjz0jDiklkRMzcsv7GId/N4cRwXeRIE= X-MC-Unique: ep_QpBHzOMiH1N_TGLw1cA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/3] hw/usb: hcd-xhci-pci: Fix spec violation of IP flag for MSI/MSI-X Date: Fri, 28 May 2021 16:22:02 +0200 Message-Id: <20210528142202.2154592-4-kraxel@redhat.com> In-Reply-To: <20210528142202.2154592-1-kraxel@redhat.com> References: <20210528142202.2154592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bin Meng , Ruimei Yan , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Ruimei Yan Per xHCI spec v1.2 chapter 4.17.5 page 296: If MSI or MSI-X interrupts are enabled, Interrupt Pending (IP) shall be cleared automatically when the PCI dword write generated by the interrupt assertion is complete. Currently QEMU does not clear the IP flag in the MSI / MSI-X mode. This causes subsequent spurious interrupt to be delivered to guests. To solve this, we change the xhci intr_raise() hook routine to have a bool return value that is passed to its caller (the xhci core), with true indicating that IP should be self-cleared. Fixes: 62c6ae04cf43 ("xhci: Initial xHCI implementation") Fixes: 4c47f800631a ("xhci: add msix support") Signed-off-by: Ruimei Yan [bmeng: move IP clear codes from xhci pci to xhci core] Signed-off-by: Bin Meng Message-Id: <20210521024224.2277634-2-bmeng.cn@gmail.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.h | 2 +- hw/usb/hcd-xhci-pci.c | 8 +++++--- hw/usb/hcd-xhci-sysbus.c | 4 +++- hw/usb/hcd-xhci.c | 8 ++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 7bba361f3bbd..98f598382adc 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -194,7 +194,7 @@ typedef struct XHCIState { uint32_t flags; uint32_t max_pstreams_mask; void (*intr_update)(XHCIState *s, int n, bool enable); - void (*intr_raise)(XHCIState *s, int n, bool level); + bool (*intr_raise)(XHCIState *s, int n, bool level); DeviceState *hostOpaque; =20 /* Operational Registers */ diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index b6acd1790c1a..e934b1a5b1fb 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -57,7 +57,7 @@ static void xhci_pci_intr_update(XHCIState *xhci, int n, = bool enable) } } =20 -static void xhci_pci_intr_raise(XHCIState *xhci, int n, bool level) +static bool xhci_pci_intr_raise(XHCIState *xhci, int n, bool level) { XHCIPciState *s =3D container_of(xhci, XHCIPciState, xhci); PCIDevice *pci_dev =3D PCI_DEVICE(s); @@ -70,13 +70,15 @@ static void xhci_pci_intr_raise(XHCIState *xhci, int n,= bool level) =20 if (msix_enabled(pci_dev) && level) { msix_notify(pci_dev, n); - return; + return true; } =20 if (msi_enabled(pci_dev) && level) { msi_notify(pci_dev, n); - return; + return true; } + + return false; } =20 static void xhci_pci_reset(DeviceState *dev) diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c index 42e2574c8298..a14e4381960e 100644 --- a/hw/usb/hcd-xhci-sysbus.c +++ b/hw/usb/hcd-xhci-sysbus.c @@ -16,11 +16,13 @@ #include "hw/acpi/aml-build.h" #include "hw/irq.h" =20 -static void xhci_sysbus_intr_raise(XHCIState *xhci, int n, bool level) +static bool xhci_sysbus_intr_raise(XHCIState *xhci, int n, bool level) { XHCISysbusState *s =3D container_of(xhci, XHCISysbusState, xhci); =20 qemu_set_irq(s->irq[n], level); + + return false; } =20 void xhci_sysbus_reset(DeviceState *dev) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 46212b1e695a..e01700039b13 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -551,7 +551,9 @@ static void xhci_intr_update(XHCIState *xhci, int v) level =3D 1; } if (xhci->intr_raise) { - xhci->intr_raise(xhci, 0, level); + if (xhci->intr_raise(xhci, 0, level)) { + xhci->intr[0].iman &=3D ~IMAN_IP; + } } } if (xhci->intr_update) { @@ -579,7 +581,9 @@ static void xhci_intr_raise(XHCIState *xhci, int v) return; } if (xhci->intr_raise) { - xhci->intr_raise(xhci, v, true); + if (xhci->intr_raise(xhci, v, true)) { + xhci->intr[v].iman &=3D ~IMAN_IP; + } } } =20 --=20 2.31.1