From patchwork Thu Mar 30 13:18:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28F3EC761AF for ; Thu, 30 Mar 2023 13:19:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBJ-0007VS-Dj; Thu, 30 Mar 2023 09:19:09 -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 1phsBH-0007Ma-M9 for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:07 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBF-000206-KP for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:07 -0400 Received: by mail-wm1-x32f.google.com with SMTP id s13so10881193wmr.4 for ; Thu, 30 Mar 2023 06:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182344; 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=jQ1Gu7qVTMNET7Ilwd4JTbEMslTBn2t6QdfWWwcVZrY=; b=AKVyZGCXp5HbSUgAJNa1jehPofrabn355kzbNpxTOKZDZsM2XjDvRn3KuEZYlo9oNw n/+CZbBBW9a4fqPKvhUS7esg1T4hDN4LSb9tweCM9XciXMvfPKbL5CCLiobiA9DyHhUt 44zccj95IBT5Ep6IJaIsSygTDnW5zCggQcSHNuEelWK8bcIFzWGK67Xql3/bHJ0udPwy UvLi1OfBAQZeq1Fz9xV32v81xClR/cZK6Jc1qA4JjHwE8VOTl28kYy/s8AT5/pCb9zxH pXZ2kl6lB9X7JVZ/hJ3BZLprYWif+XVkcze9HnEP/Ck8zABV3BhnZyc9pzqSW0s3pWcS K8jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182344; 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=jQ1Gu7qVTMNET7Ilwd4JTbEMslTBn2t6QdfWWwcVZrY=; b=L0stawrzSsnDYrUMx9FM6ZTvYl9d2/DTqAjzd7I63xvhXvSM9MzhylzJ/I97bO/EMU aQgu3ReUTHah3XhlkYakyjTNcnyPOoYNVpZ1be1t1zdKcdLL181mAupjtILzq/J8GzB5 lgq13BUjIBGz2x0JzimzNINRobpei4EffUy6NeKM3kT1gf4ETB7KKqkZxQcRXRXTd+Ta fmiQBhzcHUre8+j0ZV+yhOADBktIkh4E6h4FRc0isTF7e3QxLeujX3EqFy5JJsC26PcI KuihngHjzFkHr+HV4pVuGLS2bE9toeOM5tXrWqpAk5BMrEhfHwqaZdlA13CIIqm373Bj oW+Q== X-Gm-Message-State: AO0yUKVv6m3Sy/r1O9f8ZDVvYxw+y19mFw6cMpzj2tOaeKe4EfWl2QgD b5NqX9LfpNkCUyeAQtN/77j9EZAo8urPZwwfzcU= X-Google-Smtp-Source: AK7set+SsjC75DX/ovNXm37ISRrvTRQ56ayUBc0uHCSjPl28MB/EcN16uVoA1Fx3jdH5cI1YP8l2Ng== X-Received: by 2002:a7b:c44b:0:b0:3ed:301c:375c with SMTP id l11-20020a7bc44b000000b003ed301c375cmr18488071wmi.21.1680182343824; Thu, 30 Mar 2023 06:19:03 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b003ebff290a52sm6193963wmb.28.2023.03.30.06.19.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Gregor Riepl , John Paul Adrian Glaubitz , Zach van Rijn , Richard Henderson Subject: [PULL 1/6] linux-user/sparc: Don't use 16-bit UIDs on SPARC V9 Date: Thu, 30 Mar 2023 15:18:51 +0200 Message-Id: <20230330131856.94210-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The 64-bit SPARC V9 syscall ABI uses 32-bit UIDs. Only enable the 16-bit UID wrappers for 32-bit SPARC (V7 and V8). Possibly missed in commit 992f48a036 ("Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)"). Reported-by: Gregor Riepl Tested-by: John Paul Adrian Glaubitz Tested-by: Zach van Rijn Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1394 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Laurent Vivier Message-Id: <20230327131910.78564-1-philmd@linaro.org> --- linux-user/syscall_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 614a1cbc8e..cc37054cb5 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -61,7 +61,7 @@ #if (defined(TARGET_I386) && defined(TARGET_ABI32)) \ || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \ - || defined(TARGET_SPARC) \ + || (defined(TARGET_SPARC) && defined(TARGET_ABI32)) \ || defined(TARGET_M68K) || defined(TARGET_SH4) || defined(TARGET_CRIS) /* 16 bit uid wrappers emulation */ #define USE_UID16 From patchwork Thu Mar 30 13:18:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A0AEC6FD1D for ; Thu, 30 Mar 2023 13:20:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBX-0007sj-1K; Thu, 30 Mar 2023 09:19:24 -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 1phsBM-0007hC-0V for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:13 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBK-00020w-Cj for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:11 -0400 Received: by mail-wm1-x32f.google.com with SMTP id j18-20020a05600c1c1200b003ee5157346cso13429430wms.1 for ; Thu, 30 Mar 2023 06:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182349; 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=ayn4boipfKt66I0EYH92uExFZX9rPHRcwf3MoBEl5oE=; b=WsXDiTktmk/x41KB1TLDuc2UN+WEKkNuKpNzpyrcegs/PMRqhEnQwR6bvKtZQTFZ6L 3ayKX0iuzhaH6wN9ODzjx4RfhZO1rX0BUI55mZatdlJUVjqfTYBqZ5KcQ/LXoiTjJBlP Kra1a8Ummq46NMQw20llMMBonr5WNlxulMxY36nio/Q/WI0Cnw21FX0k/1ZEYpHDl4QS Bp7M9G236Zbu68G1OWtA3Rlg2AFqfflt+KSM/vZDkGs0Z+dJou0Y25aBy6iPsdouy4u7 VdlmabvjMR9iW0GgHngeRoN1VKWkadiWr4kaT5/vqQe5RbKqflaovkIpBeyIqbfrBAzh jK+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182349; 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=ayn4boipfKt66I0EYH92uExFZX9rPHRcwf3MoBEl5oE=; b=Zn3V7DboXHRTH32hJ+Gl3FyOSAkoZZMck7kfyHZqRHmLIDjjO1KtHm7gdWqvKMlHKr XXvHbryQxAuq8ceH66XmyC1viFeEhU+sMJjJ7bAFuf7BS1X+JYfaI3Y534t6ldisLeeP 2NogwW20xLn9y8f/m+mc0d/NnUhHVqrTgY3zQYW325lMrHn770bWAgGWBnDgph0kJkAZ Zw0f6IJdIVmeFr/PZY9wiLU0ObRNkDmDO0tCNz4hFOv+cn1ztMugcEAe8aevH7ujuQgp DP83eY4CdshYe/45aE8I1bclsRl4SNh+kjoKt5xgkqek6N2XQXA2C0o/h/uJL3ad3T6R /AeQ== X-Gm-Message-State: AO0yUKU1itWZrFD4eCyHxwOjwQ6Rg8drbNtqtRabCvXwLZCUWOflo9mJ 3MAtxZpwYbGn5v1E+cTB8ZqglQ563xYTafzdT64= X-Google-Smtp-Source: AK7set+YZ9wYf0Xqxu1W/jM4l89IyEGO4t+X0JRzqsnY8JeeUUr9rwm+N6Om6k0kO99BSFzvXJH2/A== X-Received: by 2002:a05:600c:22cd:b0:3eb:29fe:7343 with SMTP id 13-20020a05600c22cd00b003eb29fe7343mr17152558wmg.33.1680182348879; Thu, 30 Mar 2023 06:19:08 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y26-20020a1c4b1a000000b003ef62deb830sm5816581wma.25.2023.03.30.06.19.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 2/6] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries Date: Thu, 30 Mar 2023 15:18:52 +0200 Message-Id: <20230330131856.94210-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Per the release 6.06 revision history: 5.03 August 21, 2013 • ABS2008 and NAN2008 fields of Table 5.7 “FCSR RegisterField Descriptions” were optional in release 3 and could be R/W, but as of release 5 are required, read-only, and preset by hardware. The P5600 core implements the release 5, and has the ABS2008 and NAN2008 bits set in CP1_fcr31. Therefore it is able to run ELF binaries compiled with EF_MIPS_NAN2008, such the CIP United Debian NaN2008 distribution: http://repo.oss.cipunited.com/mipsel-nan2008/README.txt In order to run such compiled binaries, select by default the P5600 core when the ELF 'MIPS_NAN2008' flag is set. Reported-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Laurent Vivier Message-Id: <20230327162444.388-1-philmd@linaro.org> --- linux-user/mips/target_elf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index a98c9bd6ad..b965e86b2b 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -15,6 +15,9 @@ static inline const char *cpu_get_model(uint32_t eflags) if ((eflags & EF_MIPS_MACH) == EF_MIPS_MACH_5900) { return "R5900"; } + if (eflags & EF_MIPS_NAN2008) { + return "P5600"; + } return "24Kf"; } #endif From patchwork Thu Mar 30 13:18:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3832DC761AF for ; Thu, 30 Mar 2023 13:19:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBb-0007z8-GU; Thu, 30 Mar 2023 09:19:29 -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 1phsBR-0007kG-RU for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:20 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBP-00021J-LR for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:17 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t4so13819112wra.7 for ; Thu, 30 Mar 2023 06:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182354; 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=pAX9S025dEyrSFkAAp1TBAvo2BRP/u6bo3pCVnFlqbg=; b=fQUQwf/cBK97OQOowkvhytsrjJOaPlu/0ZAvY6vLWyMhoRqELhgff/awGoeuDGCw9J NVisV+D2DtIvWmftlK8RTtkpACcST6gmtVb2iWswdFrajMS8Bx3mxEXXlO7VFksJPxFu xtPPRRAd5pZ0TkJPGmPm20nY9m3GEHGm50LksNEhMBDq+d6ELL1C9Xwfcbya0TAQyFCY iUv5ghAgk6TTEISciAZiTEH8yKqWFpwZbEXmB61AfXn51s1ogb6Zweddbnx+qo72SF1p 45Cz+BO0zUyDYayJqWuQLPK08ro28eH2oIKiIynKEaW0yBSscVVuAQW9/LijK/8iBZ+u mxvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182354; 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=pAX9S025dEyrSFkAAp1TBAvo2BRP/u6bo3pCVnFlqbg=; b=oJYIzd953YvOyNCv7Hws/TpOVl3zN+SDsFKWpmKw1o9spUBcSjMozp5mmdW/nYV+ya qDvX2wpjtEu2r4LxOPzaJHP6OUS2N6rY5HlvcJaIh698s8TN956ynR4GnYMClvKKjbPC s2mtPeWA6e+AcqeLtrdfB72aiFGL6sigh0mvb8mrxwhQwa8ScMDMjKyc2qb6huKW87ZZ rrknjbqb6ATHp9Ft05cYvw2pMMDb5/D5UqsgwATUU8M2wFblM7ikWpPC8malFKw/PLkF E7iekrDPXC2uuLjIDdZIklYEOPLggBaDHfuPPixem+Bqo2avmI1YGhuHdFeJn+J3YAg/ 3l1w== X-Gm-Message-State: AAQBX9fROKXT5K06ufWC1517uKzf7LGndCTN79qV9Oim1L63y7belW5P g0oUPpgUPbUd9OhwF/EE7P5vZVe0COO2lCmNduc= X-Google-Smtp-Source: AKy350ZwSI06Ca3g7s2WUzuBMdpXKvtpwTQuo0GWApqKgPn+99UfqNALZS9TuRT3FhR3Oi+ciM3xkg== X-Received: by 2002:adf:e484:0:b0:2ce:a938:ecc9 with SMTP id i4-20020adfe484000000b002cea938ecc9mr17937943wrm.69.1680182354124; Thu, 30 Mar 2023 06:19:14 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e7-20020a5d5307000000b002c5a1bd5280sm32869812wrv.95.2023.03.30.06.19.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, Nathan Chancellor , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Aurelien Jarno Subject: [PULL 3/6] hw/mips/gt64xxx_pci: Don't endian-swap GT_PCI0_CFGADDR Date: Thu, 30 Mar 2023 15:18:53 +0200 Message-Id: <20230330131856.94210-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Jiaxun Yang 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") converted CFGADDR/CFGDATA registers to use PCI_HOST_BRIDGE's accessor facility and enabled byte swap for both CFGADDR/CFGDATA register. However CFGADDR as a ISD internal register is not controlled by MByteSwap bit, it follows endian of all other ISD register, which means it ties to little endian. Move mapping of CFGADDR out of gt64120_update_pci_cfgdata_mapping to disable endian-swapping. Fixes: 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") Reported-by: Nathan Chancellor Signed-off-by: Jiaxun Yang Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Tested-by: Nathan Chancellor Message-Id: <20230223161958.48696-1-jiaxun.yang@flygoat.com> [PMD: !!! Note this only fixes little-endian hosts !!! ] Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/gt64120.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index f226d03420..82c15edb46 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -321,9 +321,6 @@ static void gt64120_isd_mapping(GT64120State *s) static void gt64120_update_pci_cfgdata_mapping(GT64120State *s) { /* Indexed on MByteSwap bit, see Table 158: PCI_0 Command, Offset: 0xc00 */ - static const MemoryRegionOps *pci_host_conf_ops[] = { - &pci_host_conf_be_ops, &pci_host_conf_le_ops - }; static const MemoryRegionOps *pci_host_data_ops[] = { &pci_host_data_be_ops, &pci_host_data_le_ops }; @@ -339,15 +336,6 @@ static void gt64120_update_pci_cfgdata_mapping(GT64120State *s) * - Table 16: 32-bit PCI Transaction Endianess * - Table 158: PCI_0 Command, Offset: 0xc00 */ - if (memory_region_is_mapped(&phb->conf_mem)) { - memory_region_del_subregion(&s->ISD_mem, &phb->conf_mem); - object_unparent(OBJECT(&phb->conf_mem)); - } - memory_region_init_io(&phb->conf_mem, OBJECT(phb), - pci_host_conf_ops[s->regs[GT_PCI0_CMD] & 1], - s, "pci-conf-idx", 4); - memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGADDR << 2, - &phb->conf_mem, 1); if (memory_region_is_mapped(&phb->data_mem)) { memory_region_del_subregion(&s->ISD_mem, &phb->data_mem); @@ -1208,6 +1196,12 @@ static void gt64120_realize(DeviceState *dev, Error **errp) PCI_DEVFN(18, 0), TYPE_PCI_BUS); pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci"); + memory_region_init_io(&phb->conf_mem, OBJECT(phb), + &pci_host_conf_le_ops, + s, "pci-conf-idx", 4); + memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGADDR << 2, + &phb->conf_mem, 1); + /* * The whole address space decoded by the GT-64120A doesn't generate From patchwork Thu Mar 30 13:18:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55C05C6FD1D for ; Thu, 30 Mar 2023 13:20:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBf-0008LG-JE; Thu, 30 Mar 2023 09:19:31 -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 1phsBW-0007uG-Tm for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:24 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBU-00022j-Lt for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:21 -0400 Received: by mail-wr1-x434.google.com with SMTP id m2so19054675wrh.6 for ; Thu, 30 Mar 2023 06:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182359; 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=hLMvNuV9m+vGoYBzqYhhlHDKS4XBdozQbF/ABoeVmps=; b=VnyZ+TcRxuX99uNbCKeRZg7FhEE509QXf1SS33Ac3Ca+75J+il4M4fhrdC5okwHSPh 4nl8s9LcvPJcLelLRiOBGcvz98MGWaOKb+krbet5aBMRZJp21uxZI1VghuoHP0gOnR2z EiERgIhooz8X7ZnLHrVvsckG+TzKEhkOqUHmGmlzCRAFU+1jo4BMOtsgesT/x4htmj90 CLBDJVzli55LGQqmtXh0S4C00ceOOn1Mjl1LQcomP6BFILsbcAGDxJAKnyGjG1WEdHYN Xx4WThaNoNmf8hfne1WKbQSd2SAdAzr+w2JdF2YAJUp92uKW60Ur90PrQgxZ45WUUOoF BSGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182359; 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=hLMvNuV9m+vGoYBzqYhhlHDKS4XBdozQbF/ABoeVmps=; b=Kw61ZB+vYddiMTij2975C5DL5nNtlrA0ZBt68/St65sBJcr8QFXDv/TQ/SRHIp1gYL SgWOBDHIPsAgIucAsJ4gt0yiYWPlkPWUHLBd5HOaTDb9sOW2ZsTY5cPKRAQzEdGxCkb1 EJLQYiFx6s0FSv3AlRANg57VGbHuhK8HS+HDlhZ2mRyg9JqzP19p2ddaAuYGzzcs2djF hBacE+5DvhvVuALtaTrVbogq+WYv98xDfdZsFx9NmwZve7/FCHk+lS+RCpI68jFTF1XW oNz85OXIhex6feLWxCADg0Q5+hXTG1AnUNPsx8nGMW8pQMdCmsdVl3LfsqNppHxE28Zr fT3g== X-Gm-Message-State: AAQBX9dNAQTbPgDmMxnoEhS3LABSeOn+uIGzq+Z5TYOZjagoDG/CD77U xM6vov2VLQnih+Dk4LMv22pxP3g+8GU2Jfp0i6M= X-Google-Smtp-Source: AKy350bQHFq3EE4XMROSlzfQgq2LT/V45+MLVsoZB2LiJi4IhCSNLFsS7As25oF2xPf+nV4brhnP/g== X-Received: by 2002:adf:f0cf:0:b0:2ce:aed5:7dc with SMTP id x15-20020adff0cf000000b002ceaed507dcmr17714530wro.68.1680182359219; Thu, 30 Mar 2023 06:19:19 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id b5-20020adfee85000000b002c573778432sm32650792wro.102.2023.03.30.06.19.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Be?= =?utf-8?q?nn=C3=A9e?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa Subject: [PULL 4/6] tests/avocado: Enable TuxRun/mips64 (big-endian) test Date: Thu, 30 Mar 2023 15:18:54 +0200 Message-Id: <20230330131856.94210-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Now that the previous commit ("hw/mips/gt64xxx_pci: Don't endian-swap GT_PCI0_CFGADDR") fixed the issue accessing the GT64120 PCI config-address register on big-endian targets, we can enable this TuxRun test. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Alex Bennée Message-Id: <20230223220404.63630-1-philmd@linaro.org> --- tests/avocado/tuxrun_baselines.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/avocado/tuxrun_baselines.py b/tests/avocado/tuxrun_baselines.py index c3fb67f5dc..d343376faa 100644 --- a/tests/avocado/tuxrun_baselines.py +++ b/tests/avocado/tuxrun_baselines.py @@ -270,7 +270,6 @@ def test_mips32el(self): """ self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") - @skip("QEMU currently broken") # regression against stable QEMU def test_mips64(self): """ :avocado: tags=arch:mips64 From patchwork Thu Mar 30 13:18:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5693AC761A6 for ; Thu, 30 Mar 2023 13:20:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBg-0008Oz-5v; Thu, 30 Mar 2023 09:19:32 -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 1phsBa-0007zt-N0 for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:27 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBZ-0001z6-4M for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:26 -0400 Received: by mail-wm1-x335.google.com with SMTP id bg16-20020a05600c3c9000b003eb34e21bdfso13451089wmb.0 for ; Thu, 30 Mar 2023 06:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182364; 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=CBSELtOf9xv0/cDxDhg88YCz+YYHgAmDVorjbtOUtaE=; b=b1gZqUxj6PoTjIdBskg3vZ7vW2lBsuIwClSS4pyVG+hoZ+4i2Dk5OFi9ylvyL9Yu6A XVHGig5bJq4kST3W8iZ+/KHpOmSF+0cCWaX3Q9f/Cq2Wz2qFfiCf7qI+gPcEPEm8mfRb qfbWaVBcdMeSBJSBxl8Jdm/jLPvFXW/COyQAKRrGbgpAQ10eiDlE4XfWSxzewiEzKhFZ KrS7WyYJW360cVFw44jTw9l9enec+yKSl0uuCSp40ldxhlpiaa5j2DGPQWVABifkYyI1 8Htv3SYcY2KVTEN8rjssu+2qwEmbeZnzWh8DUD5MRvNbnngXMDONzCIDXp20fQJeApjM gDuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182364; 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=CBSELtOf9xv0/cDxDhg88YCz+YYHgAmDVorjbtOUtaE=; b=Wr8na13ulmWnwfRBb1/iZ6iSbhwOyXDrqz//GWx4IGeA6EzL497iXhCWOVGmDGasOj 0H3DT/0ifR/0pLmD6Fy0VeasG43rRJaszLTx/OF+0m2t/zrnfcU7hvJbfUu2s3XeMmQ/ BGcXkOXoChvQc4ejInFFjGAoik4HQDcsK24P+gvuGJ+BIjFlsCyhb0M47UsH6xtYptlX GeIaUiMx4OXDhOTVJ2WpQR+BbrT+2FpQBndZI9bJGGcSH1B76Q+m5EatDqqAS7SlhCrz GfzFKP8bY21EUJUZX/BPpI7Yn9vDrwr8bC1eByX4xZvvIkVSVdfKYsHo6d6J5TaW2NYw UH9w== X-Gm-Message-State: AO0yUKWEcaR3JQ4aWESiklRLUmKQ3ST5U/oz8dUnlUCPdBvdf9Iwi9Gp 37GHa8s8KaYpzkvN9bklJXcgsUe6AUTQ1lQtXn8= X-Google-Smtp-Source: AK7set9aG+/Xp6kv40jDzKzRgRZVGCEFiblLCMB0aVwx+Ulx0C8w7PEhf9JVbokw7kNjPr6V6kyFEA== X-Received: by 2002:a1c:7702:0:b0:3ed:cfa6:8854 with SMTP id t2-20020a1c7702000000b003edcfa68854mr18261991wmi.26.1680182364111; Thu, 30 Mar 2023 06:19:24 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c315000b003eda46d6792sm6268321wmo.32.2023.03.30.06.19.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, Patrick Venture , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 5/6] hw/i2c: pmbus: block uninitialised string reads Date: Thu, 30 Mar 2023 15:18:55 +0200 Message-Id: <20230330131856.94210-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Titus Rwantare Devices models calling pmbus_send_string can't be relied upon to send a non-zero pointer. This logs an error and doesn't segfault. Reviewed-by: Patrick Venture Signed-off-by: Titus Rwantare Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230322175513.1550412-5-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/pmbus_device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index c3d6046784..44fe4eddbb 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -94,6 +94,13 @@ void pmbus_send64(PMBusDevice *pmdev, uint64_t data) void pmbus_send_string(PMBusDevice *pmdev, const char *data) { + if (!data) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: %s: uninitialised read from 0x%02x\n", + __func__, DEVICE(pmdev)->canonical_path, pmdev->code); + return; + } + size_t len = strlen(data); g_assert(len > 0); g_assert(len + pmdev->out_buf_len < SMBUS_DATA_MAX_LEN); From patchwork Thu Mar 30 13:18:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13194154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A225C761A6 for ; Thu, 30 Mar 2023 13:20:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsBi-0008U3-Ol; Thu, 30 Mar 2023 09:19:34 -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 1phsBg-0008PG-4y for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:32 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phsBe-000203-8F for qemu-devel@nongnu.org; Thu, 30 Mar 2023 09:19:31 -0400 Received: by mail-wm1-x336.google.com with SMTP id n19so10908139wms.0 for ; Thu, 30 Mar 2023 06:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680182369; 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=b4Qm4LX2kkl4/kGpdszX+MCrNUvG+BMcsxJOvXW1ttk=; b=UKwpyL+wLchXVr5BObyFWaNX0D0Dg7SuA3Bqthn9alhX9NGwi5QJombFRFXq5KU9VW yrBjeCZ0Ft2xsEMOfWr9WsJ2E+LDL5ajxK6Ba0MMnCqlzwZAMl7w6BuEXdYPrPVrv1hu DalJhYSjM+6SEAh96wd1ofNn/mmdv4XNK7nXFNnK6whSWseowUO3Kl+uP8MPmKn0gHb3 oY0XOPkf3tpsaTdjAUxhKE+3sHWa681dEz7mJEI4ZGLlYcY0QT3KoTXgKRfoFq5T6T6e HEuDeFNbw5kLfqw9NP4Gl5HCs74tjyIOtW1L7KZfXdkPFZcYqCPeUM+qz896Pm+XS/Pb cCrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182369; 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=b4Qm4LX2kkl4/kGpdszX+MCrNUvG+BMcsxJOvXW1ttk=; b=EuY2f3nUUPOt27ANVNmT0cwhWWIDsDADrk4RhicQzFFCeLY1tjd1uOAT7v/hI8v2bJ JkDW0Bfqe1uVoi24cf7A2q3cUK9Lxln+JuKxwbEfr32mdZcYpdmu+8fhiDdqiPM3dwED 0XYAxc84LA/RjBLV8cGg/lyfGuCyM13S3SHSwXa0tfm4UhUfngXzdxItlDC1aIWfgpEL uEV/2Snrv1F0mShHroHKB0tv/Z8icT5d8BD+h3ZjWzf5v/y6ayX8f0UUfrDZdzgZdbdo Mr0axaOrr8dBPDDfHz0xT1wC2UyZeSbgWr5pOw0TPagDSd1X4VjAQx0SY/JLfaTRxRoh 6RDg== X-Gm-Message-State: AO0yUKXkixqyt2raHI2a8v4hph1MFLrK1CrawmEELYU00XRR9QKCW/zB WhcSnqz38RBszLQ98L7++rJM7OKOUUhlgt8KnNY= X-Google-Smtp-Source: AK7set/nh4Kedp9aNO/4L4X+5QPaMWUoOJV/ni/F/zLf9aKIA2YY0V/lnjj7wxhfX+g5H7g8+lCFeA== X-Received: by 2002:a7b:cb44:0:b0:3ee:672d:caa3 with SMTP id v4-20020a7bcb44000000b003ee672dcaa3mr19345371wmj.18.1680182369214; Thu, 30 Mar 2023 06:19:29 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id s17-20020a05600c45d100b003ed51cdb94csm6177599wmo.26.2023.03.30.06.19.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 30 Mar 2023 06:19:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Titus Rwantare , Laurent Vivier , Jiaxun Yang , qemu-block@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Julio Faracco , Stefan Weil , Kevin Wolf , Hanna Reitz Subject: [PULL 6/6] block/dmg: Ignore C99 prototype declaration mismatch from Date: Thu, 30 Mar 2023 15:18:56 +0200 Message-Id: <20230330131856.94210-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230330131856.94210-1-philmd@linaro.org> References: <20230330131856.94210-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When liblzfe (Apple LZFSE compression library) is present (for example installed via 'brew') on Darwin, QEMU build fails as: Has header "lzfse.h" : YES Library lzfse found: YES Dependencies lzo support : NO snappy support : NO bzip2 support : YES lzfse support : YES zstd support : YES 1.5.2 User defined options dmg : enabled lzfse : enabled [221/903] Compiling C object libblock.fa.p/block_dmg-lzfse.c.o FAILED: libblock.fa.p/block_dmg-lzfse.c.o /opt/homebrew/Cellar/lzfse/1.0/include/lzfse.h:56:43: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] LZFSE_API size_t lzfse_encode_scratch_size(); ^ void /opt/homebrew/Cellar/lzfse/1.0/include/lzfse.h:94:43: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] LZFSE_API size_t lzfse_decode_scratch_size(); ^ void 2 errors generated. ninja: build stopped: subcommand failed. This issue has been reported in the lzfse project in 2016: https://github.com/lzfse/lzfse/issues/3#issuecomment-226574719 Since the project seems unmaintained, simply ignore the strict-prototypes warning check for the header, similarly to how we deal with the GtkItemFactoryCallback prototype from , indirectly included by . Cc: Julio Faracco Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Weil Message-Id: <20230327151349.97572-1-philmd@linaro.org> --- block/dmg-lzfse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/dmg-lzfse.c b/block/dmg-lzfse.c index 6798cf4fbf..4ea0b9b20d 100644 --- a/block/dmg-lzfse.c +++ b/block/dmg-lzfse.c @@ -23,7 +23,12 @@ */ #include "qemu/osdep.h" #include "dmg.h" + +/* Work around a -Wstrict-prototypes warning in LZFSE headers */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-prototypes" #include +#pragma GCC diagnostic pop static int dmg_uncompress_lzfse_do(char *next_in, unsigned int avail_in, char *next_out, unsigned int avail_out)