From patchwork Wed Apr 24 20:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1927372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=GCmtKrkq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VPr980llDz1yZy for ; Thu, 25 Apr 2024 06:26:04 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzjAg-000586-3m; Wed, 24 Apr 2024 16:24:50 -0400 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 1rzjAV-00052m-BG for qemu-devel@nongnu.org; Wed, 24 Apr 2024 16:24:39 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzjAT-0006Wq-U4 for qemu-devel@nongnu.org; Wed, 24 Apr 2024 16:24:39 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ecff9df447so355354b3a.1 for ; Wed, 24 Apr 2024 13:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713990276; x=1714595076; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QderLQFNnEEbgwL1oCKkwQI5umxVetU0de2TmLTVPbw=; b=GCmtKrkqoJtUUClhhlS/5ZCw73zsaE59bRfhaYHiIzlJL39sNcuoQLxKgSpmTttZTH flodMe2vaY15MgJk/MYYLuhGlR8fXiEecpo7380H1uUIXZPfTqg8jvRhpwgHMZBUka6T W+lXAVKjtx0MNrdoFuqm7mNCDrXsMpZuhQNq7YYzpMJ9ieQ+NOBdBUdreNWqkfPLL/eh jnMpLdfqLYCntUwL63AT6B+l4qtKYvc6NY1ePpFEYtzUytUXBcn8HBfTYMOtT0VAMquO BiBpbQy1vT+51xmFhcJ9pRfZN7wIM02+ZMMtkuN5zGfw4XBPU5bLTfM6M/U8ZfIbs104 N2xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713990276; x=1714595076; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QderLQFNnEEbgwL1oCKkwQI5umxVetU0de2TmLTVPbw=; b=OIOJtce8A8PfzPWTpmff3pbnQIl1A4NAGxqtei4dTPJSyRKiIGyydE/QfAq6rb+VR5 ao24a5le3DWkiezqVsw+ukwTF1D3AujaYEJ5hXnkPa12R/oBa0tWrrwuhn0f8Y3DRK5E LUaZr5reUxOvRSQItmG4UdZHiFgt7re63dxrpiFkq+ntHKkfzdKg1876CRcxxV7N8UWc Y4qq71D1zgTXZI4X4vfggs6Ze40olshB6xtsF1MHfO/8+K4q22vMCVchOcG1bpc5uJey lRsump5Ae7LkKDFb6DCmPs7oLz+xceSOemXUOBTF3YklQXr8skN4Y+ax9rC3YS+T3+5d c24A== X-Gm-Message-State: AOJu0YzAvSNytzwKtGl7GeelCA0OuTAf6fNBIK+wiZY6NiMOA+2KCYny 7/OWTfUT6y0VQLrgjEX0AXm+5IlYrb+OKvLP0QCWbc4UJIkvSialog1BrVH2kLknFeNDjGKDgri Z X-Google-Smtp-Source: AGHT+IEi7E7s0dSSKIGTF8Tk09FtgjHEsSImrbEyBJHjXPOn3ooykqGAWGpSs0/JnTgGed2faWCPhw== X-Received: by 2002:a05:6a00:2ea3:b0:6f3:1be8:ab68 with SMTP id fd35-20020a056a002ea300b006f31be8ab68mr4864206pfb.32.1713990276207; Wed, 24 Apr 2024 13:24:36 -0700 (PDT) Received: from grind.. ([191.255.35.121]) by smtp.gmail.com with ESMTPSA id fm8-20020a056a002f8800b006ed059cdf02sm11862015pfb.116.2024.04.24.13.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:24:35 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, thuth@redhat.com, alex.bennee@linaro.org, philmd@linaro.org, mjt@tls.msk.ru, ajones@ventanamicro.com, Daniel Henrique Barboza Subject: [PATCH v2 1/2] target/riscv/kvm: remove sneaky strerrorname_np() instance Date: Wed, 24 Apr 2024 17:24:24 -0300 Message-ID: <20240424202425.534338-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424202425.534338-1-dbarboza@ventanamicro.com> References: <20240424202425.534338-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=dbarboza@ventanamicro.com; helo=mail-pf1-x42f.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit d424db2354 excluded some strerrorname_np() instances because they break musl libc builds. Another instance happened to slip by via commit d4ff3da8f4. Remove it before it causes trouble again. Fixes: d4ff3da8f4 (target/riscv/kvm: initialize 'vlenb' via get-reg-list) Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 6a6c6cae80..ee69ea9785 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -1054,8 +1054,8 @@ static void kvm_riscv_read_vlenb(RISCVCPU *cpu, KVMScratchCPU *kvmcpu, ret = ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, ®); if (ret != 0) { - error_report("Unable to read vlenb register, error code: %s", - strerrorname_np(errno)); + error_report("Unable to read vlenb register, error code: %d", + errno); exit(EXIT_FAILURE); } From patchwork Wed Apr 24 20:24:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1927373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=DyOIafxo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VPr9X6mBwz1yZy for ; Thu, 25 Apr 2024 06:26:24 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzjAh-00059M-9H; Wed, 24 Apr 2024 16:24:51 -0400 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 1rzjAa-00055S-5E for qemu-devel@nongnu.org; Wed, 24 Apr 2024 16:24:47 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzjAX-0006XU-SI for qemu-devel@nongnu.org; Wed, 24 Apr 2024 16:24:43 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6f0b9f943cbso331863b3a.0 for ; Wed, 24 Apr 2024 13:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713990280; x=1714595080; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6k1TEiVk/yosToW5KCtbEMqzVSjxDe3oLoEdhyG1u/s=; b=DyOIafxouxjdtnMG3pX5z1SRPAkrv7lr6O3eS2eiI9G56V7MrAg3veyaCbC4QDdVw4 UjcF+mM2o5G+RIkCOwi3801PjjMFt1JhfrpCxEqOOtth5TuZM+rZ4AhSNrQc8Dh05emA n+7J/dOe++72dyyReAAwhulzB1RVuJOdTZOaqR3XxY/moNqJ4ff27BpkGt8SzR4ctQAX 6TkMz2XFajep5jXRAGCB7i28zpYQRpmywz/8pNdSR/tQ1pK7zuUebG1aIDYhQIXXeaT/ WhwhKWXZGqYeAzs0uKfGkmRSfqq1FOnjy0L6R+JVOdZh1vksU3Pn8fQeNqjWnDGwzgei cMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713990280; x=1714595080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6k1TEiVk/yosToW5KCtbEMqzVSjxDe3oLoEdhyG1u/s=; b=qmRgyaBmZFC2y88/EY7+p+mvcAKo5roUxN3AOAlyEmRimFxnLD2exRjgWCvUdkzGvO T8XI/BAxzfE+E7Cmk63j8c7XkvyRNqBqouzwprkEMGoJY+GS3fFLDi2zU1VwmDufi14M RZW+HMBi9rqwICDMCwqa1WkGhzsjxvQs8KCXVMwO/nLp8frqKZB0VB/bHRubeZBIv1aL r3UTgMiqbXjX4bPS9TSsmJ9I6V2qMRYVO78zYb7WmvGmoCgazqXFY4V8H8fG4fdrTrCr TJto1nmRO835BMR+IVgQs6317jODWdJNYHbDo7FCGwmUkVOYzrYTMKrw5BvNcekcFm5x w26Q== X-Gm-Message-State: AOJu0YzidUQFjYz/1PXpHdh4ndjdmJq1pRs/RFmWSXoDNq1+w1Tov8VY zhA5yqTSFHvHXhDFzih6zujDhGxFnhcMJtdvi/xBe9SUsx/rbxGiDqcV1XZRkCTnd6gcyWE8BnS F X-Google-Smtp-Source: AGHT+IFjAy4P2BunZ2vBAbReCxsWdtAGGpbKIsRhXCgwMJf9aIMeHrx+Za/wGLdCUYmVbsAYeINLWw== X-Received: by 2002:a05:6a00:2d87:b0:6ed:60a4:6d9c with SMTP id fb7-20020a056a002d8700b006ed60a46d9cmr4422296pfb.4.1713990279992; Wed, 24 Apr 2024 13:24:39 -0700 (PDT) Received: from grind.. ([191.255.35.121]) by smtp.gmail.com with ESMTPSA id fm8-20020a056a002f8800b006ed059cdf02sm11862015pfb.116.2024.04.24.13.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:24:39 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, thuth@redhat.com, alex.bennee@linaro.org, philmd@linaro.org, mjt@tls.msk.ru, ajones@ventanamicro.com, Daniel Henrique Barboza Subject: [PATCH v2 2/2] checkpatch.pl: forbid strerrorname_np() Date: Wed, 24 Apr 2024 17:24:25 -0300 Message-ID: <20240424202425.534338-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424202425.534338-1-dbarboza@ventanamicro.com> References: <20240424202425.534338-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=dbarboza@ventanamicro.com; helo=mail-pf1-x433.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit d424db2354 removed an instance of strerrorname_np() because it was breaking building with musl libc. A recent RISC-V patch ended up re-introducing it again by accident. Put this function in the baddies list in checkpatch.pl to avoid this situation again. This is what it will look like next time: $ ./scripts/checkpatch.pl 0001-temp-test.patch ERROR: use strerror() instead of strerrorname_np() #22: FILE: target/riscv/kvm/kvm-cpu.c:1058: + strerrorname_np(errno)); total: 1 errors, 0 warnings, 10 lines checked Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7026895074..f7ffa74858 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3078,6 +3078,9 @@ sub process { if ($line =~ /\b(g_)?assert\(0\)/) { ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr); } + if ($line =~ /\bstrerrorname_np\(/) { + ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr); + } my $non_exit_glib_asserts = qr{g_assert_cmpstr| g_assert_cmpint| g_assert_cmpuint|