From nobody Wed Feb 5 15:46:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1736517748; cv=none; d=zohomail.com; s=zohoarc; b=Ls9YjF8gKbmJ02zsusimlcjfjciSfBCR2H7dO6Et/MU8HWGSuRRCEbGieHRGijFVteTPbj/PPK5DbQxXGIAhnWlWLkxSACn2MehwNMTBovOYoQerRwW1Na7aYi/1j0wUcuyisOA23dTjImw8jB3aBhTXSi+1AxQNL+Uv0mK86io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736517748; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c/I7HoDRHZV0XTx2nTCcpli5SpYI0/lHKSshoL/AVNY=; b=icx3UrrFkqihZIu9JqxBFeCgsFKWj2cOqblQb0KmvSoH4E8q7AqWBXj991ONnsYlCVIBQCC/+92zKpBm4QHBiJ4DCJPqhPXgBzO3G0f16xiurnLkWmI9G5BpN48FQFGR2bDfYzHI9ZUctYyXmvC15VzEx/oxqwt9sRe6GVHSzeM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 173651774807896.32357980700556; Fri, 10 Jan 2025 06:02:28 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.869651.1281103 (Exim 4.92) (envelope-from ) id 1tWFaL-0008Lw-3h; Fri, 10 Jan 2025 14:02:01 +0000 Received: by outflank-mailman (output) from mailman id 869651.1281103; Fri, 10 Jan 2025 14:02:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tWFaL-0008Lp-0m; Fri, 10 Jan 2025 14:02:01 +0000 Received: by outflank-mailman (input) for mailman id 869651; Fri, 10 Jan 2025 14:02:00 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tWFaK-00087j-HY for xen-devel@lists.xenproject.org; Fri, 10 Jan 2025 14:02:00 +0000 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [2a00:1450:4864:20::62a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 75d56e1f-cf5b-11ef-a0df-8be0dac302b0; Fri, 10 Jan 2025 15:01:59 +0100 (CET) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso396605266b.3 for ; Fri, 10 Jan 2025 06:02:00 -0800 (PST) Received: from localhost ([84.78.159.3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95af680sm172606166b.141.2025.01.10.06.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 06:01:58 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 75d56e1f-cf5b-11ef-a0df-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1736517719; x=1737122519; darn=lists.xenproject.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=c/I7HoDRHZV0XTx2nTCcpli5SpYI0/lHKSshoL/AVNY=; b=QMinFTb7SbAa341SjgNGEyyBkdnnG5yi+3eqU9cWVeAoyldRz6kHfZtrMTHPPNHSVi C1XFLytJS6HM3QudySM16wCcgiHcXJHKSrup3U6j+ehsdooENjKcSEjQ8OrpLsVuhT0d hDIZCuFMOpqOI55mnNWKBBsh5oeoUDDTSvidc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736517719; x=1737122519; 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=c/I7HoDRHZV0XTx2nTCcpli5SpYI0/lHKSshoL/AVNY=; b=h7iejfp883N1VdvX9UARZ+1C62h/P0dboNePuQXqxRE1MEH9VRZ3yeylNu5M5jRlHF ygJgL6OcwlQLtoGq5y5MP9bF2mHgVXs1Uxg9++Fg7T9tZLmD2V6HXyJL86ROtUygG/qf JR8PwbTHjPVZ+PocyFH7UmV4FqaoirMlRVVKMNhtGapkkSTlVDPziPsQua3eTf8Fr0Tr fCEOgvPy7L9a05ToTKkxg6Rxe/PKa8mvUzlPw5abRUY5mBdUf2MscCMdCSvJR/mHTK1Z 5rNwQAZpZZYskln1rAUWAOCQZEUx/azVgd32vZq5sTsxrNqSkjOCRUoYafQRSXDh5sKP uHsw== X-Forwarded-Encrypted: i=1; AJvYcCUpZoKL7RkCA9YQwGjQOpDgataz5ls89gWPDQqLSqIvpI2fdQ8v1dbIY5IDDFsObqN+egVB02gvPU8=@lists.xenproject.org X-Gm-Message-State: AOJu0YwOmuG3ctGO8MiO8ZuK+aQx9HPFFs1F9fJ3Pgul6bEujSwrUxiP tMT2wNKT+2OJpkbhJ7o57HmcAJXTZzJvGfEU6sI9hwCq7ep3Tj45jdIMyVyFE14= X-Gm-Gg: ASbGncurGt2Wd22JaTu9/D+uIcq7yzu9F9n4zH8W58Is62WFgwkKM9kwBzYX0Upm6ri n6uSkJKxAXpt7UUYFf20ojvjiRMCQcg1xKyudc13Lmmcf2AtFDCadUTmXPpicP/R77ReUT1cf6k kvDWmTjTpgAi23Qa6nr5/etWp//5pLlYkVD2DlDOfIyIWoEoPs4Qb1KVyL4opaSfc9TxmXWonkI cSwBrS0F89GDyuqq345CyZ81zBC8M3aYBfCRz8Z6OPueOqN5QockFwJhC8ItG4l19A= X-Google-Smtp-Source: AGHT+IHQABlx0ljsChy/AaNgLOa5tG+fbxwnozWPPmywCwKrdUKAOZN8SDFE4NcVHC8wzrW5y/A8Dw== X-Received: by 2002:a17:907:c588:b0:ab2:c208:732d with SMTP id a640c23a62f3a-ab2c2087cbbmr743393166b.40.1736517719125; Fri, 10 Jan 2025 06:01:59 -0800 (PST) From: Roger Pau Monne To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-pci@vger.kernel.org Cc: Roger Pau Monne , Nirmal Patel , Jonathan Derrick , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas Subject: [PATCH 2/3] vmd: disable MSI remapping bypass under Xen Date: Fri, 10 Jan 2025 15:01:49 +0100 Message-ID: <20250110140152.27624-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20250110140152.27624-1-roger.pau@citrix.com> References: <20250110140152.27624-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1736517752519019000 MSI remapping bypass (directly configuring MSI entries for devices on the V= MD bus) won't work under Xen, as Xen is not aware of devices in such bus, and hence cannot configure the entries using the pIRQ interface in the PV case,= and in the PVH case traps won't be setup for MSI entries for such devices. Until Xen is aware of devices in the VMD bus prevent the VMD_FEAT_CAN_BYPASS_MSI_REMAP capability from being used when running as any kind of Xen guest. Signed-off-by: Roger Pau Monn=C3=A9 --- drivers/pci/controller/vmd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 264a180403a0..d9b7510ace29 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -965,6 +965,15 @@ static int vmd_probe(struct pci_dev *dev, const struct= pci_device_id *id) struct vmd_dev *vmd; int err; =20 + if (xen_domain()) + /* + * Xen doesn't have knowledge about devices in the VMD bus. + * Bypass of MSI remapping won't work in that case as direct + * write to the MSI entries won't result in functional + * interrupts. + */ + features &=3D ~VMD_FEAT_CAN_BYPASS_MSI_REMAP; + if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20)) return -ENOMEM; =20 --=20 2.46.0