Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp713398lqp; Thu, 21 Mar 2024 13:13:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEojf0ZbTBOnEnzVoheligwBhU8GTNKeD+bTJGCIQE6+mXzIn+FFnXB2yBsSDQVuKtVGWQTgcRq4Z3Ikgjb/j284fXF2v0EJK9Rxbn2A== X-Google-Smtp-Source: AGHT+IE71PYaJ5AWy/wbbTROOaZLKOVVt7NPlnLZrr6dn76mgSsfvCAYlCa8YlYYPTz/8aFD41Li X-Received: by 2002:a05:6a00:228f:b0:6ea:7ba2:5003 with SMTP id f15-20020a056a00228f00b006ea7ba25003mr81672pfe.13.1711052031244; Thu, 21 Mar 2024 13:13:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711052031; cv=pass; d=google.com; s=arc-20160816; b=nOjlCa9tn+pA6qOLcxceIeylEJ1pW/VS64DbF3wSGT8zb7Ksi5ajdbYOWQP8h5QK/O u/dBemZo3iqNu3acMd7b8ZW1Jk345MIy4NQ1yrKuG9pSbhOaHAr95GyzbbGOZJAjLD1S 29HdfDSeffb2O1KqAeVupC+8Mn6IVFq2Hf1hzm3QgdJeJh8l70x5azTy6NzaOxjWbQH6 NGeZ/5GcyL0glEwXbNhnE7aDz565WQDnjeuqFvtB9bYdauT8kZRuESb08feo6Q9vapW2 bhG1HYM6BQKd0xs/8ju7pNOCtdp+pVCR56584vgNbX4AvWm4yNOf4/iUgr+VLbSXTtvk gTBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qHQSYFW6naq35ObVo+HdD6KvGE9suXXRxl4fx/GumlI=; fh=SVJ+STWIo/TJWc1J3/MvgWRawrDE/b5R0U2yeFQYLfY=; b=UHiCSokh1vIMV51u7HCP5s8aqT7twZvIEJzZlIs3TPaYTlQz2/fIC0KBgku71drtQK H9kKJ6rj8C9K+oRusnhXckTl9LfFM+1YoI18BmjMDAEdFY/MGLaDiZBvqNNjvPP2uk8r cdIgTqPbO3yhtaYlxEHK9GzmCl2AhI+EXVK20tLULpo9igNLS8wQISBrZSbmaABoj4k9 gffANnxJJEGYVLBNE6PCInuiZTajxsjR4HT7xzw1VqFMKAdg7pL5SmUClFWfO/OTT2aQ dXQt1SMNp5VMxSeO6F7nAPkJ1rULEkZd+8v1KWpT9tUIjAt+jzqzzX5gg6ANktQee618 IOFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HfwItxjk; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x32-20020a631720000000b005d795f96f31si426654pgl.152.2024.03.21.13.13.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 13:13:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HfwItxjk; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D6BD9284CEA for ; Thu, 21 Mar 2024 20:13:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64037134730; Thu, 21 Mar 2024 20:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="HfwItxjk" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B50A256B98; Thu, 21 Mar 2024 20:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711052025; cv=none; b=XymJZzjfpoB69q/FGhQd18+P1rg0iqKLQB4P6EkvSp1Raaz5VhfxgVrxOdjPFnutQOEyoeWwpo0ZNCf/Qi6hegPG+fuSqwJBCBlt3+LmbtP+30u1iVv2A2+yEld7uQZLgUlrCjju0bSccJmwzXQtiZRi0G56HHZieefZ1mRfX44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711052025; c=relaxed/simple; bh=eqUKP9nKLYxZuiUOsalWiTxNBZj6HiNViNXk0RyRG4o=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=WdfuHaJSHVuVvcJfZ4ZwGPUhey2VVI0axorzYLII8wRzag1YOtDFugr2HqNDYlOgIX/6OBR2sf4s4HmIcRDQODrh0RXdgSsV2gJRn0RZR6wdG6PMHmW4Lo/WpGR9FpitFAnXkiCmyTgz4oLM5oA44ZZJSMCxE86Oh1kgPFd+rwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=HfwItxjk; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42LGDJKA022820; Thu, 21 Mar 2024 20:13:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=qHQSYFW6naq35ObVo+HdD6KvGE9suXXRxl4fx/GumlI=; b=Hf wItxjkLaI7Y9fjqrxhpnhlb0wDq2k42DfRlzDrCdJwRXaW07wE5YLw5BKMDFGyWW Df26pDosoxzBRaJ4pnZsb+Idtnk/06RLhwQFgu/D93wciihfNl54b5uYzAxvzdTD nPwlN/DK+LahUzbkMMZz14pZZyz3B1UnF9Fj/QqCtZe6+Znh18pa5fPG6pwrwARd +0fJPGiXavNrUU2vBoCe7Zk0rue1tpL+fuLI9rW+rfj9yjhTaahcGQtmBdAqenN6 Wg285NlvZdO/XfvL+XT9u0sKtrnt42gCjH+6fVPYckqDdNvIcSq+yVWwLYViQinS Eq0nXEi+N3hVATJv+0/w== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x0r7q8hd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Mar 2024 20:13:36 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42LKDZNK008234 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Mar 2024 20:13:35 GMT Received: from [10.110.74.135] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 21 Mar 2024 13:13:32 -0700 Message-ID: Date: Thu, 21 Mar 2024 13:13:31 -0700 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath11k: workaround to use VMs Content-Language: en-US To: Jose Ignacio Tornos Martinez , , , , , , "kernel@quicinc.com" CC: References: <20240321172402.346191-1-jtornosm@redhat.com> From: Jeff Johnson In-Reply-To: <20240321172402.346191-1-jtornosm@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 6FzYdFHB5veJmsqZS37PPOj2X1Phl9OR X-Proofpoint-GUID: 6FzYdFHB5veJmsqZS37PPOj2X1Phl9OR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-21_12,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 bulkscore=0 clxscore=1011 mlxlogscore=999 suspectscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403210150 On 3/21/2024 10:23 AM, Jose Ignacio Tornos Martinez wrote: > Currently, this driver is not working when the device is handled in a > Virtual Machine (PCI pass-through), as it was already reported here: > https://lore.kernel.org/all/fc6bd06f-d52b-4dee-ab1b-4bb845cc0b95@quicinc.com/T/ > Baochen Qiang focused the problem and described how to have it working > for a specific real MSI vector from host that needs to be used in VM too. > And this value, as it was commented, can change. > > The problem seems complex to me and I don't know if there is any easy way > to solve it. Meanwhile and using the information from Baochen Qiang, > since the use of VMs is very interesting for testing procedures, > I would like to just add this workaround that consists on adding a > parameter to pass the real MSI vector from host to the VM. In that way, > checking the 'lscpi' command output from host, it could be handled manually > or with some user tool in order to have the VM with the driver working. > Of course, if this parameter is not configured (zero value and default), > we will have the same behavior as always. > > Signed-off-by: Jose Ignacio Tornos Martinez > --- > drivers/net/wireless/ath/ath11k/pci.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c > index be9d2c69cc41..0e322956b10f 100644 > --- a/drivers/net/wireless/ath/ath11k/pci.c > +++ b/drivers/net/wireless/ath/ath11k/pci.c > @@ -31,6 +31,11 @@ > > #define TCSR_SOC_HW_SUB_VER 0x1910010 > > +static ulong ath11k_host_msi_addr = 0; > +module_param_named(host_msi_addr, ath11k_host_msi_addr, ulong, 0644); > +MODULE_PARM_DESC(host_msi_addr, > + "Workaround to configure the MSI address that is used from host in order to be used in VM"); > + > static const struct pci_device_id ath11k_pci_id_table[] = { > { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) }, > { PCI_VDEVICE(QCOM, WCN6855_DEVICE_ID) }, > @@ -443,6 +448,18 @@ static int ath11k_pci_alloc_msi(struct ath11k_pci *ab_pci) > > ath11k_pci_msi_disable(ab_pci); > > + if (ath11k_host_msi_addr) { > + ab_pci->ab->pci.msi.ep_base_data = 0; > + ab->pci.msi.addr_hi = (u32)(ath11k_host_msi_addr >> 32); > + ab->pci.msi.addr_lo = (u32)(ath11k_host_msi_addr & 0xffffffff); > + > + ath11k_dbg(ab, ATH11K_DBG_PCI, "msi addr hi 0x%x lo 0x%x base data is %d\n", > + ab->pci.msi.addr_hi, > + ab->pci.msi.addr_lo, > + ab->pci.msi.ep_base_data); > + return 0; > + } > + > msi_desc = irq_get_msi_desc(ab_pci->pdev->irq); > if (!msi_desc) { > ath11k_err(ab, "msi_desc is NULL!\n"); > @@ -482,6 +499,9 @@ static int ath11k_pci_config_msi_data(struct ath11k_pci *ab_pci) > { > struct msi_desc *msi_desc; > > + if (ath11k_host_msi_addr) > + return 0; > + > msi_desc = irq_get_msi_desc(ab_pci->pdev->irq); > if (!msi_desc) { > ath11k_err(ab_pci->ab, "msi_desc is NULL!\n"); + kernel@quicinc.com to make sure the Qualcomm VM experts are aware of this issue and to see if they have any additional suggestions.