From patchwork Sun Dec 16 23:34:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 1014232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="3VWnsjNK"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43J0wH0PkBz9sD4 for ; Mon, 17 Dec 2018 10:33:33 +1100 (AEDT) Received: from localhost ([::1]:44187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYfuc-0007AP-B7 for incoming@patchwork.ozlabs.org; Sun, 16 Dec 2018 18:33:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYfuF-0007A9-1V for qemu-devel@nongnu.org; Sun, 16 Dec 2018 18:33:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYfuA-000139-3V for qemu-devel@nongnu.org; Sun, 16 Dec 2018 18:33:06 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:52696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYfu8-0000nY-Tv for qemu-devel@nongnu.org; Sun, 16 Dec 2018 18:33:01 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBGNT70q024834; Sun, 16 Dec 2018 23:32:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=Dtcv9kG/594XktgBpka9gscvnS79ucKxRNktCmQXvQQ=; b=3VWnsjNK/wg1fBJup7+7BeGfZ6RpLhNNMKiSwmSkrKfBDmSwoFyN7yh4tyeA5G2suYfi 32UjcJaXiP7qbZhPfEoN6SgxvhFHwz8+pDUSwYVSLFX2OFRhhDZGGIgpni/Z+jkHL4Na ZIDW3/bkaV/UeT66VyAUXaN6ofNJ8iACvljiPBOEK2UNlCVCVhlHpnV6UFFa/jVheUx4 QIPTh+qk5bEgFITC/Jia1uEx7qiVUwBTRELuiCn+GKfvhl/DG7ZduoE5N3B+NuK1r3Z1 yJ8tg7lSs/Ggk/PdEl9DhgZJ9sVA4vw2+21MaYYt9fmyDeHgTuN9bF6pK8Rouy9w6WLU tg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2pcq4dkdvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Dec 2018 23:32:56 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBGNWodQ029681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Dec 2018 23:32:50 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBGNWncG002847; Sun, 16 Dec 2018 23:32:50 GMT Received: from linux.cn.oracle.com (/10.182.71.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Dec 2018 15:32:49 -0800 From: Dongli Zhang To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 07:34:39 +0800 Message-Id: <1545003279-17233-1-git-send-email-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9109 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=876 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812160219 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [PATCH 1/1] msix: correct pba size calculation used for msix_exclusive_bar initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The bar_pba_size is more than what the pba is expected to have, although this usually would not affect the bar_size used for dev->msix_exclusive_bar initialization. Signed-off-by: Dongli Zhang --- hw/pci/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 702dac4..234c0a3 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -345,7 +345,7 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, char *name; uint32_t bar_size = 4096; uint32_t bar_pba_offset = bar_size / 2; - uint32_t bar_pba_size = (nentries / 8 + 1) * 8; + uint32_t bar_pba_size = QEMU_ALIGN_UP(nentries, 64) / 8; /* * Migration compatibility dictates that this remains a 4k