From nobody Sun Feb 8 14:51:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1605132476; cv=none; d=zohomail.com; s=zohoarc; b=fU5Io58UAXyardiq7qyLKsrzxVKxJypZaVznEDL2aBcPrhHTFKlEZp6mS3VawmDwPGxHLaWC8eGGVohoYyXalCEiNPGIafCoDWfblba819/WQxvkX9+1F9Y0Tem6OFF+cW0xEyuauL3mls4nrKRSFXMmYCKWjhl1sVpQtNYvoQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605132476; 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=De0ggMmH2GfugTouea1c6aehegjWRhxF0kwO2BojkAY=; b=KshHPaBHZImkEr7sYwsQwaVaaYpJMn/Fnyx7v8EQk2njHgL/U7UxgnTvsuZrgOJpTdZtZHEpAoWC5pN8k4H6kUM3gsHHOmHSRMMP7aMDcJEhz5T2KNJIpbUTseTVNPtr0m/pAFNGY3j5T+Yb6ZzI19AjBM2FBQOIqDTnDiCneXw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605132476948413.27016113025707; Wed, 11 Nov 2020 14:07:56 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-vbfoZcKkOOas_X7tA2g63Q-1; Wed, 11 Nov 2020 17:07:52 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DE4B879532; Wed, 11 Nov 2020 22:07:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7563019C66; Wed, 11 Nov 2020 22:07:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3FC9B996F; Wed, 11 Nov 2020 22:07:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ABM7eLQ006076 for ; Wed, 11 Nov 2020 17:07:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 637A2115D346; Wed, 11 Nov 2020 22:07:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F549115D342 for ; Wed, 11 Nov 2020 22:07:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48610102F1E2 for ; Wed, 11 Nov 2020 22:07:40 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-wBKkLprPPxug4l5rumWqjA-1; Wed, 11 Nov 2020 17:07:38 -0500 Received: by mail-qt1-f194.google.com with SMTP id g17so2553302qts.5 for ; Wed, 11 Nov 2020 14:07:38 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:b9cd:904e:d02:53c4:1c05]) by smtp.gmail.com with ESMTPSA id a200sm3427842qkb.66.2020.11.11.14.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 14:07:37 -0800 (PST) X-MC-Unique: vbfoZcKkOOas_X7tA2g63Q-1 X-MC-Unique: wBKkLprPPxug4l5rumWqjA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=De0ggMmH2GfugTouea1c6aehegjWRhxF0kwO2BojkAY=; b=dAPxZM0Ed8C8PdTCj6uKAnlMiAetWbAtYFYX7xWrzSZeWv3Lkns/MPkrs4BDF9WYap GXU9nrCxzgJU53m/as+K5vtIqDYGKqbK9DG78IEXOAItHqlhLKJL5kPSauiMMKQyGrRR M/TIetemfVK+Lh0GGyc1dqdM2Nb1CM5tSStsyJXu4oMu0OSPZzNkkXblDV/Wy6U8iyyc Dyk5QEzy317GwflxH2ViailYbXIV4WmCYZJHguspUJLGOVSjyFvkJBP+mL6AJISILIl0 3VWBo/dxthuWLEuzK2LG13tieZnwjFRH6AuoeCY4y/Oa6d5nVTJV6qsZRL5enboRvD+b IB8g== X-Gm-Message-State: AOAM532+MVyMdLJuTBJiyHOIf8/SDEqyD1K2Bp9Als1oHGXsM/CfW5uW ECDKCyisntjPLy7FGehtTRuRYkhld4aCxQ== X-Google-Smtp-Source: ABdhPJzEwRHOZNU663h73W0j1ANC9neJ4SG3BAh8IVN1W1wwlBXrnAgdtFSgkr3NMju605iStw/BSA== X-Received: by 2002:aed:38e4:: with SMTP id k91mr25263135qte.138.1605132457575; Wed, 11 Nov 2020 14:07:37 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 03/10] domain_conf.c: align pSeries mem modules in virDomainMemoryDefPostParse() Date: Wed, 11 Nov 2020 19:07:18 -0300 Message-Id: <20201111220725.356297-4-danielhb413@gmail.com> In-Reply-To: <20201111220725.356297-1-danielhb413@gmail.com> References: <20201111220725.356297-1-danielhb413@gmail.com> MIME-Version: 1.0 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.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 Content-Type: text/plain; charset="utf-8" Until now, we were aligning just ppc64 NVDIMM modules in post parse time. Let's extend the treatment to all ppc64 memory models. This is possible because the alignment restrictions for the architecture are imposed by the platform specification, being hypervisor-agnostic. This will remove the need for mem module alignment for pSeries in the QEMU driver, simplifying the code a bit. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 1 - src/qemu/qemu_domain.c | 13 +++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c98e760aa2..e4aecc9a4d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5360,7 +5360,6 @@ virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, * will have the same restriction. */ if (ARCH_IS_PPC64(def->os.arch) && - mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && virDomainMemoryDeviceAlignSizePseries(mem) < 0) return -1; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 5a17887fa1..33a5765c57 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8087,11 +8087,8 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) * calculation because virDomainDefGetMemoryInitial() uses the size * of the modules in the math. */ for (i =3D 0; i < def->nmems; i++) { - if (def->mems[i]->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - ARCH_IS_PPC64(def->os.arch)) { - if (virDomainMemoryDeviceAlignSizePseries(def->mems[i]) < 0) - return -1; - } else { + /* ppc64 memory modules are aligned by virDomainMemoryDefPostParse= (). */ + if (!ARCH_IS_PPC64(def->os.arch)) { align =3D qemuDomainGetMemoryModuleSizeAlignment(def, def->mem= s[i]); def->mems[i]->size =3D VIR_ROUND_UP(def->mems[i]->size, align); } @@ -8144,13 +8141,9 @@ int qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, virDomainMemoryDefPtr mem) { - if (mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - ARCH_IS_PPC64(def->os.arch)) { - return virDomainMemoryDeviceAlignSizePseries(mem); - } else { + if (!ARCH_IS_PPC64(def->os.arch)) mem->size =3D VIR_ROUND_UP(mem->size, qemuDomainGetMemorySizeAlignment(def)); - } =20 return 0; } --=20 2.26.2