From nobody Wed Jan 8 20:09:36 2025 Delivered-To: importer@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+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1733685549; cv=none; d=zohomail.com; s=zohoarc; b=aTTSu0TiKQ3NOfocMPZBW45LQ0WyardjYYY+CfFis1VQLDURCIuyr9rqLUL3M9MSaYZ2vAbuYcT0Juweson2X1jkcGuDC7/EhDjOh6s3/Mn5lJJlviWRv2WBka/13fp58pJkzvRVeqqmj0V6i7Ry/5X/OkMX6JIku/4VP9cjYOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733685549; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h3BoSGB7P8OJJqEoTDM7+AVqy5XBZWcK8vMNoo4I1hk=; b=G2qHaKi2sMM3jTCkWcmM3N7x+h62ZUJX+aPR+cM4wJzg+JB1khqk0LT2Z4rPcMKFRAfzTsmr2inL6C+8wRIAbw1yZI7sGIgwsmpgUyvH1h7c4uzHzEyr9UTK082El/v4G9NWTIm3G3fn7ZE4Rz7GPAP5lirIeO11+CPSHJ7vpJs= 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+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1733685549378271.16650422387863; Sun, 8 Dec 2024 11:19:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKMmr-0005JP-N2; Sun, 08 Dec 2024 14:17:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKMml-0005Iw-NV for qemu-devel@nongnu.org; Sun, 08 Dec 2024 14:17:44 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKMmj-0001Vr-R1 for qemu-devel@nongnu.org; Sun, 08 Dec 2024 14:17:43 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aa560a65fd6so669634766b.0 for ; Sun, 08 Dec 2024 11:17:40 -0800 (PST) Received: from localhost.localdomain (h082218084190.host.wavenet.at. [82.218.84.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa665119a06sm240350866b.121.2024.12.08.11.17.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 08 Dec 2024 11:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philjordan-eu.20230601.gappssmtp.com; s=20230601; t=1733685459; x=1734290259; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h3BoSGB7P8OJJqEoTDM7+AVqy5XBZWcK8vMNoo4I1hk=; b=1Gl3W/s3JXNjoVatDL29lRWGP2JPG+O4N7zWNk340QQbipXeuQbr9WtRGpgRp23RvW qOP/VaQ+Q8Zye51IQAoOC7p+KwBRDSlK3XB3W36DPY6n0E4BhGdT9+L7vbbHLDlEDsZv uO+RHvHyw+N4TM9JBS1D93qknQTmRrpODW3lBhwy8voPDD0BBWmdDPEkyCAcSSBKetjS zQZMY0+OzKAE+SuB3t/i4xTm5fkGR+fXpTvB+A3stVb1FaIGESv9sdr6OjNBhrrkoT/C 7EkWaLR2IqV585vkOVLmK0by/beOeaZFo+BIH2OZo2StO3AZnYxq0zeA2zGSf+p7Js+l C/tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733685459; x=1734290259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h3BoSGB7P8OJJqEoTDM7+AVqy5XBZWcK8vMNoo4I1hk=; b=LWBwkm8rNJ/CXVH2z4oWCQTcqTbjRUcpQ4+Wv+L3yN1GXqwjzLd5xeePMk7jB125HN UztRZ8vMrUJUrqhTd659ek3i1zZLK9z++spSgssPaEM0MCYa5wdbBmnK+r6Eck4+AJ1+ 8Co2QHoOcTscjG6YWD3sAmY3j9RMvs8Ku6AU8IeFYZd0htXLQ3PEHd5WYDiNWbjsiwVE hVvzvgKeT1e/A8qn7a9UF+lu/nDJ0gV0bIHlZJwoR5qUbEgHFcA4mj9DL8SX7QQH5w+U B4QXCqztM8SdKdVxE+oQhatiw5fOXTRIhXjwT6LVGTA7nWt3wDJotTXgVcNb8OMqLXLc frrg== X-Gm-Message-State: AOJu0YxMt00LkTodXMwbK8AT4A0gBBTf7KyXkMtj5SVyhBV2AW4D5mAl ztbHog6tr4iBNE1sx+KhquwRmel/mcNYsnPvbuLDSLkL0Qj903e1v3SLgLO69XM0HRhR2MkXy+X eLw== X-Gm-Gg: ASbGncuNG62vppSO4AMKG2bedSzXQ1DvVQDkJ+wOTc63166EAHUmDefH4PDbrFIbjyL GcR+UI7K0xmujQ+TryllDy5ooQe+PBcGcJFJ5hmE3WRIuYNNFa0egEQDl4T+iKbqA17CT2ML6/v zdnsB6gj+ZL1j7Tk7etsap1FLux7AW55xWoJxMJSdAB73c1LqCkZZ/F0JP8HVJuHRU0lRyuCiqE k7fvCJPO5ZnqKwlHLESFKNO6zafLO6ARcnlkH8lnJACLAtNyrw3uSRKH0pwZSGTX/sMhzjGRLZ6 pA6N41KLs4cFlSsbcFk43v4sSg== X-Google-Smtp-Source: AGHT+IHaYl5CqQoxB+CLjhFxgkNPtEow3xA0EplaiR3IpyclqIxYyKoLa+w2uJiFDLFVpAecQqzhbg== X-Received: by 2002:a17:907:950f:b0:aa6:6ca2:b774 with SMTP id a640c23a62f3a-aa66ca2b86emr434968366b.6.1733685458900; Sun, 08 Dec 2024 11:17:38 -0800 (PST) From: Phil Dennis-Jordan To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, philmd@linaro.org, thuth@redhat.com, zhao1.liu@intel.com, imammedo@redhat.com, akihiko.odaki@daynix.com, Phil Dennis-Jordan Subject: [PATCH 1/6] hw/usb/hcd-xhci-pci: Don't trigger MSI on higher vector than allocated Date: Sun, 8 Dec 2024 20:16:41 +0100 Message-Id: <20241208191646.64857-2-phil@philjordan.eu> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241208191646.64857-1-phil@philjordan.eu> References: <20241208191646.64857-1-phil@philjordan.eu> MIME-Version: 1.0 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: neutral client-ip=2a00:1450:4864:20::62d; envelope-from=phil@philjordan.eu; helo=mail-ej1-x62d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @philjordan-eu.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1733685551974116600 Content-Type: text/plain; charset="utf-8" QEMU would crash with a failed assertion if the XHCI controller attempted to raise the interrupt on a higher vector than the highest configured for the device by the guest driver. This change adds a check so the interrupt is dropped instead of crashing the VM. Signed-off-by: Phil Dennis-Jordan --- hw/usb/hcd-xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index a039f5778a6..376635e889b 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -73,7 +73,7 @@ static bool xhci_pci_intr_raise(XHCIState *xhci, int n, b= ool level) return true; } =20 - if (msi_enabled(pci_dev) && level) { + if (msi_enabled(pci_dev) && level && n < msi_nr_vectors_allocated(pci_= dev)) { msi_notify(pci_dev, n); return true; } --=20 2.39.5 (Apple Git-154)