From patchwork Sat May 15 10:03:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1GW3q3Tz9sWH for ; Sat, 15 May 2021 20:04:51 +1000 (AEST) Received: from localhost ([::1]:47822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrA9-0005wj-GW for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9C-0005oD-44; Sat, 15 May 2021 06:03:50 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50901) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr99-0006Nw-7j; Sat, 15 May 2021 06:03:49 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M42fG-1lhr903840-0001SD; Sat, 15 May 2021 12:03:38 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 01/16] backends/tpm: Replace qemu_mutex_lock calls with QEMU_LOCK_GUARD Date: Sat, 15 May 2021 12:03:20 +0200 Message-Id: <20210515100335.1245468-2-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:l0n4loWCAAMXlr7VKXdQWB32zgzCxYvXFgoMRq/QgR6ex8kRq1m HAfW4SnT8BtHSH9VQekWX0B3i26c8HgZ0YzGI2VBE+aVXRYkYCXGJxcXB5iUetvoZ7bHwES W2e8AHhq1z07goRCOZUcCKjJR05hi0s69KogGzGdJvOJvFBBXFVP1o8kpLOz4lcXLABNO5L DLfOM1r1g9oHChYZB7A8g== X-UI-Out-Filterresults: notjunk:1;V03:K0:lS0tVXeWw+U=:3kPY5v+tfNtSFw9nnEq42U JprwrXJ+5c3ZZArrGN8YORTcVJZH9SXQ4CEYzKG3XiMzdoisGshh5bfDh3YeF+P3uKPo/dQuW 0j/G05ox0miNYcwrMT1WcFdWH6h1aMU0K9ldJiBHL7LZRXw5Kd67RH2Nt0IEJYSpomxBiOhry pFSxr1zawT4p+gBOnd8W9VYnMrWWv7Dc4Yzwmi9PgC0t3Jy73dQkA0QM99+g4DuFQRUXJyIl5 BiRqaJg+Bu1OENG/YCnVkW+YnnhvfxIPt4j2U6KoJBGqYRSkVXYnjvWrx32lJeSQImQBYzbkO /PnLWL98mkhOR7wLA3R/ZzuZAqHf9xNP+ZExgJhgc4OStdbu3krWUfuUOxoVhr2zlFzXbEznO mtYh70R6VjVsEXMmGrzoujYDFhQo3S3Cy/RSxJHLwtNnEABAepTK3kXuZZ0sZLJLIwNr4aJyM oiy3DxyxRPPUJsaAezGkJM9BE1h3bpbU5yzF0cFVp/IA5OIxrBQdKxl/COXODgXdr5MnK8lc4 I+qwd2j/p6ve/XnJ4A53fs= Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Christophe de Dinechin , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Simplify the tpm_emulator_ctrlcmd() handler by replacing a pair of qemu_mutex_lock/qemu_mutex_unlock calls by the WITH_QEMU_LOCK_GUARD macro. Reviewed-by: Stefan Berger Reviewed-by: Christophe de Dinechin Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210512070713.3286188-1-philmd@redhat.com> Signed-off-by: Laurent Vivier --- backends/tpm/tpm_emulator.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index a012adc19341..e5f1063ab6c3 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -30,6 +30,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/sockets.h" +#include "qemu/lockable.h" #include "io/channel-socket.h" #include "sysemu/tpm_backend.h" #include "sysemu/tpm_util.h" @@ -124,31 +125,26 @@ static int tpm_emulator_ctrlcmd(TPMEmulator *tpm, unsigned long cmd, void *msg, uint32_t cmd_no = cpu_to_be32(cmd); ssize_t n = sizeof(uint32_t) + msg_len_in; uint8_t *buf = NULL; - int ret = -1; - qemu_mutex_lock(&tpm->mutex); + WITH_QEMU_LOCK_GUARD(&tpm->mutex) { + buf = g_alloca(n); + memcpy(buf, &cmd_no, sizeof(cmd_no)); + memcpy(buf + sizeof(cmd_no), msg, msg_len_in); - buf = g_alloca(n); - memcpy(buf, &cmd_no, sizeof(cmd_no)); - memcpy(buf + sizeof(cmd_no), msg, msg_len_in); - - n = qemu_chr_fe_write_all(dev, buf, n); - if (n <= 0) { - goto end; - } - - if (msg_len_out != 0) { - n = qemu_chr_fe_read_all(dev, msg, msg_len_out); + n = qemu_chr_fe_write_all(dev, buf, n); if (n <= 0) { - goto end; + return -1; } - } - ret = 0; + if (msg_len_out != 0) { + n = qemu_chr_fe_read_all(dev, msg, msg_len_out); + if (n <= 0) { + return -1; + } + } + } -end: - qemu_mutex_unlock(&tpm->mutex); - return ret; + return 0; } static int tpm_emulator_unix_tx_bufs(TPMEmulator *tpm_emu, From patchwork Sat May 15 10:03:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Gr3F2pz9sCD for ; Sat, 15 May 2021 20:05:08 +1000 (AEST) Received: from localhost ([::1]:48318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrAO-0006PC-Kh for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:05:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9B-0005n9-PI; Sat, 15 May 2021 06:03:49 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:60647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr99-0006Mw-2Q; Sat, 15 May 2021 06:03:49 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N79q6-1lRIDX3YEe-017Xqn; Sat, 15 May 2021 12:03:40 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 02/16] hw/virtio: Pass virtio_feature_get_config_size() a const argument Date: Sat, 15 May 2021 12:03:21 +0200 Message-Id: <20210515100335.1245468-3-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:F4pdN0aAaNmH/CNBgA3QFvEAkLGXx69NiRBYiLkHyltoRajX5QW t37Pb3172utJFE6h40BVgsMqaLaEJbYrEkamWvnMuyjoTNB0RlzGQ/U8fH94FZR6kdyEUrU 0ccPeiku9VK4WwL8wS6AJDCM+JH71cLrZsMskNYQA9o8ktSS6jkpAH+RljjoDrL8UtCPcJq Hlh+7rcN88dBlIb2Ab++Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:3652nFo72+s=:1MT1pscSZlh1ipP76z2UVm tyDzn7B8nEX/x3cNtg9EeoeINwqXwsj9FYW53ciKXRLh5ne88S00+018y2gAudLHuV6WRCV2q MQvSu+5kM3JIpIv/Xetv5sW5CQkNJ9ntwZwlmTekfmLW35rMSAnG8b+6bWvzazMEfqdVPSZJc Y8Ruh/JCBsBAEksDoFNsBS42nPx6GBfstcgudnNx5hOG5A+Flmj2FeVpyWui0dLnjwWPACXcc K4LZK1czvjo2sVUhglHuFumZmgab0LomL+GV3x1vDi8PvI7lgWd5qGz+dzmmz91wG+wpa/Zgz mriyTs7FtSUFsLbApRUkok2mZqHmPMCG6lpA0EHwXzZgelM/UTKXJDoTZdOjf2+JE3zqlkbB1 3/e2ecMaCm7KErPwfywn+A0Of3Vtwc/R4K09Fs9w9Tt6WzxFvsBFZlVHxX1iEggBX9Fe7at6+ 67omuHGZaZJBnFzhYOhpoX7pFY0/toRUFgeEzd6SzlRjphInROGpOv2ALYruKc8FXo3NKO8GZ hMT1vt5fw/RtACIYAIFJOQ= Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Jason Wang , Richard Henderson , Laurent Vivier , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The VirtIOFeature structure isn't modified, mark it const. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Message-Id: <20210511104157.2880306-2-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/virtio/virtio.c | 2 +- include/hw/virtio/virtio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9e13cb9e3adf..e02544b2df76 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2981,7 +2981,7 @@ int virtio_set_features(VirtIODevice *vdev, uint64_t val) return ret; } -size_t virtio_feature_get_config_size(VirtIOFeature *feature_sizes, +size_t virtio_feature_get_config_size(const VirtIOFeature *feature_sizes, uint64_t host_features) { size_t config_size = 0; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b7ece7a6a891..8bab9cfb7507 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -43,7 +43,7 @@ typedef struct VirtIOFeature { size_t end; } VirtIOFeature; -size_t virtio_feature_get_config_size(VirtIOFeature *features, +size_t virtio_feature_get_config_size(const VirtIOFeature *features, uint64_t host_features); typedef struct VirtQueue VirtQueue; From patchwork Sat May 15 10:03:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Mc59Lrz9sCD for ; Sat, 15 May 2021 20:09:16 +1000 (AEST) Received: from localhost ([::1]:56766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrEQ-0003lz-Lt for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:09:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9C-0005r3-VU; Sat, 15 May 2021 06:03:51 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:40397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr99-0006O2-G8; Sat, 15 May 2021 06:03:50 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3Kc8-1lYTUc2vCc-010PW7; Sat, 15 May 2021 12:03:40 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 03/16] virtio-blk: Constify VirtIOFeature feature_sizes[] Date: Sat, 15 May 2021 12:03:22 +0200 Message-Id: <20210515100335.1245468-4-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:9hsZWkOkDIxZzI1MB9M8jN7watGfigavbQE7+h/fcvuh1qfLfPM mttQBh97vnrAjL4tTbZdKu7eKmbz8Xk5e/RKrid3IRCkS/SxbBOSNUbADt43jPIxcVdZM7/ naAeeEH7yrpEZhwW+PIIGWxQmqic0+kA9CKLKYkOl0uBOp6BU99WFRCKetttS3Or9CaQCvF BVaypqvAN3uy7aW3ZOzhg== X-UI-Out-Filterresults: notjunk:1;V03:K0:6eM4hRaTKjY=:oQczKcuZE3nSGtC0blaxhV D2DgxpAe0eGFt1X8+qWeHORfYukaJRdxMSdEAK7F4O6glQL03423CKdJyWx7+ohxao+MqXG37 urUjiCwwSWyEduuGkyLgZfowDcpU3kKWvaEU7iGp0+A1PJUeUCLz8Ezy6+HvJ/XlE3oIhim1z yvKB2p0/KMgWWL25+6BCBUzZlM8zDQsaOZdt//yydKElQN0WMdZPoj8n8P3nXs3ND4oP4UwXW wUUai3lDgGbyxQaSuILMoLsfCH8zhKXiDepNLhT6AxHop4/5zoA+a5Zw2fPf6n+y6Pe8Rz13F 56gBxaQ6NlyxTyLthXTuVXGGwlgN/6TaPI8yLrvqqrGc18jkhOH57PMicgedtYtMTbNeYoh/k DiDp/sr1z0Ll+K8Cg2RYd345XRV6h+zcC7HDA7iuEmNFUeezL4RxLd1FSy89JaessquGQZ1IE a27RO2NbAlg+0w+M1USJZMjrwfBJxAq4esjPEQfDBamUkRy+8ESBmgMCzA/+3BbdFr79t/Be9 38/hu83Kug9UQTANP1nDJA= Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Jason Wang , Richard Henderson , Laurent Vivier , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Message-Id: <20210511104157.2880306-3-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index d28979efb8d7..f139cd7cc9cc 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -40,7 +40,7 @@ * Starting from the discard feature, we can use this array to properly * set the config size depending on the features enabled. */ -static VirtIOFeature feature_sizes[] = { +static const VirtIOFeature feature_sizes[] = { {.flags = 1ULL << VIRTIO_BLK_F_DISCARD, .end = endof(struct virtio_blk_config, discard_sector_alignment)}, {.flags = 1ULL << VIRTIO_BLK_F_WRITE_ZEROES, From patchwork Sat May 15 10:03:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Q32Kmfz9sCD for ; Sat, 15 May 2021 20:11:23 +1000 (AEST) Received: from localhost ([::1]:37090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrGT-00011H-8h for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:11:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9E-0005w7-Lq; Sat, 15 May 2021 06:03:52 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:45063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9C-0006Qb-U5; Sat, 15 May 2021 06:03:52 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MLi4c-1lzWWL1yUK-00HgpV; Sat, 15 May 2021 12:03:41 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 04/16] virtio-net: Constify VirtIOFeature feature_sizes[] Date: Sat, 15 May 2021 12:03:23 +0200 Message-Id: <20210515100335.1245468-5-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:bRGzTGu9Z+JIoyff1IN1eNg5pPLUCaEIow/ncCv217hZHOH4Ff/ Mx+Dr+GzRKsbd15hBMQB6eQLriZ91oQdSDCdKr8RXlWoOqXbuon9REIT8teCkTXRB+uAzXe Zfb4EKhmYjD3ARoKdQR02ZFDHt6Pzon6gW7XXorY7eeqY0jN9xh9m+WteZ6aaxHJSeRFpYz Fl62nxlZwap6G7RY3uI9g== X-UI-Out-Filterresults: notjunk:1;V03:K0:ENFba2k0SEU=:6PqXdtfhM2NtCbfKwK3Gl2 eLCOZkFwIh1ZeepWD+2zLqAI0IT9VGiD51Qspkri0gI7QrB4NChswYz7W7Az0XY8Hvcn54xqG lVLDPo6FOlcQctsov66+KTK4AKpoKpDd68NOvJ05hr31jystIW+LvTBVa5Ic9qrF4Lpj9f8DW B1M5pS7rjL9edMiEuevq591uUuaXIn7HXP8xcvgwuPfnTajJO5aEbRh/r1qJjtGzU/Ne8VF6s qvQt1QMIgSHX8+71kTYL2b7UlSQKIM+oQSADNvIUqVG7pTVR2+314gVV827nffp6bhzBux8Po dpgZiYdLXSy/HfTSDY4e106iiz1nz+MkQaHHzI58Py+4s5e7ijLyDdD+1VfUScq7mjCpXph4a n5xjguxP7YsJD19b1FO61PGoGJj7b+W3+T2a1vI6SeNx2Nfi9scjA8LRZtaIIbHrfL9hAzFD0 B1LUWVQqUCKXGNrWJWnnshOsFxTmv/8BAanlRb6JNA9XTH4TZShEOEmvD0v+oJ9eLnIZubpHx i4tta1MuJEJq5UWd5rtC1Q= Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Jason Wang , Richard Henderson , Laurent Vivier , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Message-Id: <20210511104157.2880306-4-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 66b9ff451185..6b7e8dd04ef3 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -89,7 +89,7 @@ VIRTIO_NET_RSS_HASH_TYPE_TCP_EX | \ VIRTIO_NET_RSS_HASH_TYPE_UDP_EX) -static VirtIOFeature feature_sizes[] = { +static const VirtIOFeature feature_sizes[] = { {.flags = 1ULL << VIRTIO_NET_F_MAC, .end = endof(struct virtio_net_config, mac)}, {.flags = 1ULL << VIRTIO_NET_F_STATUS, From patchwork Sat May 15 10:03:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Mq6KG2z9sCD for ; Sat, 15 May 2021 20:09:27 +1000 (AEST) Received: from localhost ([::1]:57454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrEb-0004D0-Tw for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9D-0005s2-CX; Sat, 15 May 2021 06:03:51 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:47889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr99-0006O0-C6; Sat, 15 May 2021 06:03:51 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N7zJl-1lTmer0cM7-0154DC; Sat, 15 May 2021 12:03:42 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 05/16] virtiofsd: Fix check of chown()'s return value Date: Sat, 15 May 2021 12:03:24 +0200 Message-Id: <20210515100335.1245468-6-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:yMxAyluc3nKt4dIdebDpTE4Kw1UVmdbj91ORM8n/HuB4pJxHw4u fYZSGk1xnjVGTzwtxjMaa+1x+33zKtSqwBMtPKmyKej9YiDIFQRoVv/XWNf5j3Ugx5qtfre 5dh84ctIcoJoC69UQH3GrIuk9FaKusStJqZO4Km3Ma0jvCz73q3TcfQKg0pwZJByWyt2bM8 jX8A9W5XiFMBo7RKYIOLg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Q1N6ik1CI8c=:RfHtMHc5c2lUiva9QArLIN OB8XUhF2YJzC5J9ffNo56NV9VASKzqZeylgspVEAqjKs5ilaEw3VhW7KQN9UeDzFVhM3PjVIr F0sA6OmJth+xUoOVPNZdVV7TolYqQqgNzMDK5B9QWBbcltM1ImmmOnSvuwhtUZz/+0Mv5qMh3 kvxGw30uG+GioIAtS2I3d7vxWxSIaI/C1OmggyQpIl9/NEYYoYQeRNy84XFGYpdpNEMqYnaax F1I4fhYYbdAE2I8JRCEbE9u+kfP4+MmUdf6X0ghd1y5LtjCpajXa/0EFX7yiblu14m1iOZgzu h1yQ0uGc7+b5/EXcbawIgoeZNy+IgndvHEeVfoByLDM3pBTp4YlZl5udmTmn8b49I9c9iTaA/ U845lyobWiqh3fAUHILoK+ogqR0i7t4pvtn1UAhyh8T+hOGZMPEz6EFPEBS8sNiIN9mHr8Me2 LS6x/5p92QuoTnhFgc752XLK2O5M1lbgkexA6xtYwBG5YOttPZNaZQNuZJQzInRgf4xnFrHfN 7923WIZVeojhiW9hG4O8ug= Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , "Dr . David Alan Gilbert" , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz Otherwise you always get this warning when using --socket-group=users vhost socket failed to set group to users (100) While here, print out the error if chown() fails. Fixes: f6698f2b03b0 ("tools/virtiofsd: add support for --socket-group") Signed-off-by: Greg Kurz Reviewed-by: Dr. David Alan Gilbert Message-Id: <162040394890.714971.15502455176528384778.stgit@bahia.lan> Signed-off-by: Laurent Vivier --- tools/virtiofsd/fuse_virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 1170f375a57a..9efdbd8ffd0a 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -1024,9 +1024,9 @@ static int fv_create_listen_socket(struct fuse_session *se) if (se->vu_socket_group) { struct group *g = getgrnam(se->vu_socket_group); if (g) { - if (!chown(se->vu_socket_path, -1, g->gr_gid)) { + if (chown(se->vu_socket_path, -1, g->gr_gid) == -1) { fuse_log(FUSE_LOG_WARNING, - "vhost socket failed to set group to %s (%d)\n", + "vhost socket failed to set group to %s (%d): %m\n", se->vu_socket_group, g->gr_gid); } } From patchwork Sat May 15 10:03:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Mf3K3Xz9sCD for ; Sat, 15 May 2021 20:09:18 +1000 (AEST) Received: from localhost ([::1]:56934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrES-0003sS-Fc for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:09:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9A-0005kZ-Nm; Sat, 15 May 2021 06:03:48 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr99-0006NH-2P; Sat, 15 May 2021 06:03:48 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MtOSu-1lMKPo2u46-00usfH; Sat, 15 May 2021 12:03:42 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 06/16] qapi: spelling fix (addtional) Date: Sat, 15 May 2021 12:03:25 +0200 Message-Id: <20210515100335.1245468-7-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:f8zYeEzuDZNvbqvCYJTQYPvCrBHo4j/Z+OGCfx/feA1Fp8/9dgB WbPSdTkkrjM36R3MmwxNRiR8RANmHPkKRhgSeZ/tMsO+GXjkKPNK/CHq0B5x8/t4WVy2tZX PWXND46MsHJLVk6XNN6Ivak6iouh7DL9RQZePCs5mxCC+o1pkyPX4KMW/XFFxGzFFMXAu/X Utjk2Lu6ZkSd/MCiKxUKg== X-UI-Out-Filterresults: notjunk:1;V03:K0:dgFrppF26gs=:UeJq68j6Hr22M1KvmV8qxr ZeFCCADPZfBJtJj0dHtZH7B4/PREbkd1NhcPJGCUSFSYmfFzDbrE77ciat8fkKpJFN3N0oDnm R2wojxsphXd71/g2CdtKZ/W1YDkk6VtdL6OL9I5oTIkRNDbhzg5bo7jxXMa4rBucy0CCpdaA5 o07m/2izA1UrGWpWuexHXicPo4Ra7pR59cGNlI/pn7ezOV7dmW6OdtcBWwVwieYbR1aeWvYvE IIFFPlZpKHJ2jd9SAwLUtjZ2b1/OXWLvVSnH47KwTGCYxtjB+eHmRy8HI7hqHvppmca/PVhrr DibRZqhq5a8n/FofyBzQYUP1ZqqKP0ISjzvk7DFOY/LK7BXAE3yhngyAqnlQxovu/6WuYRe8E GoWb0Vhl4/gBabewtR5WNEiqd8CxGLHEVTXILBUPFY/AgI3yVllCKj4yV4U0Og0UElY9F6+kT uiNXZPs4g7BjGsh65YDt2aVstAuIkq4lmMA3SGZAWX0yD+zR85M2GzZb4W/4fSBATiuMMhPS8 XZhZr2mjeV1kTPIworT8HA= Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Michael Tokarev , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michael Tokarev Fixes: 3d0d3c30ae3a259bff176f85a3efa2d0816695af Signed-off-by: Michael Tokarev Reviewed-by: Kevin Wolf Message-Id: <20210508093315.393274-1-mjt@msgid.tls.msk.ru> Signed-off-by: Laurent Vivier --- qapi/qom.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index cd0e76d56459..40d70c434a09 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -251,8 +251,8 @@ # # @max_queue_size: the maximum number of packets to keep in the queue for # comparing with incoming packets from @secondary_in. If the -# queue is full and addtional packets are received, the -# addtional packets are dropped. (default: 1024) +# queue is full and additional packets are received, the +# additional packets are dropped. (default: 1024) # # @vnet_hdr_support: if true, vnet header support is enabled (default: false) # From patchwork Sat May 15 10:03:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1NL4xJKz9sCD for ; Sat, 15 May 2021 20:09:54 +1000 (AEST) Received: from localhost ([::1]:59366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrF2-0005V6-PL for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:09:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9J-00061E-3b; Sat, 15 May 2021 06:03:58 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:40445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9F-0006TM-GB; Sat, 15 May 2021 06:03:55 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MQvGz-1ltBG41IP9-00Nzgc; Sat, 15 May 2021 12:03:43 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 07/16] hw/gpio/aspeed: spelling fix (addtional) Date: Sat, 15 May 2021 12:03:26 +0200 Message-Id: <20210515100335.1245468-8-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Gef4iKC6HnN1PVPj68MKpz7+J6RjcRRixx5jlTR9SkWA1geZoFe rABMhwCiKJC00vFb/f/G5igk1LjNy1ljTvdHB4byOc86mNEJEiDjh9G4WFsYAVAW9o4Aqtf +igzVGC90guwuEpxLNpqfddmVTUDVhomywMxWfWup4Bg2UMqtW3xrAhG23LRZE/t9SSeWer anc3Gzvn4NjzvalQvL0Qw== X-UI-Out-Filterresults: notjunk:1;V03:K0:96Saw/weRM8=:nhRq8TEatdIiVr9ea1wiVz bDjW6co6LpVUqR61iqFA1yNFvb0qesxYCAfg5WyjLK8jlshZaq9D2QvGpikL0UDz/gWlLd8Sx 9nB7MnB3dMdquJrbEs1tYUKI17154Vkt16R7Zjyc8LwHfmFFUSHMlNhPU6XdBqjwZyhw7O98J 2Mlup8W3txGzKtjvvOMOAEpPlrh7BdLfdvdK/+walqx156wH+OqyrDqi5u0dXmYSnL3iufVaN gMUSZW8nKtttKXiG6ZZFnj+Bu95eVp9GIGcjaVMeiO6n+yZGMcj6CKs8Q7JtJHv0RK3WjNU4M g/E05E3vZkif5jyu/bzXUhEOvS1Ks0wQkkVtA6RAgKaTAM48WUSuLn1egu9ik0D8hfNhMpre+ 3/G+k+ZFo4EjrZayrof5bmcn0J8YTc15xWU7fgYNH12Vat6Ayiy/h4TsO5dy0E86F8kuqolpP 143VxFIQRfJE+DKOkkyYaRBWZ5JkCrLRWEuwZ0ovMSV5UGYa0vz/SHB/2B1W4mwdM4RqNHXi6 xD6tNaxPUtwfcpuUwJuh+Y= Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michael Tokarev Fixes: 36d737ee82b2972167e97901c5271ba3f904ba71 Signed-off-by: Michael Tokarev Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210508093615.411920-1-mjt@msgid.tls.msk.ru> Signed-off-by: Laurent Vivier --- hw/gpio/aspeed_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 985a259e05b7..34d8acb0e37a 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -170,7 +170,7 @@ /* AST2600 only - 1.8V gpios */ /* * The AST2600 has same 3.6V gpios as the AST2400 (memory offsets 0x0-0x198) - * and addtional 1.8V gpios (memory offsets 0x800-0x9D4). + * and additional 1.8V gpios (memory offsets 0x800-0x9D4). */ #define GPIO_1_8V_REG_OFFSET 0x800 #define GPIO_1_8V_ABCD_DATA_VALUE ((0x800 - GPIO_1_8V_REG_OFFSET) >> 2) From patchwork Sat May 15 10:03:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Sk4NmPz9sCD for ; Sat, 15 May 2021 20:13:42 +1000 (AEST) Received: from localhost ([::1]:45598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrIi-0006kn-IJ for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:13:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9K-00062R-PO; Sat, 15 May 2021 06:04:00 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9J-0006V7-46; Sat, 15 May 2021 06:03:58 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MFsd7-1li8g30TNv-00HMwA; Sat, 15 May 2021 12:03:44 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 08/16] hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface) Date: Sat, 15 May 2021 12:03:27 +0200 Message-Id: <20210515100335.1245468-9-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:yqgfvg3KKGDk3mIT/ECmJpdyRQVSmirasttAUsDRh9iI+7cQrIm SXaOMbhYQc98D/2noTTSY0MH6R7xyAuN4Kd8vDnnmwDq9UkmGdOQLkZvlGMtR45w1zIFWh+ zcr3l5sPXIArzSv0wvj6FiaP2FWyO2rAX+Ea2cMgLoo5vk7rFdYj3fFT5PxNOC7azsTQzTM G52DgCjRNE29mvkWxXrGg== X-UI-Out-Filterresults: notjunk:1;V03:K0:8+5LOmKOGt4=:cEPMLYU43xDtaJsZ9S3J6K lQIy/DxZm1wajCNW9kR/AhKuj1L4I6nuZDQHXR2YnWukpfDkvvcjK8+6hpG+jW6oKB5V1x2XI IcvYtecGdmng+AhD23OyfpQQT/oFth6o8mwMX6rDB5htB3uAg79Lhwc+NeKqowr7bQ4u/hNPR UtWRlYePC/CqlUzJ4dk0KqXVOcDsiiw5Q6/UW3o5hSrPVvnDNIIoV/p6VBADqXi7+YCgyiirL 5c4p0I0k8QCv0/ygWcPBbbOakKzFv1+hYaHDGxK5oWiQuf97+YN0GdoByIj2irtQmmdwFnYKL 3gogJD1NqH6TYSFXBfeD3X5Hw9Fa09pAT8rcZaox5jBXxb4lzOsQVNKxhAzPj7mtfi9tAf0bN 0vKP8pKFgImMQUOXc1N72csx+1gm6X7pbRGssrgFEVHXQV81df8mFZ4FuejA0yFvicV4wqtVe XMMiQdkNB13ynpWpKZ/Jo8bPlqQ2pOWjiTuxelCiwa4VGPSRIpWfX2VgeRcieUmekoFUozTyG AVAc/g2KioAJ2KNtvum9DU= Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, "Edgar E . Iglesias" , Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé TYPE_ETRAX_FS_TIMER is a sysbus device, so its DeviceClass::reset() handler is called automatically when its qbus parent is reset (we don't need to register it manually). Convert the generic reset to a enter/hold resettable ones, and remove the qemu_register_reset() call. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20210502163931.552675-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/timer/etraxfs_timer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index 5379006086fb..4ba662190de3 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -309,9 +309,9 @@ static const MemoryRegionOps timer_ops = { } }; -static void etraxfs_timer_reset(void *opaque) +static void etraxfs_timer_reset_enter(Object *obj, ResetType type) { - ETRAXTimerState *t = opaque; + ETRAXTimerState *t = ETRAX_TIMER(obj); ptimer_transaction_begin(t->ptimer_t0); ptimer_stop(t->ptimer_t0); @@ -325,6 +325,12 @@ static void etraxfs_timer_reset(void *opaque) t->rw_wd_ctrl = 0; t->r_intr = 0; t->rw_intr_mask = 0; +} + +static void etraxfs_timer_reset_hold(Object *obj) +{ + ETRAXTimerState *t = ETRAX_TIMER(obj); + qemu_irq_lower(t->irq); } @@ -343,14 +349,16 @@ static void etraxfs_timer_realize(DeviceState *dev, Error **errp) memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "etraxfs-timer", 0x5c); sysbus_init_mmio(sbd, &t->mmio); - qemu_register_reset(etraxfs_timer_reset, t); } static void etraxfs_timer_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); dc->realize = etraxfs_timer_realize; + rc->phases.enter = etraxfs_timer_reset_enter; + rc->phases.hold = etraxfs_timer_reset_hold; } static const TypeInfo etraxfs_timer_info = { From patchwork Sat May 15 10:03:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1T04Szyz9sCD for ; Sat, 15 May 2021 20:13:56 +1000 (AEST) Received: from localhost ([::1]:46662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrIw-0007Re-DZ for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:13:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9O-00064k-7j; Sat, 15 May 2021 06:04:02 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:60909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9K-0006W1-TE; Sat, 15 May 2021 06:04:01 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N1feo-1lWoWG33Si-0124Cv; Sat, 15 May 2021 12:03:44 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 09/16] hw/rtc/mc146818rtc: Convert to 3-phase reset (Resettable interface) Date: Sat, 15 May 2021 12:03:28 +0200 Message-Id: <20210515100335.1245468-10-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ySd+7Fq0UBm4acjQNPswWkZ/9+YxobsWOAU0iX+t/iA/u0MQgWp 6EcymnmUUA5OepU7CBj0ciWPxHSyXP58ewumiZ17MNyrF76lHEEn3Lg9ZI3JCkfMCcIz+pn 3MIE3Uzox6dCxmpPmGUHi26IWPNVwx8Q25yiDG+Ma+KEqxtcXTvSIvNUXeGmJifDQTzMwAg bPtvfyZIQ/72yqupNDQlg== X-UI-Out-Filterresults: notjunk:1;V03:K0:SOI2ISj2HnM=:O7wbSuzFVJrCnMEHCPasEY cu837r8zjq9+yo9+LzF3Gd52xbVpw2TgIpMOahxf/nHFQkwfYz+9dBaXzjJCGiJaaIQ1U4lCI 9VIxELb+4F11Nug3PKQcj5+HBsdgHoEP6dolYe6+0qH+1YBgXTu2jNzzx855ZqBYGctQITa7z 3IOyBjFl0/8EL04yvfIfVo5zOZC/hl8UGgz0YFm7k6KGC5B/qL5yT8JpKBFhgYdm4KcVP2A6Z /9ateLagfFyCloIL3by6J/0M1WHXvrEBT90LPLtpD4C2Ze/2QjJ5wmzEVSRZwB44Un82OW2ti ykaRfhadkdNa9CT4Sx6thRDmRnAk2Zr6GW+PDDvJHU3m/xx3xcqXIJP1aclsfr5/+44KC9Cbl HHopIbJ8YUKH3EK0lLx0CgatPeAXYVsSXPfEO37NpDo0EUMMvVVe5/tkh8qXd0/Ug1m7WBDS/ ZwRI93S+kH2LXs7bUr2YuEU/T5eEU101LlHmkzb3f13tWBEeokL4x4F91tqj/62LzRTFihiBe HiHBAFMhk+BVO69uxZo9NI= Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, "Edgar E . Iglesias" , Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé TYPE_MC146818_RTC is an ISA device, so its DeviceClass::reset() handler is called automatically when its qbus parent is reset (we don't need to register it manually). We have 2 reset() methods: a generic one and the qdev one. Merge them into a reset_enter handler (keeping the IRQ lowering to a reset_hold one), and remove the qemu_register_reset() call. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20210502163931.552675-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/rtc/mc146818rtc.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 3d2d3854e716..4fbafddb226d 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -871,22 +871,6 @@ static void rtc_notify_suspend(Notifier *notifier, void *data) rtc_set_memory(ISA_DEVICE(s), 0xF, 0xFE); } -static void rtc_reset(void *opaque) -{ - RTCState *s = opaque; - - s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE); - s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF); - check_update_timer(s); - - qemu_irq_lower(s->irq); - - if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) { - s->irq_coalesced = 0; - s->irq_reinject_on_ack_count = 0; - } -} - static const MemoryRegionOps cmos_ops = { .read = cmos_ioport_read, .write = cmos_ioport_write, @@ -961,7 +945,6 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) memory_region_add_coalescing(&s->coalesced_io, 0, 1); qdev_set_legacy_instance_id(dev, RTC_ISA_BASE, 3); - qemu_register_reset(rtc_reset, s); object_property_add_tm(OBJECT(s), "date", rtc_get_date); @@ -997,15 +980,32 @@ static Property mc146818rtc_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static void rtc_resetdev(DeviceState *d) +static void rtc_reset_enter(Object *obj, ResetType type) { - RTCState *s = MC146818_RTC(d); + RTCState *s = MC146818_RTC(obj); /* Reason: VM do suspend self will set 0xfe * Reset any values other than 0xfe(Guest suspend case) */ if (s->cmos_data[0x0f] != 0xfe) { s->cmos_data[0x0f] = 0x00; } + + s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE); + s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF); + check_update_timer(s); + + + if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) { + s->irq_coalesced = 0; + s->irq_reinject_on_ack_count = 0; + } +} + +static void rtc_reset_hold(Object *obj) +{ + RTCState *s = MC146818_RTC(obj); + + qemu_irq_lower(s->irq); } static void rtc_build_aml(ISADevice *isadev, Aml *scope) @@ -1032,11 +1032,13 @@ static void rtc_build_aml(ISADevice *isadev, Aml *scope) static void rtc_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); dc->realize = rtc_realizefn; - dc->reset = rtc_resetdev; dc->vmsd = &vmstate_rtc; + rc->phases.enter = rtc_reset_enter; + rc->phases.hold = rtc_reset_hold; isa->build_aml = rtc_build_aml; device_class_set_props(dc, mc146818rtc_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); From patchwork Sat May 15 10:03:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1J86p8Vz9sCD for ; Sat, 15 May 2021 20:06:16 +1000 (AEST) Received: from localhost ([::1]:50796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrBW-000875-UM for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:06:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9G-0005zy-DU; Sat, 15 May 2021 06:03:54 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:46649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9E-0006Rf-L0; Sat, 15 May 2021 06:03:54 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N8GIg-1lUbb72SAa-014Ezx; Sat, 15 May 2021 12:03:45 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 10/16] cutils: fix memory leak in get_relocated_path() Date: Sat, 15 May 2021 12:03:29 +0200 Message-Id: <20210515100335.1245468-11-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:hQgSLniPSPIkFasef2ucT2q7fNqhdgkXoz4XL/29Gek8tIhn7cg xVfStAtiuhiGqhev85LW0FNnThLPc3Stp3L2++2m6rG4uTdBhTteMpP0zgonMc4eHRlp20C ximVuLcf0zpflqIwPNg0wJIH7O891SzqStY4ptGEJrG1T2cBh820jlNbtKGcqhCCWozl/G4 8qJyoaFTapqFYO3CtT8Xw== X-UI-Out-Filterresults: notjunk:1;V03:K0:3nS4Wi9fYB4=:OhBA2UU0B2/qCSx2xObyLJ wcakKu98mWJM7U2+VltgXC4ZGk7XTvIlqX+B2tkUTw4ubpbb22BOZohCZDDTUQrHOf0Vxwohn n8f9QJeEb6l/kA3tIMnsIBKoS/w5Ox7LFndifIjXgwSjLI5Dkl8G5ZfKw8O94QMbKjhGWTnGd cta+XAbp84ZQ/2Eu6evo6po4f1hNzVjNjPZO7y5Uz8zkZl4aFms8uQeO1+ogWG2M4xYqYT9gr 12/egMMuIISUtiL0X0fSGq9WHF1V16l27rhBMp/X1EFycEs4ZU0OKNjOUuqnZUdj8iSl3qCZu CUtZp4C9wrS5/b85kr3B1/L+LdmMii2MubVyAD16DW34AvSNz1jql8ZTZvZm6iHQ8uMtU6s1S gUdzcIHYWLE7KxEu2j9WVbcATOt8ce7OPQ6koR6/cHZzJTFF1BMi95i76cr7tQiugmGsfGXlS oASbGtj656ozNZ2SnSFMK8qIm9aOLJCQnrxmaD8XamIfEu7j6lQ3HrpfiZtwQiiOlETo/7GPt pTP5kkDy8VVjORs2s9P2Vc= Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Markus Armbruster , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefano Garzarella get_relocated_path() allocates a GString object and returns the character data (C string) to the caller without freeing the memory allocated for that object as reported by valgrind: 24 bytes in 1 blocks are definitely lost in loss record 2,805 of 6,532 at 0x4839809: malloc (vg_replace_malloc.c:307) by 0x55AABB8: g_malloc (in /usr/lib64/libglib-2.0.so.0.6600.8) by 0x55C2481: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6600.8) by 0x55C4827: g_string_sized_new (in /usr/lib64/libglib-2.0.so.0.6600.8) by 0x55C4CEA: g_string_new (in /usr/lib64/libglib-2.0.so.0.6600.8) by 0x906314: get_relocated_path (cutils.c:1036) by 0x6E1F77: qemu_read_default_config_file (vl.c:2122) by 0x6E1F77: qemu_init (vl.c:2687) by 0x3E3AF8: main (main.c:49) Let's use g_string_free(gstring, false) to free only the GString object and transfer the ownership of the character data to the caller. Fixes: f4f5ed2cbd ("cutils: introduce get_relocated_path") Signed-off-by: Stefano Garzarella Reviewed-by: Marc-André Lureau Reviewed-by: Markus Armbruster Message-Id: <20210412170255.231406-1-sgarzare@redhat.com> Signed-off-by: Laurent Vivier --- util/cutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index ee908486da44..c9b91e7535a8 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1055,5 +1055,5 @@ char *get_relocated_path(const char *dir) assert(G_IS_DIR_SEPARATOR(dir[-1])); g_string_append(result, dir - 1); } - return result->str; + return g_string_free(result, false); } From patchwork Sat May 15 10:03:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1QG0MXnz9sCD for ; Sat, 15 May 2021 20:11:34 +1000 (AEST) Received: from localhost ([::1]:38228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrGe-0001l3-1m for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:11:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9J-00061F-6D; Sat, 15 May 2021 06:03:58 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:56337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9E-0006SD-LA; Sat, 15 May 2021 06:03:56 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MeTwY-1l7Prq1Mwe-00aS8T; Sat, 15 May 2021 12:03:46 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 11/16] hw/mem/meson: Fix linking sparse-mem device with fuzzer Date: Sat, 15 May 2021 12:03:30 +0200 Message-Id: <20210515100335.1245468-12-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:rG0nZGNhMImR4A9ianrVpPGs4B32ER585wwcosGaFY+HOYcq7OM bE/oB8IdSzfVF4t9GNCOtIcIVl6gIegjUMv7ZfeWvxGhdXlK9lGHSnpCMN5ijHcGAFvUPLt Y9f3sDbZmyWNCXSzExsmCXcUR1hPWc3eJxjg+Ms0oE3pOoskxU4XjRSIhQ7MhmK76gOom4H yDRpAmwfP7rtbz9njjp5w== X-UI-Out-Filterresults: notjunk:1;V03:K0:FEFbDzrr9Tw=:bPipkksH6fk5o7dnVksqOL I8Vf46cPcH66Ths7PrkeVe6Eu+vqvzW/44PhG74bXMcvZ8tv7tJb7s9lOlt+najzbjCajLv47 1LWNHu5nLxr3CQv3+/Q+d3utJWb2TOftyKu6xObXHou8Ceby9yvYMxP6OFzQ13XzUQt4utmSR kPGdsCH6E5mIa4Z3xszDxwET/jcAy8B96zdf5tTBmECxxbsLMU1X/AgCH10YO35N04kb4OdLF 2yOpzxDIGvo9FT1lF3wljZj62tUNHtqXxTK1NanvQdB0mswtPDYLM51YTOGEEWIKMkEojOm6S dQQsTScgKIO30Q6zJp5ucrWKnw36w056l9MkZt4hr0PDNKWXj9Oe96DtTWuT0XN9ngbnukFZB 7ZNA6cAFYRnvsQhipwP2SaNByjYKizvxBB5D9oxl35vbrOVULmbVQldJPpXq5NDMoBn7BXNnU kIyOSP9j1z9DLApZIpGjzHNQtmK9BOlm0osly6WIG9YbOfNQAJGeLju55xgT7bmeCoaEU3jxj E7QZKg9H2oztBaR5ci1lu8= Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev , Laurent Vivier , Alexander Bulekov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé sparse-mem.c is added to the 'mem_ss' source set, which itself is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is selected. But if CONFIG_MEM_DEVICE isn't selected, we get a link failure even if CONFIG_FUZZ is selected: /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz': tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init' clang-10: error: linker command failed with exit code 1 (use -v to see invocation) Fix by adding sparse-mem.c directly to the softmmu_ss set. Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Bulekov Message-Id: <20210406133944.4193691-1-philmd@redhat.com> Signed-off-by: Laurent Vivier --- hw/mem/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/meson.build b/hw/mem/meson.build index ef79e046787c..3c8fdef9f9e9 100644 --- a/hw/mem/meson.build +++ b/hw/mem/meson.build @@ -1,8 +1,9 @@ mem_ss = ss.source_set() mem_ss.add(files('memory-device.c')) -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c')) mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c')) mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c')) mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c')) softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss) + +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c')) From patchwork Sat May 15 10:03:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Wc2Yv1z9sCD for ; Sat, 15 May 2021 20:16:11 +1000 (AEST) Received: from localhost ([::1]:55940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrL6-0005AB-Uz for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:16:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9R-000667-RW; Sat, 15 May 2021 06:04:07 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:60377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9O-0006YS-7X; Sat, 15 May 2021 06:04:05 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N63NW-1lSOg00bE0-016Rv7; Sat, 15 May 2021 12:03:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/16] hw/pci-host: Do not build gpex-acpi.c if GPEX is not selected Date: Sat, 15 May 2021 12:03:31 +0200 Message-Id: <20210515100335.1245468-13-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:EgN/WUvV4VTzQjZhA5mUEZiJsExSyb0cGXbJor54drZyPAHltLM TBwgjUfR2O4epHirvg4QrFlrFjTVlVIqOSQ4qp+Va5H7YZD2t1xKA9DuFzpdVV+ThaLmZAs 9BVDHPe415s4IuXl/L2i1ezCLmshEEvXkaOIWnPmgHj76brQaLs5yP+hd7B7CyMTmfRxHHE n66G2Exuk0hOJy397pmtA== X-UI-Out-Filterresults: notjunk:1;V03:K0:c+0ig8MZqzc=:5tcSisSm8VDE7AssfRhpLj y2WUv+fPT47QGWEYWRg307s72EfLjGxlvvisyXc+FfjbMlQhpNH6QwjDOEOJ7xDT1tWTfiBKx NrIRdy24RvKGttOXrp3jrpbVnmM0y5zDK6Ui4M3W9tPJFYwlADO0pV9PgHRoGMQ50RTt3aDPu fL/fSJcX2KCTaQHdJnHbFEqZT71Qzm11+PW/GAb0h/wxsXL8KhfGMAymDLIBGVZM+cH9n3NLe kl712jWdQzmwF4lYWL6DQOSp68Q76LjK/dW5TFdjxSw13UZVD1mDDI2ia6vh7FuTC0+YekX7X ycDJ8moidx/i8kUrV4sI7qUiTLxEvHefy/M61LpjxIbm8K9PTGXbhRk0r9PzinDV8oNGe2If6 B5QFpEG2e47gSAI1kvTJ1SSRz8ZTB9fJy2EmtjCsN9PA7yyuR6QwFGbOU+3MSNvTjl7yOdu85 hNMkDRNIpVi7tl/UMoARdMKGJfjnhfmUsoFfoSr5X3Y6IKhf5AECqLBJwg3/eyu4i5OyEIUli +13uBjjoHEezGZcRlSC7mU= Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Since its introduction in commit 5b85eabe68f ("acpi: add acpi_dsdt_add_gpex") we build gpex-acpi.c if ACPI is selected, even if the GPEX_HOST device isn't build. Add the missing Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Gerd Hoffmann Message-Id: <20210425182124.3735214-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/pci-host/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build index 34b3538bebf6..1698d3a1920a 100644 --- a/hw/pci-host/meson.build +++ b/hw/pci-host/meson.build @@ -3,7 +3,7 @@ pci_ss.add(when: 'CONFIG_PAM', if_true: files('pam.c')) pci_ss.add(when: 'CONFIG_PCI_BONITO', if_true: files('bonito.c')) pci_ss.add(when: 'CONFIG_PCI_EXPRESS_DESIGNWARE', if_true: files('designware.c')) pci_ss.add(when: 'CONFIG_PCI_EXPRESS_GENERIC_BRIDGE', if_true: files('gpex.c')) -pci_ss.add(when: 'CONFIG_ACPI', if_true: files('gpex-acpi.c')) +pci_ss.add(when: ['CONFIG_PCI_EXPRESS_GENERIC_BRIDGE', 'CONFIG_ACPI'], if_true: files('gpex-acpi.c')) pci_ss.add(when: 'CONFIG_PCI_EXPRESS_Q35', if_true: files('q35.c')) pci_ss.add(when: 'CONFIG_PCI_EXPRESS_XILINX', if_true: files('xilinx-pcie.c')) pci_ss.add(when: 'CONFIG_PCI_I440FX', if_true: files('i440fx.c')) From patchwork Sat May 15 10:03:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1Sb2X0Bz9sCD for ; Sat, 15 May 2021 20:13:35 +1000 (AEST) Received: from localhost ([::1]:45010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrIb-0006LF-AO for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:13:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9Z-0006Lh-G0; Sat, 15 May 2021 06:04:13 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:40411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9X-0006e6-MC; Sat, 15 May 2021 06:04:13 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MG9c2-1lixce3Seq-00GXiv; Sat, 15 May 2021 12:03:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 13/16] multi-process: Avoid logical AND of mutually exclusive tests Date: Sat, 15 May 2021 12:03:32 +0200 Message-Id: <20210515100335.1245468-14-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:wKEFFUEYjwLqI1sDGGQuygA6f1s9SMR6o6KI2F8NAe0dR40ZXa2 R6+UGU4t2/7AJMktHz29hZNyUJKx1TBrdviZUHAxGNY/z+ZrJdDqcPG8gG9B/Pdlb4bh6x2 v9pd8RwDIEogyh46TjhX7zlG1HWW1AIfSGsouK69X4QwSGu6mu9R/+/tb3fIAk+8ukHtPnm UJXH9sPrcmze11Yiq8L1A== X-UI-Out-Filterresults: notjunk:1;V03:K0:JCNeap1k60U=:rJMlMSshkDr7FmJ/UPA/oX PpP7Ce4eQSoP+J46PEHnsaZJSCIEzSGcm3T4p5VZufGOVjOrQr5gUx/W4dyEaVEWqVz+nMjOi dGkkkw6aDsXJKcA3Ioz2Odomc9g4jFQTncDOX4uytQ1PQSc2uayH3y4K3f0bi1vqqE2WL7ECP AzpVdsSdVk96vDLbLFJHz2acScP4tA5Fqq+cazW9q3SzZZ4levFy+TTB+Hf2h1agjx7fdItuI Y6HyH4ECHpbRwWGtZpxq2jfDKWYMSkWOdSVx4Tu1JwAFelRGzCsynlyk301tQWfVyMfShAcjZ vv/lmtOshYqIvQKGxZeofMgzlrTRduGV6V9c6x5xj+vR0rH2h01m2R+7BvsTHy57sweE6j4wG EF9xSgmUCxOaApjZUwvhY6A0Nun85m1l5vbTVkEnKNcCSxXK348fZZpGyuwDE1Ou0Tj+2HyvM qiiMigixp5jSBLSw1UNDR0D8VBq0SB7SxpIpCFMOWaZGLUVZzqnYRnHaPCA35C9h0s9+L3GEE pYTkLkktuCuQz0IlbftNuI= Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Jagannathan Raman , qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jagannathan Raman Fixes an if statement that performs a logical AND of mutually exclusive tests Buglink: https://bugs.launchpad.net/qemu/+bug/1926995 Reviewed-by: Thomas Huth Signed-off-by: Jagannathan Raman Reviewed-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Message-Id: <1620402803-9237-1-git-send-email-jag.raman@oracle.com> Signed-off-by: Laurent Vivier --- hw/remote/mpqemu-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/remote/mpqemu-link.c b/hw/remote/mpqemu-link.c index 9ce31526e8f2..e67a5de72ca7 100644 --- a/hw/remote/mpqemu-link.c +++ b/hw/remote/mpqemu-link.c @@ -218,7 +218,7 @@ uint64_t mpqemu_msg_send_and_await_reply(MPQemuMsg *msg, PCIProxyDev *pdev, bool mpqemu_msg_valid(MPQemuMsg *msg) { - if (msg->cmd >= MPQEMU_CMD_MAX && msg->cmd < 0) { + if (msg->cmd >= MPQEMU_CMD_MAX || msg->cmd < 0) { return false; } From patchwork Sat May 15 10:03:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1QC2srsz9sCD for ; Sat, 15 May 2021 20:11:31 +1000 (AEST) Received: from localhost ([::1]:37956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrGb-0001Zp-AV for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9T-00066l-Bg; Sat, 15 May 2021 06:04:07 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:58307) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9P-0006Ym-Og; Sat, 15 May 2021 06:04:07 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mzz6m-1lK7T12Lhe-00x3SJ; Sat, 15 May 2021 12:03:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 14/16] target/sh4: Return error if CPUClass::get_phys_page_debug() fails Date: Sat, 15 May 2021 12:03:33 +0200 Message-Id: <20210515100335.1245468-15-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:G2RRtHqXg2nfmeg0dzZCcikoI1mLa1mvwB2QWIkX5JJ8ZvBRyzJ sk1p2m5V3TIPb8GvG2vGWKcV/oMufR41JmS+0BuV/y9Pp5a6Ss76FevqeibhZ+GExzq+Q2Q 09sw8GnNp9UGtBmV+1OG1ucO5AbRUJPDvF8FYT34q0SvT06GPcbHKPplpl+0tYxLpOYDruV aI5HSWDxOKWcR5b2s8W8w== X-UI-Out-Filterresults: notjunk:1;V03:K0:TjMyK4ziKYs=:S7GPmj1WEUY8OKkuJG6/jD r/X90ApzOG7dTtiOi5Loui6uKMvRxc+upbmJma4LQWtArGme7Go7xr1e3QAyG17e6+niB0/6+ 0lGLkrorYCtt6675O5DujNx+zk2/ykbOWy7UrSqp1L9clNoGehb8J5DH2olneKin0KNLUH+eh HxFRws54qiyqCBJ9UCmlEDeKyQ+sZ88fACsnppQFvBn9hVnIwlFayJTiTCmDvYmMBuHeP1XkD 2z4cnmsfBcYc1/S+NH/w2ht3nMgJjjfDftk1UXFLv035lOyMByNERVAZhoXAgJvQykbNbIdoT 5pMRhB7s9KDCzolVofL8mlQ8HlF8XZ3++DgEAr/5BRl2fdPS/BFrCg98ZeAiaxl3yIJU0AQ2F RiB9UdDKX9L/oTkTwmiJNbInmOwacL/bsW9Zv7SS9aL7tfbVkvOXRtE3+vboD/40DQ6K4Ny8F TvM4YDHi9gLE6JdkquLvkAFKBZ9ULXlHorGS9vHqwIObpZDVXK8E5oyRIikIelR4XPraVAGW3 K0mwhdK0AlQPA6rlRDrKF4= Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yoshinori Sato , qemu-trivial@nongnu.org, Michael Tokarev , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé If the get_physical_address() call fails, the SH4 get_phys_page_debug() handler returns an uninitialized address. Instead return -1, which correspond to "no page found" (see cpu_get_phys_page_debug() doc string). This fixes a warning emitted when building with CFLAGS=-O3 (using GCC 10.2.1 20201125): target/sh4/helper.c: In function ‘superh_cpu_get_phys_page_debug’: target/sh4/helper.c:446:12: warning: ‘physical’ may be used uninitialized in this function [-Wmaybe-uninitialized] 446 | return physical; | ^~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Yoshinori Sato Message-Id: <20210505161046.1397608-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- target/sh4/helper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/sh4/helper.c b/target/sh4/helper.c index bd8e034f174d..2d622081e85a 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -441,9 +441,12 @@ hwaddr superh_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) target_ulong physical; int prot; - get_physical_address(&cpu->env, &physical, &prot, addr, MMU_DATA_LOAD); + if (get_physical_address(&cpu->env, &physical, &prot, addr, MMU_DATA_LOAD) + == MMU_OK) { + return physical; + } - return physical; + return -1; } void cpu_load_tlb(CPUSH4State * env) From patchwork Sat May 15 10:03:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1ZV5cJcz9sW5 for ; Sat, 15 May 2021 20:18:42 +1000 (AEST) Received: from localhost ([::1]:33484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrNY-0000hs-Ro for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:18:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9z-00071z-CW; Sat, 15 May 2021 06:04:39 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:54335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9u-0006sA-Pa; Sat, 15 May 2021 06:04:37 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N63NW-1lSOg302zg-016Rv7; Sat, 15 May 2021 12:03:51 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 15/16] hw/avr/atmega.c: use the avr51 cpu for atmega1280 Date: Sat, 15 May 2021 12:03:34 +0200 Message-Id: <20210515100335.1245468-16-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:IaGvjdPnZiCNCj+YRP9z/DxTQN993nu7OfbqwwHixMhluyG8SDy 0eDWBXAP2d59UBMnFBq5xE8SmhTWXg1UnvrSrfUokMFyuRSzSpXxGGUISYLsZzPninpyr1Q VEwkt9sPj9YVCpjSNFHvGmunic4mpzOusFd+wBY8hh7vwlhNr7c9Zelg61OSDQHPQl9hf1C XCPxo6pMGbM7gmjrvzKgg== X-UI-Out-Filterresults: notjunk:1;V03:K0:bufLQu0WX80=:zcEP2f+8JVe4pEnKixET9Y JItrUW7mF56E0ARZk+sNv/ns9HQhHBEqJIHKjtJmGwbOSmJXlOTVCdm2aD57c6A3EMZrlukI/ xeRWliW9WDmf6DZQcS/yfvlKIIy3TSeUk+nCaJIk31/i/32/dBTfMpSgh4FYvTlNakgh2Fbb/ 0jSckwo+8z1ipmYYcm9+l0Sut8JZiTUFIErGPcdRZzjBghKYtF9p2Pq+9lkEC/F+8biU47Jiu FJy4Srz1agC9/GjAqqM+ihv419tOdQt26lKh1KhjygZUwSkHohsC9haYnoh3Bwi7w532BfTfc Ka4JkGvy8avgugbsJvt7Wcf4/BG0MAd+lDPHz/EkCpS6ObI5PioUMzN1i3MRVAnUfsRYhvjrI L8dO+we8sjgzNDE8d1Cr8kfvp044fl8kPX8SjABnN/F26CV4n1u7z4nmJX0exOdNOls+4M3P4 c58gFuh9y2fFcZh+exw2Nq7izKbeiXb4lK06480T/OPpIZ9YYl/ZYW4xajAYa4/ssVuMkVom0 522rTJfw3wuVYYP1GwQyII= Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Joaquin de Andres , Michael Tokarev , Laurent Vivier , Frederic Konrad , Frederic Konrad Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Frederic Konrad According to the as documentation: (https://sourceware.org/binutils/docs-2.36/as/AVR-Options.html) "Instruction set avr51 is for the enhanced AVR core with exactly 128K program memory space (MCU types: atmega128, atmega128a, atmega1280, atmega1281, atmega1284, atmega1284p, atmega128rfa1, atmega128rfr2, atmega1284rfr2, at90can128, at90usb1286, at90usb1287, m3000)." But when compiling a program for atmega1280 or avr51 and trying to execute it: $ cat > test.S << EOF > loop: > rjmp loop > EOF $ avr-gcc -nostdlib -nostartfiles -mmcu=atmega1280 test.S -o test.elf $ qemu-system-avr -serial mon:stdio -nographic -no-reboot -M mega \ -bios test.elf qemu-system-avr: Current machine: Arduino Mega (ATmega1280) with 'avr6' CPU qemu-system-avr: ELF image 'test.elf' is for 'avr51' CPU So this fixes the atmega1280 class to use an avr51 CPU. Signed-off-by: Frederic Konrad Reviewed-by: Joaquin de Andres Message-Id: <1619637319-22299-1-git-send-email-frederic.konrad@adacore.com> Signed-off-by: Laurent Vivier --- hw/avr/atmega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c index 80b8a41cb5a5..0608e2d475ee 100644 --- a/hw/avr/atmega.c +++ b/hw/avr/atmega.c @@ -401,7 +401,7 @@ static void atmega1280_class_init(ObjectClass *oc, void *data) { AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc); - amc->cpu_type = AVR_CPU_TYPE_NAME("avr6"); + amc->cpu_type = AVR_CPU_TYPE_NAME("avr51"); amc->flash_size = 128 * KiB; amc->eeprom_size = 4 * KiB; amc->sram_size = 8 * KiB; From patchwork Sat May 15 10:03:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1478843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4Fj1XG0yS1z9sCD for ; Sat, 15 May 2021 20:16:46 +1000 (AEST) Received: from localhost ([::1]:57552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhrLg-0006HY-61 for incoming@patchwork.ozlabs.org; Sat, 15 May 2021 06:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9U-000698-P3; Sat, 15 May 2021 06:04:08 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:33203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhr9O-0006YV-Gp; Sat, 15 May 2021 06:04:08 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1pk6-1lfeE337fM-002ENN; Sat, 15 May 2021 12:03:51 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 16/16] target/avr: Ignore unimplemented WDR opcode Date: Sat, 15 May 2021 12:03:35 +0200 Message-Id: <20210515100335.1245468-17-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210515100335.1245468-1-laurent@vivier.eu> References: <20210515100335.1245468-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:i06N6m7JyLmbOggG2+TVbhyyVRkybY8PRAvNcbygmUX8PJbPD6T 2s3YioRSVz2LOstK0q6BeHrNdqJ6s2cEj+T4dTFwRsNq4NSpSPJrCVyLXwy4TK9se/Z/Hsi MAsr3PFMTJPdortH2g0O4v70Odk7jCHi+HpTxxnkK8U7y9Rhcp2vFccdRjhJeq5Lo9yHI7g RZwQbRMWMT0V1gWiOPclA== X-UI-Out-Filterresults: notjunk:1;V03:K0:hihcMfQ5ZBc=:Y0pgcOLDbqedxBBwgvSzhQ zYNKbID/VYVcr1X42UF43F9LX64VjX/IHobtEQhNnCQtY7WHBvjShf4HAEZG2eXYJOiCWLKdL VBVPGH5ypqEg8Q032+AyzxbLz+YoGPQU8/r4x3pysRktnnIp40KRWzPCBcz/Wcy6GQvQDiA9B FbNcPSjshlGysUhHVElY5x8syXfWd1pLba+CTloG37Ufx1zP4mYvM7i7mA94v97rYr4DJ/9J9 5vB4f8brgwqrwVSuO3KfKBV1dJMPwI4vFYJfPugJHGU/9mmCQoDY4kpM/35jhcIhKMWSK4/Op RR6if0+Es7VwzxuKDmvkqvdsTY7NJ7sVxIuu1W5HM2XfmrTu+NSnHViAxgC6tHjOp0LT2nCOW tOcS/xG0kfeIJhZ+hUm7oxX9NxC4Q/Xo6kfmP+MpWVLUGMqG7ssZ8Rona0ut1luYEbkZ4iMGB MKa1hxOBr3eF1hWDIPEzP7JORHzoqURlePrqpj1C86ZWFpb83KiC3vXc7BzDDwKURT/y1Q21M IAVdZ/a9ZMPsSybMJI5ZxQ= Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , KONRAD Frederic , Fred Konrad Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Running the WDR opcode triggers a segfault: $ cat > foo.S << EOF > __start: > wdr > EOF $ avr-gcc -nostdlib -nostartfiles -mmcu=avr6 foo.S -o foo.elf $ qemu-system-avr -serial mon:stdio -nographic -no-reboot \ -M mega -bios foo.elf -d in_asm --singlestep IN: 0x00000000: WDR Segmentation fault (core dumped) (gdb) bt #0 0x00005555add0b23a in gdb_get_cpu_pid (cpu=0x5555af5a4af0) at ../gdbstub.c:718 #1 0x00005555add0b2dd in gdb_get_cpu_process (cpu=0x5555af5a4af0) at ../gdbstub.c:743 #2 0x00005555add0e477 in gdb_set_stop_cpu (cpu=0x5555af5a4af0) at ../gdbstub.c:2742 #3 0x00005555adc99b96 in cpu_handle_guest_debug (cpu=0x5555af5a4af0) at ../softmmu/cpus.c:306 #4 0x00005555adcc66ab in rr_cpu_thread_fn (arg=0x5555af5a4af0) at ../accel/tcg/tcg-accel-ops-rr.c:224 #5 0x00005555adefaf12 in qemu_thread_start (args=0x5555af5d9870) at ../util/qemu-thread-posix.c:521 #6 0x00007f692d940ea5 in start_thread () from /lib64/libpthread.so.0 #7 0x00007f692d6699fd in clone () from /lib64/libc.so.6 Since the watchdog peripheral is not implemented, simply log the opcode as unimplemented and keep going. Reported-by: Fred Konrad Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: KONRAD Frederic Message-Id: <20210502190900.604292-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- target/avr/helper.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/avr/helper.c b/target/avr/helper.c index 35e101959404..981c29da4535 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -188,11 +188,7 @@ void helper_break(CPUAVRState *env) void helper_wdr(CPUAVRState *env) { - CPUState *cs = env_cpu(env); - - /* WD is not implemented yet, placeholder */ - cs->exception_index = EXCP_DEBUG; - cpu_loop_exit(cs); + qemu_log_mask(LOG_UNIMP, "WDG reset (not implemented)\n"); } /*