From nobody Tue Nov 18 10:36:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1609863333; cv=none; d=zohomail.com; s=zohoarc; b=Xc6LK5ZzpZIx7C/hmBEyL7vUAlA1aXyKkoHJYFsDKYlSvvcIOeKw5Q+IRWf9ebOvuxjVeVNVq8eEdheZhtU+DukJ5LeN3UeY1CGP2v4CKgF49sFkHf5Wap9p+hXZo5ITkYhvmSh4mSnQVL1u+gkwHqUmYwV4M2NwxX5fEj7uqzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609863333; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=NGyyMYC4NX25akUfdhxaZx7oWjC1IY23mvLcE6D2HUo=; b=j7dmCudzGdPqVINuZkuAgOz3EQIW8jwMQDBj3EdfMeRMBnIBgQbODWw+W5cxh1Uh+2UplwxEv0vl8sxgV+KMbq91/gnhyczVA6FHDvfdgPmvRBKd0bgqVAVdhFmIx30zz7kDOTXWr3zzfn9qgoOrnAoJrbJAs6zz55qIL8FobOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1609863333253772.5810116640095; Tue, 5 Jan 2021 08:15:33 -0800 (PST) Received: from localhost ([::1]:55454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwozb-0005Ea-WA for importer@patchew.org; Tue, 05 Jan 2021 11:15:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwota-0003yE-9n for qemu-devel@nongnu.org; Tue, 05 Jan 2021 11:09:18 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwotV-0003tW-Qi for qemu-devel@nongnu.org; Tue, 05 Jan 2021 11:09:18 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 105FsjBG094307; Tue, 5 Jan 2021 16:09:10 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 35tebasjvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 05 Jan 2021 16:09:10 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 105FuOrS029185; Tue, 5 Jan 2021 16:09:09 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 35uxnsvb3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jan 2021 16:09:09 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 105G98Lw003432; Tue, 5 Jan 2021 16:09:08 GMT Received: from ca-dev63.us.oracle.com (/10.211.8.221) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Jan 2021 08:09:08 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2020-01-29; bh=NGyyMYC4NX25akUfdhxaZx7oWjC1IY23mvLcE6D2HUo=; b=owCisJxf5HenCB6g26Dq4aQHRJUvbggF+nHlV2hRieXJWxvQipcSBjCwh0dbSpASMwIM 7S9o2KDufdmV3g8Z/gMCXRXURSZHJH4vMkD9Rk6+FeKKCl03yuDtBlcWAD/PiwB09T1E 6mizt4E5FfNiX97rFIQKDzjoY4Q0d8pM/hMqWA9spjUJhWo9ug8ns9duWusUWq7dH7gR ScBFaonK26lNJWP7xOhvL38ajeUk7I7l8iBI+z2rNoDEhR5v6wMldkoyrhGzaHyBvblq Qr2YBFWtCxeiEf0BxI4VLhXrkR7Bm3txonSX2vl1ItK2mG8NQPTBGaNEfCw5qgDqADIq 4g== From: Steve Sistare To: qemu-devel@nongnu.org Subject: [PATCH V2 10/22] pci: export functions for cpr Date: Tue, 5 Jan 2021 07:41:58 -0800 Message-Id: <1609861330-129855-11-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1609861330-129855-1-git-send-email-steven.sistare@oracle.com> References: <1609861330-129855-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101050099 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 mlxscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101050099 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=141.146.126.79; envelope-from=steven.sistare@oracle.com; helo=aserp2130.oracle.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.252, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daniel P. Berrange" , "Michael S. Tsirkin" , Jason Zeng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Alex Williamson , Steve Sistare , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Export msix_is_pending and msix_init_vector_notifiers for use by cpr. No functional change. Signed-off-by: Steve Sistare --- hw/pci/msix.c | 20 ++++++++++++++------ hw/pci/pci.c | 3 +-- include/hw/pci/msix.h | 5 +++++ include/hw/pci/pci.h | 1 + 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 67e34f3..52c8949 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -64,7 +64,7 @@ static uint8_t *msix_pending_byte(PCIDevice *dev, int vec= tor) return dev->msix_pba + vector / 8; } =20 -static int msix_is_pending(PCIDevice *dev, int vector) +int msix_is_pending(PCIDevice *dev, unsigned int vector) { return *msix_pending_byte(dev, vector) & msix_pending_mask(vector); } @@ -576,6 +576,17 @@ static void msix_unset_notifier_for_vector(PCIDevice *= dev, unsigned int vector) dev->msix_vector_release_notifier(dev, vector); } =20 +void msix_init_vector_notifiers(PCIDevice *dev, + MSIVectorUseNotifier use_notifier, + MSIVectorReleaseNotifier release_notifier, + MSIVectorPollNotifier poll_notifier) +{ + assert(use_notifier && release_notifier); + dev->msix_vector_use_notifier =3D use_notifier; + dev->msix_vector_release_notifier =3D release_notifier; + dev->msix_vector_poll_notifier =3D poll_notifier; +} + int msix_set_vector_notifiers(PCIDevice *dev, MSIVectorUseNotifier use_notifier, MSIVectorReleaseNotifier release_notifier, @@ -583,11 +594,8 @@ int msix_set_vector_notifiers(PCIDevice *dev, { int vector, ret; =20 - assert(use_notifier && release_notifier); - - dev->msix_vector_use_notifier =3D use_notifier; - dev->msix_vector_release_notifier =3D release_notifier; - dev->msix_vector_poll_notifier =3D poll_notifier; + msix_init_vector_notifiers(dev, use_notifier, release_notifier, + poll_notifier); =20 if ((dev->config[dev->msix_cap + MSIX_CONTROL_OFFSET] & (MSIX_ENABLE_MASK | MSIX_MASKALL_MASK)) =3D=3D MSIX_ENABLE_MASK) { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index de0fae1..7343e00 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -216,7 +216,6 @@ static const TypeInfo pcie_bus_info =3D { }; =20 static PCIBus *pci_find_bus_nr(PCIBus *bus, int bus_num); -static void pci_update_mappings(PCIDevice *d); static void pci_irq_handler(void *opaque, int irq_num, int level); static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom, Error= **); static void pci_del_option_rom(PCIDevice *pdev); @@ -1316,7 +1315,7 @@ static pcibus_t pci_bar_address(PCIDevice *d, return new_addr; } =20 -static void pci_update_mappings(PCIDevice *d) +void pci_update_mappings(PCIDevice *d) { PCIIORegion *r; int i; diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h index 4c4a60c..46606cf 100644 --- a/include/hw/pci/msix.h +++ b/include/hw/pci/msix.h @@ -32,6 +32,7 @@ int msix_present(PCIDevice *dev); bool msix_is_masked(PCIDevice *dev, unsigned vector); void msix_set_pending(PCIDevice *dev, unsigned vector); void msix_clr_pending(PCIDevice *dev, int vector); +int msix_is_pending(PCIDevice *dev, unsigned vector); =20 int msix_vector_use(PCIDevice *dev, unsigned vector); void msix_vector_unuse(PCIDevice *dev, unsigned vector); @@ -41,6 +42,10 @@ void msix_notify(PCIDevice *dev, unsigned vector); =20 void msix_reset(PCIDevice *dev); =20 +void msix_init_vector_notifiers(PCIDevice *dev, + MSIVectorUseNotifier use_notifier, + MSIVectorReleaseNotifier release_notifier, + MSIVectorPollNotifier poll_notifier); int msix_set_vector_notifiers(PCIDevice *dev, MSIVectorUseNotifier use_notifier, MSIVectorReleaseNotifier release_notifier, diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index c1bf7d5..bd07c86 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -865,5 +865,6 @@ extern const VMStateDescription vmstate_pci_device; } =20 MSIMessage pci_get_msi_message(PCIDevice *dev, int vector); +void pci_update_mappings(PCIDevice *d); =20 #endif --=20 1.8.3.1