From patchwork Fri Feb 10 22:27:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13136554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CFAAC636D4 for ; Fri, 10 Feb 2023 22:29:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQbrr-0002Fl-AL; Fri, 10 Feb 2023 17:27:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQbrp-0002Ex-EC for qemu-devel@nongnu.org; Fri, 10 Feb 2023 17:27:41 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQbrn-0007it-RB for qemu-devel@nongnu.org; Fri, 10 Feb 2023 17:27:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 122A161EB1; Fri, 10 Feb 2023 22:27:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B193AC4339C; Fri, 10 Feb 2023 22:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676068058; bh=P09GLhS3AipXDBR5fLwZN51vbqNBUqq+Ribpr8N2TSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdHOi3u6MjFMaot6R80JsW5NMv0Fmt1Q7tis7QVoGmKNYInkowgOr44bp4UdljZuK knoDytnciVJDSVVaiU+PPgT7w4Dys1IUqw6gXb5vGsXkZD1vAoLzk8aCG8dGAgp9Ce bFIF5MHWrclfZkCHe0FfiAI9/aUCwcVQWtXY5cXlGTqbp5X2yE30Hi2PqLQO6Qc/II AgLb0ZUtI1HMRfkx4UaqnQN0pBDABB2EuxqAcVtLip0VtLF2xYUkVWcX3SWOvC8oyC bRU1+4426hJY2iQ3YEnCGnFMKjFqda2F7XXmVcTq18eUkDS5rUiF4YPVAjc9n39/PI g4M5r/rcYJULA== From: Stefano Stabellini To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, peter.maydell@linaro.org, Stefano Stabellini , Vikram Garhwal , Paul Durrant Subject: [PULL 05/10] include/hw/xen/xen_common: return error from xen_create_ioreq_server Date: Fri, 10 Feb 2023 14:27:24 -0800 Message-Id: <20230210222729.957168-5-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=139.178.84.217; envelope-from=sstabellini@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Stefano Stabellini This is done to prepare for enabling xenpv support for ARM architecture. On ARM it is possible to have a functioning xenpv machine with only the PV backends and no IOREQ server. If the IOREQ server creation fails, continue to the PV backends initialization. Signed-off-by: Stefano Stabellini Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini Reviewed-by: Paul Durrant --- include/hw/xen/xen_common.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 9a13a756ae..9ec69582b3 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -467,9 +467,10 @@ static inline void xen_unmap_pcidev(domid_t dom, { } -static inline void xen_create_ioreq_server(domid_t dom, - ioservid_t *ioservid) +static inline int xen_create_ioreq_server(domid_t dom, + ioservid_t *ioservid) { + return 0; } static inline void xen_destroy_ioreq_server(domid_t dom, @@ -600,8 +601,8 @@ static inline void xen_unmap_pcidev(domid_t dom, PCI_FUNC(pci_dev->devfn)); } -static inline void xen_create_ioreq_server(domid_t dom, - ioservid_t *ioservid) +static inline int xen_create_ioreq_server(domid_t dom, + ioservid_t *ioservid) { int rc = xendevicemodel_create_ioreq_server(xen_dmod, dom, HVM_IOREQSRV_BUFIOREQ_ATOMIC, @@ -609,12 +610,14 @@ static inline void xen_create_ioreq_server(domid_t dom, if (rc == 0) { trace_xen_ioreq_server_create(*ioservid); - return; + return rc; } *ioservid = 0; use_default_ioreq_server = true; trace_xen_default_ioreq_server(); + + return rc; } static inline void xen_destroy_ioreq_server(domid_t dom,