Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1791078rwb; Fri, 23 Sep 2022 19:34:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/2LMMmo0yZGTthOWHiRL5vwYblBEYDFLrj8h+1ll1ePH7MC2CmgMNh13RhIBlDj7/PvXy X-Received: by 2002:a17:902:e312:b0:176:9348:1f6e with SMTP id q18-20020a170902e31200b0017693481f6emr11414682plc.14.1663986863887; Fri, 23 Sep 2022 19:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663986863; cv=none; d=google.com; s=arc-20160816; b=Ym3sgZqTabg+39aaNQ6jqAM80tQ5RYYo3IuGBEPj8uyuNgzHefQZujOsukfICKG9jI zqiWIeMzlJ/Sss+6/Aw634nBS4FwPCUGqNiRqASGrLst8+2mxDpjU8djeKMJXc6n0/f+ GNVKxBwLWhaOlmsP8jgQOADseyVeQh3HtkELvuMWudBkwK3iJxNPo0GkLtnetAIi+GH9 A/4U42ulGjSODdk8HvJCr3wVhOSqHe0oAMekykJ2FEy2Cg0t4ZCclsiCvKQGZm3Kmh+R ibnZ2rrOl3Pz+6nGiZ/TNGzqnzCfBHNcA1FsoMF3PZvjM/JbQqTllVetVQTQrwvzr1vf Za5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hMic4amzrxFuZBuyEPL6OIRrHwr55mxS/oN2R1qZiio=; b=DwsTuQhrsNWVgTgOS7nRm0SmC0PRZdZ0RpX7sEPmIVp2+OdGyZc3XLMFpHPLIAJ7Bz ZclV3I+6ijY+ZX58tlTf6ODnSi+g+re6d7u2cfNbYKkF6NaXUDSEFWQffeyjJe1KjqjB ICRGiiF5mX3zq5Hh3k6Jv6EYTm/SGQ6Wb13B+RYr8WlmUzPCVGf/95oEXroTPXJ0YW8r GTFQ7KtvGDgHFZtbIhcYHEIoN4qa4mpKUyZSAzY9GXJM9c1eJ6WLu2FUVj82rkf8Df2o jZBXc92cCYNKtMvl7iPs3ZRiUl2XxcmiiJGqYgzwiXhB2C0mGnMRquP79dUQfe/ZTC05 ieeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a637351000000b0042bc6e8d3f7si11359100pgn.642.2022.09.23.19.34.12; Fri, 23 Sep 2022 19:34:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232968AbiIXCYv (ORCPT + 99 others); Fri, 23 Sep 2022 22:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232985AbiIXCYm (ORCPT ); Fri, 23 Sep 2022 22:24:42 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F27B32558D for ; Fri, 23 Sep 2022 19:24:39 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MZCQf2nNXzHtd0; Sat, 24 Sep 2022 10:19:54 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 10:24:38 +0800 Received: from huawei.com (10.69.192.56) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 24 Sep 2022 10:24:37 +0800 From: Longfang Liu To: , , CC: , , , Subject: [PATCH v3 2/5] hisi_acc_vfio_pci: Fix device data address combination problem Date: Sat, 24 Sep 2022 10:20:46 +0800 Message-ID: <20220924022049.12022-3-liulongfang@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220924022049.12022-1-liulongfang@huawei.com> References: <20220924022049.12022-1-liulongfang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The queue address of the accelerator device should be combined into a dma address in a way of combining the low and high bits. The previous combination is wrong and needs to be modified. Reviewed-by: Jason Gunthorpe Signed-off-by: Longfang Liu --- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 7ce656a7cf5c..0638a8a6b0c1 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -528,12 +528,12 @@ static int vf_qm_state_save(struct hisi_acc_vf_core_device *hisi_acc_vdev, return -EINVAL; /* Every reg is 32 bit, the dma address is 64 bit. */ - vf_data->eqe_dma = vf_data->qm_eqc_dw[2]; + vf_data->eqe_dma = vf_data->qm_eqc_dw[1]; vf_data->eqe_dma <<= QM_XQC_ADDR_OFFSET; - vf_data->eqe_dma |= vf_data->qm_eqc_dw[1]; - vf_data->aeqe_dma = vf_data->qm_aeqc_dw[2]; + vf_data->eqe_dma |= vf_data->qm_eqc_dw[0]; + vf_data->aeqe_dma = vf_data->qm_aeqc_dw[1]; vf_data->aeqe_dma <<= QM_XQC_ADDR_OFFSET; - vf_data->aeqe_dma |= vf_data->qm_aeqc_dw[1]; + vf_data->aeqe_dma |= vf_data->qm_aeqc_dw[0]; /* Through SQC_BT/CQC_BT to get sqc and cqc address */ ret = qm_get_sqc(vf_qm, &vf_data->sqc_dma); -- 2.33.0