From patchwork Wed Jul 7 01:02:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 12361397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1997CC07E96 for ; Wed, 7 Jul 2021 01:03:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C13AB61CA0 for ; Wed, 7 Jul 2021 01:03:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C13AB61CA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.151786.280439 (Exim 4.92) (envelope-from ) id 1m0vxp-0000NG-5p; Wed, 07 Jul 2021 01:02:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 151786.280439; Wed, 07 Jul 2021 01:02:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m0vxp-0000N9-2s; Wed, 07 Jul 2021 01:02:57 +0000 Received: by outflank-mailman (input) for mailman id 151786; Wed, 07 Jul 2021 01:02:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m0vxn-0000N3-L7 for xen-devel@lists.xenproject.org; Wed, 07 Jul 2021 01:02:55 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0f3ba340-debf-11eb-84d2-12813bfff9fa; Wed, 07 Jul 2021 01:02:54 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0f3ba340-debf-11eb-84d2-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1625619774; h=from:to:cc:subject:date:message-id:mime-version; bh=svGxtjeWU2QEtWezfIyOjtpwm4dPoekGlQ1IL+Wj9bU=; b=BPii4c7hqGnV3j/NSCXXieZydnFNX130GIYvfarPVAwycXdd3sUBc4p9 k5UNJdp9rHPmqQBWR2PsZ2vtW5DxTkjvDFNx2PQHuw6QaLY6ZBdT4/qCj IYNal86tKlIY44FB1lLRv/I5Gg3Lm7dJ7R9HFcsfYE7IfNp/IfkQ8GYvA E=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: tMcjHEATz6LTqHmgq2WktRSk6PUNfBONgubEEnisX/+O10CWhChYsR+KAYpYhUboQgQFU/KWhj hLS+fWbd1wcAV62jOpNB1vQ7BzNQo2wVH/a+3Ok4+rAfHCzdeQ0ONr428NAdTMytAYWP9DGBZt 6KQmjeVczy4qRp+jiapcxILmHFwKbufxNjKT/OXfaq4f9YLNZapG9c5Xa2xGqVK2/qC7I9dTVr IFwWh6sG4Lb8uvFILNi+FqdsTn+eu4mVE17UhOoeZEDFrFGADZBm5vkN2+mJTm+uz4Yev50P9G I2s= X-SBRS: 5.1 X-MesageID: 47700246 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:7QK7yqNrDgS9K8BcTtejsMiBIKoaSvp037Eqv3oedfU1SL3+qy nAppQmPHPP5Ar5O0tQ/exoWpPwIk80nKQdieJ6UItKNDOW3VdAR7sC0WKN+VLd8lXFh4xg6Z s= X-IronPort-AV: E=Sophos;i="5.83,330,1616472000"; d="scan'208";a="47700246" From: Igor Druzhinin To: CC: , , , , , , , , , , Igor Druzhinin Subject: [PATCH] tools/libxc: use uint32_t for pirq in xc_domain_irq_permission Date: Wed, 7 Jul 2021 02:02:44 +0100 Message-ID: <1625619764-23537-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Current unit8_t for pirq argument in this interface is too restrictive causing failures on modern hardware with lots of GSIs. That extends down to XEN_DOMCTL_irq_permission ABI structure where it needs to be fixed up as well. Internal Xen structures appear to be fine. Existing users of the interface in tree (libxl, ocaml and python bindings) are already using int for pirq representation that should be wide enough. Domctl interface version is needed to be bumped with this change but that was already done by 918b8842a8 ("arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t") in this release cycle. Signed-off-by: Igor Druzhinin Reviewed-by: Jan Beulich Signed-off-by: Igor Druzhinin > Acked-by: Christian Lindig > --- tools/include/xenctrl.h | 2 +- tools/libs/ctrl/xc_domain.c | 2 +- tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +- xen/include/public/domctl.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 2a7c836..8974747 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -1385,7 +1385,7 @@ int xc_domain_ioport_permission(xc_interface *xch, int xc_domain_irq_permission(xc_interface *xch, uint32_t domid, - uint8_t pirq, + uint32_t pirq, uint8_t allow_access); int xc_domain_iomem_permission(xc_interface *xch, diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c index 7d11884..8e4ffd0 100644 --- a/tools/libs/ctrl/xc_domain.c +++ b/tools/libs/ctrl/xc_domain.c @@ -1384,7 +1384,7 @@ int xc_vcpu_setcontext(xc_interface *xch, int xc_domain_irq_permission(xc_interface *xch, uint32_t domid, - uint8_t pirq, + uint32_t pirq, uint8_t allow_access) { DECLARE_DOMCTL; diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 6e4bc56..e5837e6 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -1077,7 +1077,7 @@ CAMLprim value stub_xc_domain_irq_permission(value xch, value domid, value pirq, value allow) { CAMLparam4(xch, domid, pirq, allow); - uint8_t c_pirq; + uint32_t c_pirq; uint8_t c_allow; int ret; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 4dbf107..277478e 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -441,7 +441,7 @@ struct xen_domctl_setdebugging { /* XEN_DOMCTL_irq_permission */ struct xen_domctl_irq_permission { - uint8_t pirq; + uint32_t pirq; uint8_t allow_access; /* flag to specify enable/disable of IRQ access */ };