From nobody Tue Nov 26 22:30:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1702916673; cv=none; d=zohomail.com; s=zohoarc; b=Jlo7cksj5tPrYvHNKZ0p1LnvZ+ped7jN+E4Zdke4kUuEA0iHM48AkLYLn/lV67ahi2YVD+j3mQbGKKC8/QHX0ctYrPm+lYIn7uZumR+4W2oZ9shXNXNMQnQtzQvhPgWoeCW8KV7UNJswBON2PU/FYytZpByDulbOipqb5HJBvvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702916673; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0FWL/8idHPFO9kfCetgnotzl224SvDQDNj5iKEvReqs=; b=Ub5HV7fP2FGHWWL869N+J0ABCdkQA0z3QBZD7+6LS4c+FmuoYixgFkyH3eQvAOg8hVE634IzYm273aUUoVQmZGOFdzpR/jQUCOxj47X0M+9UM1kogzdKtVlIOHnFxdzVk7JQN8p8ZqhWy+gYoJbpfqQJhENz2JT61wg0AW4pIp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1702916673719109.73297273161154; Mon, 18 Dec 2023 08:24:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFGOu-00079d-3L; Mon, 18 Dec 2023 11:23:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFGOn-00078t-DV; Mon, 18 Dec 2023 11:23:22 -0500 Received: from gbr-app-1.alpinelinux.org ([213.219.36.190]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFGOk-0005sD-TC; Mon, 18 Dec 2023 11:23:20 -0500 Received: from ncopa-desktop.lan (ti0056a400-5190.bb.online.no [85.167.243.86]) (Authenticated sender: ncopa@alpinelinux.org) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPSA id E162B22597C; Mon, 18 Dec 2023 16:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alpinelinux.org; s=smtp; t=1702916592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0FWL/8idHPFO9kfCetgnotzl224SvDQDNj5iKEvReqs=; b=y+6rJ1W5Jn2PBD9jOtN6DJj+cZeZcNI7BIKUBXz7L060DZ+lRukWerQXtyR6igOOrKO3Mt IcHgk6Hn4AbATuEYeke0InYZMUiu1SmC08h3yNUMZNdw9j6vETy+sxFqVzl7TpbnX3PsZE JxMnEnasHUA662MiJ9UmdHoiQKO7EuY= From: Natanael Copa To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, qemu-trivial@nongnu.org, Natanael Copa , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PATCH] target/riscv/kvm: do not use non-portable strerrorname_np() Date: Mon, 18 Dec 2023 17:22:44 +0100 Message-ID: <20231218162301.14817-1-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=213.219.36.190; envelope-from=ncopa@alpinelinux.org; helo=gbr-app-1.alpinelinux.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @alpinelinux.org) X-ZM-MESSAGEID: 1702916674664100005 Content-Type: text/plain; charset="utf-8" strerrorname_np is non-portable and breaks building with musl libc. Use strerror(errno) instead, like we do other places. Cc: qemu-stable@nongnu.org Fixes: commit 082e9e4a58ba (target/riscv/kvm: improve 'init_multiext_cfg' e= rror msg) Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2041 Buglink: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15541 Signed-off-by: Natanael Copa Reviewed-by: Daniel Henrique Barboza --- target/riscv/kvm/kvm-cpu.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 45b6cf1cfa..117e33cf90 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -832,9 +832,8 @@ static void kvm_riscv_read_multiext_legacy(RISCVCPU *cp= u, multi_ext_cfg->supported =3D false; val =3D false; } else { - error_report("Unable to read ISA_EXT KVM register %s, " - "error code: %s", multi_ext_cfg->name, - strerrorname_np(errno)); + error_report("Unable to read ISA_EXT KVM register %s: %s", + multi_ext_cfg->name, strerror(errno)); exit(EXIT_FAILURE); } } else { @@ -895,8 +894,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) * * Error out if we get any other errno. */ - error_report("Error when accessing get-reg-list, code: %s", - strerrorname_np(errno)); + error_report("Error when accessing get-reg-list: %s", + strerror(errno)); exit(EXIT_FAILURE); } =20 @@ -905,8 +904,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) reglist->n =3D rl_struct.n; ret =3D ioctl(kvmcpu->cpufd, KVM_GET_REG_LIST, reglist); if (ret) { - error_report("Error when reading KVM_GET_REG_LIST, code %s ", - strerrorname_np(errno)); + error_report("Error when reading KVM_GET_REG_LIST: %s", + strerror(errno)); exit(EXIT_FAILURE); } =20 @@ -927,9 +926,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu, = KVMScratchCPU *kvmcpu) reg.addr =3D (uint64_t)&val; ret =3D ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, ®); if (ret !=3D 0) { - error_report("Unable to read ISA_EXT KVM register %s, " - "error code: %s", multi_ext_cfg->name, - strerrorname_np(errno)); + error_report("Unable to read ISA_EXT KVM register %s: %s", + multi_ext_cfg->name, strerror(errno)); exit(EXIT_FAILURE); } =20 --=20 2.43.0