From nobody Thu May 2 12:04:50 2024 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) 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=1612705583; cv=none; d=zohomail.com; s=zohoarc; b=TdU9XyCsUKqFfxIRDVRayiCSEdNZO05SjbGfCDu5tO9uAceljo+6z68w72pFqrrKKE+By3eBy3J/HPujL7r0uRoqv7lquUjFBUNlhGCt2VliEEuOPQyKQBQ2vfOHzmOIIbiXX8QmoJyHwbw/3AC2JNZ27GE/BiWTtYGvJfzjVQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612705583; h=Content-Type:Content-Transfer-Encoding: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=+okBB6/ikiynq8f0s6NVIyy+4wTBZ+cBg2gb4YX0+wk=; b=Cn6+yHE5ILeUcyUX8C3fUESPR0XftGUko9WysG+C302NhvTvehXhEQSjoGtVt1Q5y+yNJc/f+TFWijtNFGLQ8twX0jm6lGM1UCfxjiArmD+yyFq2OZGkgTzEiSeQjAvk/Mtr+4hffWBZsW/QQSbrEZIyYoCyDF1sgQgiAnQtgiU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1612705583634645.0870492655934; Sun, 7 Feb 2021 05:46:23 -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-341-tqYQsyZ7PsWuyjXKyrnvZg-1; Sun, 07 Feb 2021 08:46:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8525107ACE3; Sun, 7 Feb 2021 13:46:13 +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 A43575D9CA; Sun, 7 Feb 2021 13:46:12 +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 D31C618095CC; Sun, 7 Feb 2021 13:46:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 117Dk7Sl031804 for ; Sun, 7 Feb 2021 08:46:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9F19019D9D; Sun, 7 Feb 2021 13:46:07 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E80CD19D9C for ; Sun, 7 Feb 2021 13:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612705582; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+okBB6/ikiynq8f0s6NVIyy+4wTBZ+cBg2gb4YX0+wk=; b=NJ5nK22JI5kBJERbOpfhxg4084UhhH0hA/sP4PbQt7ttmtp1HYU97uIdHbhP1iCCvgB9XU c1Mlld4YFf4eLYt4H3fwKvQLbNvoxde4HcaTdEJoY2HbtlGe038GOuG4xQqd1ojkkXb6qy nyoytksVuv3VHfjcWWpB2IJ3SyinD6M= X-MC-Unique: tqYQsyZ7PsWuyjXKyrnvZg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] cpu: Only include if available Date: Sun, 7 Feb 2021 14:45:57 +0100 Message-Id: <20210207134559.72578-2-abologna@redhat.com> In-Reply-To: <20210207134559.72578-1-abologna@redhat.com> References: <20210207134559.72578-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.14 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) Content-Type: text/plain; charset="utf-8" It's glibc-specific, so it's not present on many non-Linux targets that nonetheless support aarch64. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- meson.build | 1 + src/cpu/cpu_arm.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 095d6ca664..766bc06b61 100644 --- a/meson.build +++ b/meson.build @@ -690,6 +690,7 @@ headers =3D [ 'net/if.h', 'pty.h', 'pwd.h', + 'sys/auxv.h', 'sys/ioctl.h', 'sys/mount.h', 'sys/syscall.h', diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 6ba5bf0724..aa3e5d8980 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -25,7 +25,9 @@ # if defined(WITH_ASM_HWCAP_H) # include # endif -# include +# if defined(WITH_SYS_AUXV_H) +# include +# endif #endif =20 #include "viralloc.h" --=20 2.26.2 From nobody Thu May 2 12:04:50 2024 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) 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=1612705602; cv=none; d=zohomail.com; s=zohoarc; b=ihpnwPSSPKCl6/Y6FH2LmbYwaK2gUA5+8m/FMZWKDpjKosv4a+BGgUkKvgTAENJLH1s4vzUHsSc/qnpbnqH+/+Jkpfbh86f2Pi2zlxZpugPxaTVHn4wR12iEzzYfgDLOcH9jk2j2KyGGMspYGDurWBwuB5FZM30zE/bs3/CqAk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612705602; h=Content-Type:Content-Transfer-Encoding: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=U45UFktSBXsLwodYlUHIi/9W9W+dC+uO3Sc2pf7Dw34=; b=m5sVPKZqCJrqnYGwGgdquSO2KPSn/expsgaJAys+ONC2NI0Ua+bptSW4kgUa3ueVcwCC8CMKblF8sZNugfjoq0Nlpc2nk6pu8e1SAkMs4KcbasARfL1Vv2AVGwPdfVMWFvbtFIk8Yub+EWM0fa7nPcdxLfi5dO9D5cjkjZDPXUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1612705602141138.49685074945205; Sun, 7 Feb 2021 05:46:42 -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-135-gFIkWyeGN-e9WgAi71Wlrg-1; Sun, 07 Feb 2021 08:46:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 330F71005501; Sun, 7 Feb 2021 13:46:33 +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 0A12160BF3; Sun, 7 Feb 2021 13:46:33 +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 C741C4E58E; Sun, 7 Feb 2021 13:46:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 117Dk9Do031814 for ; Sun, 7 Feb 2021 08:46:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F58319D9D; Sun, 7 Feb 2021 13:46:09 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F5A619D9C for ; Sun, 7 Feb 2021 13:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612705601; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=U45UFktSBXsLwodYlUHIi/9W9W+dC+uO3Sc2pf7Dw34=; b=bpJzJ5LCpOoEunYe7tLGiJuaJDs7Tylf8Qm07fBnD04Hos55fqrJ4UA11nJQ8fkFAnhd0E FracVe9u76GLlcWrA9gqDLtsf4HRgyBWYiJiUNo07/ytQo7CoUaWB3KnVd6lJvDtCW7Fvf vjQOqnOynDh25CMNjIRNmvgNvPQqW+8= X-MC-Unique: gFIkWyeGN-e9WgAi71Wlrg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] cpu: Only retrieve AT_HWCAP once Date: Sun, 7 Feb 2021 14:45:58 +0100 Message-Id: <20210207134559.72578-3-abologna@redhat.com> In-Reply-To: <20210207134559.72578-1-abologna@redhat.com> References: <20210207134559.72578-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 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) Content-Type: text/plain; charset="utf-8" No need to fetch the same information twice. As a side effect, this solves a bug where, on platforms where elf_aux_info() is used instead of getauxval(), we would not make sure the CPUID feature is available before attempting to use it. Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/cpu/cpu_arm.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index aa3e5d8980..71702dbc91 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -557,12 +557,19 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) size_t i; =20 # if defined(WITH_GETAUXVAL) - if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) { + hwcaps =3D getauxval(AT_HWCAP); +# elif defined(WITH_ELF_AUX_INFO) + elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); +# else +# error No routines to retrieve a value from the auxiliary vector +# endif + VIR_DEBUG("CPU flags read from register: 0x%016lx", hwcaps); + + if (!(hwcaps & HWCAP_CPUID)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("CPUID registers unavailable")); return -1; } -# endif =20 /* read the cpuid data from MIDR_EL1 register */ asm("mrs %0, MIDR_EL1" : "=3Dr" (cpuid)); @@ -573,15 +580,6 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) /* parse the corresponding vendor_id bits */ data->vendor_id =3D (cpuid >> 24) & 0xff; =20 -# if defined(WITH_GETAUXVAL) - hwcaps =3D getauxval(AT_HWCAP); -# elif defined(WITH_ELF_AUX_INFO) - elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); -# else -# error No routines to retrieve a value from the auxiliary vector -# endif - VIR_DEBUG("CPU flags read from register: 0x%016lx", hwcaps); - features =3D g_new0(char *, MAX_CPU_FLAGS + 1); =20 /* shift bit map mask to parse for CPU flags */ --=20 2.26.2 From nobody Thu May 2 12:04:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.124 as permitted sender) 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=1612705605; cv=none; d=zohomail.com; s=zohoarc; b=gYVxoIe00qu1/R/T1wOONHHy6fwXjUMcoytte56+6FD80jcp7XO4ouUvIt6Txt/2SO8v3gTbZhEADHpgbZaqrMFcSv0ny5IYxAprXg+Tna76RcQIZn1RCEgJzLmxWvh70MXFlHfygKdntUaYEUlccHSRKsPyaIX4TA7/tjnQY0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612705605; h=Content-Type:Content-Transfer-Encoding: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=9dEaI5ZVIAY7K2SrVCaKVgV0WoaWjXiqVSwPRf4pRfs=; b=I1Z8catu9RxmNYi7niwCysXOtrC1kR+KbGBbYCKB1Anr1cFZv6Iqae1z2DREHOAsD0UMSHw7Y1A8LZZ//GaQekt7GzjgPIfCXPNVec6mD1VEmjr6It4wjhMkZICWqCCUjDpFEts9iBeuLa+dBjI6Czz8qkC/J4b5armtQ2dl428= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1612705605482892.895334512325; Sun, 7 Feb 2021 05:46:45 -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-102-OhCmWlYNMA2zcYmpRkDx_Q-1; Sun, 07 Feb 2021 08:46:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1747107ACE6; Sun, 7 Feb 2021 13:46:36 +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 9076A5D6AD; Sun, 7 Feb 2021 13:46:36 +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 5E52E4EE83; Sun, 7 Feb 2021 13:46:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 117DkAQ2031824 for ; Sun, 7 Feb 2021 08:46:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5E0B019D9D; Sun, 7 Feb 2021 13:46:10 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A107A19D9C for ; Sun, 7 Feb 2021 13:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612705604; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9dEaI5ZVIAY7K2SrVCaKVgV0WoaWjXiqVSwPRf4pRfs=; b=gZHGPKGoq/fUKvVDeD2EQGjKsaKTzYUV7CltP5P6akvc+OgYPMH12xnXgnUIu5b2P3A4br AyePXO49idi5KWTn++G2WnujMsKuZ1eqFBG8yiVYASB5t7w8wpWWUXcmT7wx6q0p7NFuTb 14+BKx2ttAqRCryizWyovwtDPMsrUkk= X-MC-Unique: OhCmWlYNMA2zcYmpRkDx_Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] cpu: Fix build on some aarch64 platforms Date: Sun, 7 Feb 2021 14:45:59 +0100 Message-Id: <20210207134559.72578-4-abologna@redhat.com> In-Reply-To: <20210207134559.72578-1-abologna@redhat.com> References: <20210207134559.72578-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.15 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) Content-Type: text/plain; charset="utf-8" On platforms that lack both getauxval() and elf_aux_info(), such as OpenBSD and macOS, host CPU detection can't work. https://gitlab.com/libvirt/libvirt/-/issues/121 Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- src/cpu/cpu_arm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 71702dbc91..6da84535ba 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -529,7 +529,7 @@ virCPUarmValidateFeatures(virCPUDefPtr cpu) return 0; } =20 -#if defined(__aarch64__) +#if defined(__aarch64__) && (defined(WITH_GETAUXVAL) || defined(WITH_ELF_A= UX_INFO)) /* Generate human readable flag list according to the order of */ /* AT_HWCAP bit map */ const char *aarch64_cpu_flags[MAX_CPU_FLAGS] =3D { @@ -560,8 +560,6 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) hwcaps =3D getauxval(AT_HWCAP); # elif defined(WITH_ELF_AUX_INFO) elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); -# else -# error No routines to retrieve a value from the auxiliary vector # endif VIR_DEBUG("CPU flags read from register: 0x%016lx", hwcaps); =20 @@ -674,7 +672,7 @@ struct cpuArchDriver cpuDriverArm =3D { .arch =3D archs, .narch =3D G_N_ELEMENTS(archs), .compare =3D virCPUarmCompare, -#if defined(__aarch64__) +#if defined(__aarch64__) && (defined(WITH_GETAUXVAL) || defined(WITH_ELF_A= UX_INFO)) .getHost =3D virCPUarmGetHost, #endif .decode =3D NULL, --=20 2.26.2