From nobody Wed May 8 16:57:39 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 205.139.110.120 is neither permitted nor denied by domain of redhat.com) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.110.120 is neither permitted nor denied by domain of redhat.com) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1597748176; cv=none; d=zohomail.com; s=zohoarc; b=RZHdQa4dWAM/MQGEU2G2alQjBAnJeUDVKtIk/uc2WZBQxzC5KhriY/I2edaXJVauBXETpAJQpLwS4ENPMU5E8ny9ZmMI4UrbogndY8cEQNrkNj42jbHdfJ35B8htgOAGF+jLIbsyigH4oaEnypQTk14nWZ7CgB1IZ0ju3JTFkFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597748176; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=chFKd07QwQyF73kqjwBbB7LoWHuvkN44CfNRkSBb4nM=; b=e66hFaFoYm/bxI1VWBKim6LuWxCaJzD1BtFvYzV5LUPqmpNShI7Ci4dQFKP3h642Y2OMN6e6QkqcOFn3CPtOjUcBIH6Nu9w4dmJHSpBFOeRc+9U5jGAzSzxLeLcSbg/MriMP47tQ1k9SQDbjmTmhT2K9F6lpL/XccqbeajtvhMo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.110.120 is neither permitted nor denied by domain of redhat.com) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1597748176232686.5574590315977; Tue, 18 Aug 2020 03:56:16 -0700 (PDT) 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-438-9wicC1QnPJCD3Dtcuwimsg-1; Tue, 18 Aug 2020 06:56:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 161C01084C8C; Tue, 18 Aug 2020 10:56:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3248E7A401; Tue, 18 Aug 2020 10:56:05 +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 73BFE181A270; Tue, 18 Aug 2020 10:56:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07IAu1mt010377 for ; Tue, 18 Aug 2020 06:56:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCF8D756C8; Tue, 18 Aug 2020 10:56:01 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5ACE1756C5 for ; Tue, 18 Aug 2020 10:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597748175; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=chFKd07QwQyF73kqjwBbB7LoWHuvkN44CfNRkSBb4nM=; b=U9A92w1jUecWwJBOFL1IpanBthYi48wBrqU/MgMhUjBKyneU6qZCQSHjEK3t9XVcoB9bWJ Hyylii67rLkkkzSK/OIcx30CttLOxttk4QYe2xhL4L1xACvMJvuYtaw4L6OLGTuLsaD39a VK4QmmMNdZGgaHlMfU3DPOyTuwI6m0M= X-MC-Unique: 9wicC1QnPJCD3Dtcuwimsg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] numa_conf: Properly check for caches in virDomainNumaDefValidate() Date: Tue, 18 Aug 2020 12:55:54 +0200 Message-Id: <2207bf5e25921ad8120cbf32543164000977aabc.1597748139.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When adding support for HMAT, in f0611fe8830 I've introduced a check which aims to validate /domain/cpu/numa/interconnects. As a part of that, there is a loop which checks whether all with @cache attribute refer to an existing cache level. For instance: This XML defines that accessing L1 cache of node #0 from node #0 has latency of 5ns. However, the loop was not written properly. Well, the check in it, as it was always checking for the first cache in the target node and not the rest. Therefore, the following example errors out: This errors out even though it is a valid configuration. The L1 cache under node #0 is still present. Fixes: f0611fe8830 Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- Is this trivial enough to be pushed as such? ;-) src/conf/numa_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 50d57ba8f6..9305e125b7 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -1421,7 +1421,7 @@ virDomainNumaDefValidate(const virDomainNuma *def) =20 if (l->cache > 0) { for (j =3D 0; j < def->mem_nodes[l->target].ncaches; j++) { - const virDomainNumaCache *cache =3D def->mem_nodes[l->targ= et].caches; + const virDomainNumaCache *cache =3D &def->mem_nodes[l->tar= get].caches[j]; =20 if (l->cache =3D=3D cache->level) break; --=20 2.26.2