From nobody Sat Feb 7 10:16:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1659123297; cv=none; d=zohomail.com; s=zohoarc; b=Xjs86dPCakid8rVIbqo9XD/f8i5DrOueAjP3ZFUY6ralu/0pwlS6PjF8ky/Bzoswl2LwKlipKWDJsW65JJQEP4EkiVmN2hp3JqSuMnwSaBd9rCI8my7sg5dTZIqwWwg2dRS4SuG39bunqDJxq5f9ZIAjrFSs3v63/CvtBHgOWaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659123297; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Nctmn30ex3/VU6D4KECSFDmOOY9vKpIC+cakpOlvodU=; b=CphI95f39dbs6eqkLecrGDR+jWf5avhTBCxjdxBv2slrzvCuFt3Hf/VZ6vt3EtETYrx3QHIq5q0SsY/cxAEIXKSvwA4rhQ0CQjN7UEiZ8Li+yWtv5lbhrES6cfVIq8A4zf+StOaNMmTo8PsGlG1fihIWNycadCjH6EYc5Fsmkew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1659123297902421.4886133062979; Fri, 29 Jul 2022 12:34:57 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-DaToD2jHNSCGdXXDusiKmA-1; Fri, 29 Jul 2022 15:34:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 60F992812C30; Fri, 29 Jul 2022 19:34:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A90A40CFD0A; Fri, 29 Jul 2022 19:34:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C53E194D6D6; Fri, 29 Jul 2022 19:34:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0E126194D6CD for ; Fri, 29 Jul 2022 19:34:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 018E31415121; Fri, 29 Jul 2022 19:34:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F14A01415118 for ; Fri, 29 Jul 2022 19:34:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D45802812C46 for ; Fri, 29 Jul 2022 19:34:48 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2065.outbound.protection.outlook.com [40.107.21.65]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-v13P51j0OASMvCEDlmeR6A-1; Fri, 29 Jul 2022 15:34:44 -0400 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) by AM6PR04MB5654.eurprd04.prod.outlook.com (2603:10a6:20b:a3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Fri, 29 Jul 2022 19:34:42 +0000 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::6de4:cdb8:bebb:ac0]) by AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::6de4:cdb8:bebb:ac0%6]) with mapi id 15.20.5458.025; Fri, 29 Jul 2022 19:34:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659123296; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Nctmn30ex3/VU6D4KECSFDmOOY9vKpIC+cakpOlvodU=; b=Om1EpRqpILU+p81bA1naOlPfktMfyVVvNP4W1v0URnlDMqCOKALt8uaMBJ+veG7vbsqNCT 24QWuu2zBQkrGf3GMCCYxSyJNKtIJMbthJqW7UiC3WIpemjFGA8Qao4f9291Wcn6i+j5ht OOD+QMDXOD31oMv41IYlcToy1auyOH0= X-MC-Unique: DaToD2jHNSCGdXXDusiKmA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: v13P51j0OASMvCEDlmeR6A-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH V2 1/4] conf: Add support for specifying CPU max physical address size Date: Fri, 29 Jul 2022 13:34:33 -0600 Message-ID: <20220729193436.15575-2-jfehlig@suse.com> In-Reply-To: <20220729193436.15575-1-jfehlig@suse.com> References: <20220729193436.15575-1-jfehlig@suse.com> X-ClientProxiedBy: FR3P281CA0113.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::12) To AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a64b328-08c5-44c7-a0a7-08da71996272 X-MS-TrafficTypeDiagnostic: AM6PR04MB5654:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: FEGjIGfwNRFgyGHiiMIMJOlfcVwR7hWAkazgHiRKXLaPdig22FJ2LKhjRtqCXlQ9R6nB889yhptI1b63OFnXxcXTty7rvgta8IUa9Uak3pgs1hW/1UKEezPNruwAx9sdMS7QDzrIfBd6qZdQvnT+iIDXAJblNhmGNS6nwj2xo6zxiHB2hSNu1X4xAQGgYBrgDQagcmOPeNiR678wk6bNWKlpGnedxHu4AhDF+5Zk78wLpl9WgOeAG+VdVj+3zeB0c1JMK1k7kjmp7WujdpmWiephYxg5KYXvs5f8HA6H6Ct21CYqQ3c9u9a3jZSh+nfqlD+snmmWVq/XVU2OfzxxeLFrUJXrGZryvyfdbkf2PweX9QBU4BiG1Pzh981T7my266P5s4u2FUfGSZJFbogd7/wY9qkgcRA9tX5sD+K7l8ovnCcogyY0gKwu2I0y0QtEavwugzoWtlq7phxPZl4UZYMrVnOm08SPNuyEn8QbfbrJV9Te2h1QvhBlvA1rwXzs1Jjr/tn65z5RyYzM3IAlsdpbDYmniRw4NwiP7JZtHzMGhmD+om+xPxtFZxDmAIFX4XWILZIqBsKxxKf5CCIbmDKyKQFTbZq9wdkNoad7vNZypKs6WsZatKvLtLIMnRdvCLwq8qoDy2TJYWhqopdjdnH6o9xAwjGs+TITlTWqF5ssUtVkQAlIa4jVstVlqe8dSrps3oe8L1nrVoYDOMnPBPLVYOQ4aDDtp9g9P33e6w58PdrwZq/pJFGe1JRaleMT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4899.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(396003)(346002)(39860400002)(376002)(366004)(86362001)(6916009)(66556008)(316002)(8676002)(66476007)(4326008)(2906002)(8936002)(5660300002)(83380400001)(6666004)(6506007)(1076003)(478600001)(38100700002)(36756003)(6486002)(2616005)(186003)(107886003)(6512007)(41300700001)(66946007)(26005); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?v/kXY2OZxhlcluoUyPloTwYrcQcdjrQ2ptdRLBScobdRboNGa/GEZnNA4Daw?= =?us-ascii?Q?icGEdNEd+4Q49EQKrP3jQxn/JvayNV/sD4hkCRvH62GyR5bwiBo/lBC+7MYC?= =?us-ascii?Q?Z2IX3IHbgD8Kw1s1UoR7QCPugqbYKjyI+/5UkN0KijY5Qs5hn4qZyJb+kpGb?= =?us-ascii?Q?YBkDPZ2MjGFT2Z2cXKr7Ao/sIPoQOD2ISxiB4GUy75XdfCpOCVBIDcDbLxaO?= =?us-ascii?Q?xIR60IbocoE9X6dQFvN2oorTLwRVgtpKbuiRwdgJkfM44IN6RoOsYPpE7b1z?= =?us-ascii?Q?KKHKZjWrTfgvaJmQ3bLzExjA2EBe+28u5Y8SNu4lBmWkxBaQSjx3aDNxdKpU?= =?us-ascii?Q?2az/p8B06VE5qo2xzr+T7z+WgOgBwi6q5bLvzwq7ZbaE0z6WYvBQlvpkinrz?= =?us-ascii?Q?5JML+m5NVbfkkeyWewmdjeWGNzl67Ip7kaR1o0sTxksaH6nwT0Xa4bR7QADi?= =?us-ascii?Q?B/QI2ZMuim23X64RvwKOK3M4HOkB3/FrW+FwLoG8nMjrDWSwGyWxLySXDmGI?= =?us-ascii?Q?BI++/h/qJHvogjaRo1zssjDseSwAuoWWAUhKgR4jgJmmcS8Hv7iBjft2uBCO?= =?us-ascii?Q?3RLdaWPMimvqerczGdgc6Wxrgav/MBNgMrXCDbBAjUoGY4/oN+eAXonynU2o?= =?us-ascii?Q?6hMjau2LWrg/cLONHFE02G2L7b52xHZU5U50zawfWDz89NIol1+cBtFAq0t/?= =?us-ascii?Q?VQHlb0qsKztKCnaXN5VLNwIj77+GBCT/YqEjDnE7YBREG3l+TStVGnaAuavV?= =?us-ascii?Q?UG5xxXFSW/CI+iiD1MX55UpE9XoOUnWqszugAOM8C+U+m97hQ7HGB/Pdgf0M?= =?us-ascii?Q?9NN0gLXFODrnqAFTFkVUXPUfV+5Telcr6Q7M0Y5IHYjMO3l+wOTrIaCk1NGw?= =?us-ascii?Q?bDl8Tp+EdDto3YpLPdYhOBlQq13MYWB7lJDFmShugsv8ZjIx0147sE+dV465?= =?us-ascii?Q?q/0Y/veShzuuNoPeMNCYH3FdKbiaEn/HX+UjMq6/0/V3hqsb8BaoIiP94L6F?= =?us-ascii?Q?exP7ebtZeUkjTEU6L8e7Qjutx2y2ctEgKhuJQ8A6P0vQ16/4Jj5sNon33bH3?= =?us-ascii?Q?qYfq2nTv96ymQWFdgP4s1jxvHnIHxwV09dzklLVTBZFyWNqb595tIZIwZh/+?= =?us-ascii?Q?bdqxzJJCJIpOFrhKWgEkyAo4NoKyBl1eVL/XHwVgHKsWJVH+xLrUFqfWfYVo?= =?us-ascii?Q?GQZVKgkUutcodP/XWa+yK/632fwUDXGtPNepYwIWDINjiwYA0+CUMmr4G70O?= =?us-ascii?Q?wzGiBc8Km5r1lC9qbKoAFcS4Pn/rLsa00+xG4OMSJGDhNhnlA2GRJr0049xs?= =?us-ascii?Q?vJE7zwKFbGIFGGO7+05oI1Fgl7miIafpc2EI0P5LSxKx3VLslKnuj2vqMab+?= =?us-ascii?Q?V7m/ep6Ns5yL95mOCBhWrX/blIXECcapCsr5KCDBUrA97qcZQs2fQ8120iIL?= =?us-ascii?Q?wmc2iuXVIBgMbJQEGXnQN8Tf9jfubNg0zqDI9RHnQnPOc3o1jVhwdNyw9pG7?= =?us-ascii?Q?v95tiDZe7uPtMwN6RCLvBf0+st0Qv83mrLG3qDA5g+eSfMdbsTlg7PxJBccR?= =?us-ascii?Q?yd65U4PHQ6Meq4Fv+2mwCA7IXp/iB7CqT6Iwm3H0?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a64b328-08c5-44c7-a0a7-08da71996272 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4899.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 19:34:42.5085 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S1Yh8ubv5EqcJmWQP3PBhbwiml2WG+PT+NVtOqSuZlJ5RHOBRca4MA7EkSQsLNjkfB2fBbRPwQejmvhgU57yug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5654 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dario Faggioli Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659123299437100003 Content-Type: text/plain; charset="utf-8" From: Dario Faggioli This patch introduces the sub element of /domain/cpu, which allows specifying the guest virtual CPU address size. This can be useful if the guest needs to have a large amount of memory. If mode=3D'passthrough', the virtual CPU will have the same number of addre= ss bits as the host. If mode=3D'emulate', the mandatory bits attribute specifi= es the number of address bits. Signed-off-by: Dario Faggioli Signed-off-by: Jim Fehlig --- docs/formatdomain.rst | 23 ++++++++ src/conf/cpu_conf.c | 54 +++++++++++++++++++ src/conf/cpu_conf.h | 17 ++++++ src/conf/schemas/cputypes.rng | 19 +++++++ src/libvirt_private.syms | 2 + .../cpu-phys-bits-emulate.xml | 20 +++++++ .../cpu-phys-bits-passthrough.xml | 20 +++++++ tests/genericxml2xmltest.c | 3 ++ 8 files changed, 158 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1ed969ac3e..adfdd7b7a5 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1336,6 +1336,7 @@ following collection of elements. :since:`Since 0.7.5` Intel + ... @@ -1352,6 +1353,7 @@ following collection of elements. :since:`Since 0.7.5` =20 + ... =20 @@ -1600,6 +1602,27 @@ In case no restrictions need to be put on CPU model = and its features, a simpler The virtual CPU will report no CPU cache of the specified level (= or no cache at all if the ``level`` attribute is missing). =20 +``maxphysaddr`` + :since:`Since 8.7.0` the ``maxphysaddr`` element describes the virtual = CPU + address size in bits. The hypervisor default is used if the element is = missing. + + ``mode`` + This mandatory attribute specifies how the address size is presented= . The + follow modes are supported: + + ``passthrough`` + The number of physical address bits reported by the host CPU will= be + passed through to the virtual CPUs + ``emulate`` + The hypervisor will define a specific value for the number of bits + of physical addresses via the ``bits`` attribute, which is mandat= ory. + The number of bits cannot exceed the number of physical address bits + supported by the hypervisor. + + ``bits`` + The ``bits`` attribute is mandatory if the ``mode`` attribute is set= to + ``emulate`` and specifies the virtual CPU address size in bits. + Guest NUMA topology can be specified using the ``numa`` element. :since:`S= ince 0.9.8` =20 diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 8d80bbd842..e31c4ab467 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -82,6 +82,12 @@ VIR_ENUM_IMPL(virCPUCacheMode, "disable", ); =20 +VIR_ENUM_IMPL(virCPUMaxPhysAddrMode, + VIR_CPU_MAX_PHYS_ADDR_MODE_LAST, + "emulate", + "passthrough", +); + =20 virCPUDef *virCPUDefNew(void) { @@ -127,6 +133,7 @@ virCPUDefFree(virCPUDef *def) if (g_atomic_int_dec_and_test(&def->refs)) { virCPUDefFreeModel(def); g_free(def->cache); + g_free(def->addr); g_free(def->tsc); g_free(def); } @@ -252,6 +259,11 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu) *copy->cache =3D *cpu->cache; } =20 + if (cpu->addr) { + copy->addr =3D g_new0(virCPUMaxPhysAddrDef, 1); + *copy->addr =3D *cpu->addr; + } + if (cpu->tsc) { copy->tsc =3D g_new0(virHostCPUTscInfo, 1); *copy->tsc =3D *cpu->tsc; @@ -644,6 +656,39 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, def->cache->mode =3D mode; } =20 + if (virXPathInt("count(./maxphysaddr)", ctxt, &n) < 0) { + return -1; + } else if (n > 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("at most one CPU maximum physical address bits " + "element may be specified")); + return -1; + } else if (n =3D=3D 1) { + g_autofree char *strmode =3D NULL; + int mode; + int bits =3D -1; + + if (!(strmode =3D virXPathString("string(./maxphysaddr[1]/@mode)",= ctxt)) || + (mode =3D virCPUMaxPhysAddrModeTypeFromString(strmode)) < 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("missing or invalid CPU maximum physical " + "address bits mode")); + return -1; + } + + if (virXPathBoolean("boolean(./maxphysaddr[1]/@bits)", ctxt) =3D= =3D 1 && + (virXPathInt("string(./maxphysaddr[1]/@bits)", ctxt, &bits) < = 0 || + bits < 0)) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("CPU maximum physical address bits < 0")); + return -1; + } + + def->addr =3D g_new0(virCPUMaxPhysAddrDef, 1); + def->addr->bits =3D bits; + def->addr->mode =3D mode; + } + *cpu =3D g_steal_pointer(&def); return 0; } @@ -811,6 +856,15 @@ virCPUDefFormatBuf(virBuffer *buf, virBufferAddLit(buf, "/>\n"); } =20 + if (def->addr) { + virBufferAddLit(buf, "addr->mod= e)); + if (def->addr->bits !=3D -1) + virBufferAsprintf(buf, " bits=3D'%d'", def->addr->bits); + virBufferAddLit(buf, "/>\n"); + } + for (i =3D 0; i < def->nfeatures; i++) { virCPUFeatureDef *feature =3D def->features + i; =20 diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 5d2980edbd..113d349708 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -116,6 +116,22 @@ struct _virCPUCacheDef { }; =20 =20 +typedef enum { + VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE, + VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH, + + VIR_CPU_MAX_PHYS_ADDR_MODE_LAST +} virCPUMaxPhysAddrMode; + +VIR_ENUM_DECL(virCPUMaxPhysAddrMode); + +typedef struct _virCPUMaxPhysAddrDef virCPUMaxPhysAddrDef; +struct _virCPUMaxPhysAddrDef { + int bits; /* -1 for unspecified */ + virCPUMaxPhysAddrMode mode; +}; + + typedef struct _virCPUDef virCPUDef; struct _virCPUDef { int refs; @@ -140,6 +156,7 @@ struct _virCPUDef { size_t nfeatures_max; virCPUFeatureDef *features; virCPUCacheDef *cache; + virCPUMaxPhysAddrDef *addr; virHostCPUTscInfo *tsc; virTristateSwitch migratable; /* for host-passthrough mode */ }; diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng index 122880fb2e..4ae386c3c0 100644 --- a/src/conf/schemas/cputypes.rng +++ b/src/conf/schemas/cputypes.rng @@ -305,6 +305,22 @@ =20 + + + + + emulate + passthrough + + + + + + + + + + @@ -432,6 +448,9 @@ + + + diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6a5c5600df..774a594983 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -120,6 +120,8 @@ virCPUDefParseXMLString; virCPUDefRef; virCPUDefStealModel; virCPUDefUpdateFeature; +virCPUMaxPhysAddrModeTypeFromString; +virCPUMaxPhysAddrModeTypeToString; virCPUModeTypeToString; =20 =20 diff --git a/tests/genericxml2xmlindata/cpu-phys-bits-emulate.xml b/tests/g= enericxml2xmlindata/cpu-phys-bits-emulate.xml new file mode 100644 index 0000000000..e463e0b3e0 --- /dev/null +++ b/tests/genericxml2xmlindata/cpu-phys-bits-emulate.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/genericxml2xmlindata/cpu-phys-bits-passthrough.xml b/tes= ts/genericxml2xmlindata/cpu-phys-bits-passthrough.xml new file mode 100644 index 0000000000..cce676eaa6 --- /dev/null +++ b/tests/genericxml2xmlindata/cpu-phys-bits-passthrough.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index b83367cb4b..bbe0d02226 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -246,6 +246,9 @@ mymain(void) =20 DO_TEST_BACKUP_FULL("backup-pull-internal-invalid", true); =20 + DO_TEST("cpu-phys-bits-emulate"); + DO_TEST("cpu-phys-bits-passthrough"); + =20 virObjectUnref(caps); virObjectUnref(xmlopt); --=20 2.36.1