From patchwork Wed Apr 24 20:42:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_Bene=C5=A1?= X-Patchwork-Id: 13642515 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.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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0C600C25B10 for ; Wed, 24 Apr 2024 20:42:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.711655.1111818 (Exim 4.92) (envelope-from ) id 1rzjRe-0005Kz-Cs; Wed, 24 Apr 2024 20:42:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 711655.1111818; Wed, 24 Apr 2024 20:42:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzjRe-0005Jq-4u; Wed, 24 Apr 2024 20:42:22 +0000 Received: by outflank-mailman (input) for mailman id 711655; Wed, 24 Apr 2024 20:42:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzjRc-0004Gx-PB for xen-devel@lists.xenproject.org; Wed, 24 Apr 2024 20:42:20 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 24a80008-027b-11ef-b4bb-af5377834399; Wed, 24 Apr 2024 22:42:19 +0200 (CEST) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5176f217b7bso478571e87.0 for ; Wed, 24 Apr 2024 13:42:19 -0700 (PDT) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id cd9-20020a170906b34900b00a5264576138sm8740067ejb.35.2024.04.24.13.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:42:17 -0700 (PDT) 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: 24a80008-027b-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713991338; x=1714596138; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JBfj+N3t2vst9UyJVN7uxPweKAIqyhS3H5x3l711fQA=; b=FaQmwM4dEoP/C/LsjQC3XSB8pioFJGsZbYeyfkUxcZTIgw9Fo9a+w571AhvGDYYgnE dpgUTzxrFPhVIfdpYu7w0+Z9/uyxTdJeArITGG7g57/bHCVN4v69jXJ/z7lojVpHRWZ8 buslYq6Azr8w/EBbv1CEPYulwn02NxHN0AnRCGLwWZHAHn2XsN68Hnh0+rC49v3r2l36 CJgPfuOXP+i2QJ3PnR5hE/RLQzC73QoyYUv8kKipM9LJUqyz+HWkV/hsEfI1GDQSs+im 0CBXlRGJIpb4YsY2BumeFs/V5dM57e7K7trQuQqmNj4sk5AIPjscOoRd53gYNagMbMX4 iVfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713991338; x=1714596138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JBfj+N3t2vst9UyJVN7uxPweKAIqyhS3H5x3l711fQA=; b=CwITv0IxUF5rpq0u/If6q1rxAGJ81BfsV9LiwS3Nc8Ye2z9SKFhSq2yz/u0rEhnpLK IJz3Iiy5RMr7D4k4V2q6hXw1MdDc9EBM33+bzVbbHkKyOEybbooTmAK5uSKvICiLjuZk /injfihX0fyix/i0RmsfVwHxedIKM+ibcxzfju57juhoSs4MQCo3eX2WiG+J1NyqHUvM 24tBKgrhGuTxY0mSer7AUmZ4IDtbSEANwrpFk7BtCJQIp5+nTmCnztJ9s4ePFp5RVltW rGsme1/Poyzw1yseUa+uoGnwJAWVLOQOeHNBpF50iEWiuiubl/jo+mCjjOVENeFWLCQ9 jJbg== X-Gm-Message-State: AOJu0Yy1JEqCaytKHAPJkeMiJH1ReLY+GEyGG2sBPZyMB3gIKMir3d9H ufIKS3YS3nQfQS+XsvkhZ+xFLIqxW61x/S/I+zK6LLV8ZqIBjjouMul+kL3q X-Google-Smtp-Source: AGHT+IGl5czEozgynTrUnsTEFba8tXwOaOGTAjiGH8fJprif433sUaL3kFhMwC+ZGaHuYI3+LEqBgg== X-Received: by 2002:a19:f813:0:b0:518:c82a:bdf9 with SMTP id a19-20020a19f813000000b00518c82abdf9mr2997959lff.44.1713991338189; Wed, 24 Apr 2024 13:42:18 -0700 (PDT) From: " =?utf-8?q?Petr_Bene=C5=A1?= " X-Google-Original-From: =?utf-8?q?Petr_Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Petr_Bene=C5=A1?= , Christian Lindig , David Scott , Anthony PERARD Subject: [PATCH 4/7] tools/ocaml: Add max_altp2m parameter Date: Wed, 24 Apr 2024 20:42:02 +0000 Message-Id: <9e9be821c2fe0ac4a7b66d652c10b2edbf5e42be.1713990376.git.w1benny@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 From: Petr Beneš Allow developers using the OCaml bindings to set the max_altp2m parameter. Signed-off-by: Petr Beneš Acked-by: Christian Lindig --- tools/ocaml/libs/xc/xenctrl.ml | 1 + tools/ocaml/libs/xc/xenctrl.mli | 1 + tools/ocaml/libs/xc/xenctrl_stubs.c | 17 ++++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index 55923857ec..ed851bb071 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -82,6 +82,7 @@ type domctl_create_config = iommu_opts: domain_create_iommu_opts list; max_vcpus: int; max_evtchn_port: int; + max_altp2m: int; max_grant_frames: int; max_maptrack_frames: int; max_grant_version: int; diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 9b4b45db3a..971b269d85 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -74,6 +74,7 @@ type domctl_create_config = { iommu_opts: domain_create_iommu_opts list; max_vcpus: int; max_evtchn_port: int; + max_altp2m: int; max_grant_frames: int; max_maptrack_frames: int; max_grant_version: int; diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 2b6d3c09df..0b70cc9b08 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -207,12 +207,13 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co #define VAL_IOMMU_OPTS Field(config, 3) #define VAL_MAX_VCPUS Field(config, 4) #define VAL_MAX_EVTCHN_PORT Field(config, 5) -#define VAL_MAX_GRANT_FRAMES Field(config, 6) -#define VAL_MAX_MAPTRACK_FRAMES Field(config, 7) -#define VAL_MAX_GRANT_VERSION Field(config, 8) -#define VAL_VMTRACE_BUF_KB Field(config, 9) -#define VAL_CPUPOOL_ID Field(config, 10) -#define VAL_ARCH Field(config, 11) +#define VAL_MAX_ALTP2M Field(config, 6) +#define VAL_MAX_GRANT_FRAMES Field(config, 7) +#define VAL_MAX_MAPTRACK_FRAMES Field(config, 8) +#define VAL_MAX_GRANT_VERSION Field(config, 9) +#define VAL_VMTRACE_BUF_KB Field(config, 10) +#define VAL_CPUPOOL_ID Field(config, 11) +#define VAL_ARCH Field(config, 12) uint32_t domid = Int_val(wanted_domid); uint64_t vmtrace_size = Int32_val(VAL_VMTRACE_BUF_KB); @@ -226,6 +227,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co .ssidref = Int32_val(VAL_SSIDREF), .max_vcpus = Int_val(VAL_MAX_VCPUS), .max_evtchn_port = Int_val(VAL_MAX_EVTCHN_PORT), + .max_altp2m = Int_val(VAL_MAX_ALTP2M), .max_grant_frames = Int_val(VAL_MAX_GRANT_FRAMES), .max_maptrack_frames = Int_val(VAL_MAX_MAPTRACK_FRAMES), .grant_opts = @@ -257,7 +259,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co #if defined(__i386__) || defined(__x86_64__) /* Quick & dirty check for ABI changes. */ - BUILD_BUG_ON(sizeof(cfg) != 64); + BUILD_BUG_ON(sizeof(cfg) != 68); /* Mnemonics for the named fields inside xen_x86_arch_domainconfig */ #define VAL_EMUL_FLAGS Field(arch_domconfig, 0) @@ -291,6 +293,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co #undef VAL_MAX_GRANT_VERSION #undef VAL_MAX_MAPTRACK_FRAMES #undef VAL_MAX_GRANT_FRAMES +#undef VAL_MAX_ALTP2M #undef VAL_MAX_EVTCHN_PORT #undef VAL_MAX_VCPUS #undef VAL_IOMMU_OPTS