From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7276A20FAB7 for ; Fri, 10 Jan 2025 14:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736517723; cv=none; b=bIWAXS+ChF17XYHyvsvEFEmv501XKyVJtHagBdZcoxmbhYgufnIse2GNccZ6YcY84yhSgRKRlmR7+SZ0Q8UKXpvIpTAtPUyKgY07hy40g7tsvcAOwb9XWCpCGMTRglJaT+YCV27nV8oavy6H8t3al4wPykVPBZV5MF0cy1pzE80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736517723; c=relaxed/simple; bh=jkblsDlsUSxYsT+VxyH05FNCYvRrKBfkKwtrrzDlM7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l1p4Xl9UG77bNZ9qEVhLxW8LkcMb3kUPVK224yzS1WRsvvyoTPIjU6UCXJ7nyjIGHCZN92moZh39O4xazC9niOAB7QwMDzCiD1VT/Ou2T+gV8uqszXW+CBYO4plfBDx1YJlpjCmJbIZwFmMBd2E7QYFrT6ctMW9kiJmMRv8yNVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=cloud.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=S+hzhv5r; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="S+hzhv5r" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-aaeec07b705so338209266b.2 for ; Fri, 10 Jan 2025 06:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1736517719; x=1737122519; darn=vger.kernel.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=S+hzhv5rircbWM0IFWempym1Mth+Urk9ahOV/UUkFYoik9QDdmdU2Zme+JVf//ftNP OYX+gwnPKh/2K/YUry34z7gkV+/mtrAsjPXUybeMCGXWvdUkdaJmgOarQgnycHMTpPRz zBkFHEFhkvWMSdj6rwrnsm5yLi04+UObVaVx4= 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=uBWxshaCEl5YVaOoZroauF4J1Zs6eXlHYVRDFCzVHQxjkX9Gp/pmrwCIrVD4eQsg5R EFBncxu0buPaVu4btc7RrxhjonYzuX+3Yx1HbDY6ENa4r8dq0jSbliIlZI3ZnN64CUok 1VQZ8bJmtCoTbfgGEYq4HF+uBPKTy/W9QOLmJWaCK3dh3su4vQDQ9R0YZeJJvyshnz1R nXmo68GevEK5Lj9jbvlCbOSRwjzjiQuEMN2YkiJ7fJsn5KMUNbsvxnkT+eJyOTTM/lH5 8u9FRJqg1iNefFO3D3e0fn4fVahtjmkDoP4iPA8L4/ffxATwtvOy5LgctcTwPZWuId8u /8Pw== X-Gm-Message-State: AOJu0YwhPtuG3B8fs/8uHaLps+IT+pDWoInrg1yVyBp9bZqhWrQ6iyh2 YHyCgCg3h4o+NULlB0Ma/3HS8zxX3o6JB5iAG/T78onwKcWyxtDVfL5pXvM0zgKQFOH6xl0pvuD u X-Gm-Gg: ASbGncuOoqq+6RKvvXOqqU6b43x97n4cl0lbLF3rvkDBPNHGWff2UDEdFzfqfGN7/DB fQUXM6KUQdoEiRlZF+dhVp0+Ql3kU5pLqRdyUPSLvHaI25ckzqzxbE20T2SHdf/9oi6toO+grxk X3yYyf2Fak4VSOIYSb3Zu3K9TqK2vQXEG+PrMXWl/vpdS2FHpU6brKrIDHX3tYpGWM0mtDy7GYI Zdu4zLK5KhgHfVRvJa5UjMlSa+fm+OKMNgksCApX66NeNd3it/E0HaTOfypiHLH9vI= 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) 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) 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSI remapping bypass (directly configuring MSI entries for devices on the VMD 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é --- 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; + 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 &= ~VMD_FEAT_CAN_BYPASS_MSI_REMAP; + if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20)) return -ENOMEM; -- 2.46.0