From patchwork Tue Jan 10 16:02:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RNehhsZ0; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx9K42bmz23g8 for ; Wed, 11 Jan 2023 03:29:39 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH5t-00037a-OZ; Tue, 10 Jan 2023 11:03:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5L-0002s7-QG for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5H-0004xW-Oc for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/alYy8O92DxdcA4HyUkM0DF2NwTmR7PHdUG+Enp9h6M=; b=RNehhsZ0yyYKp+AeiUpvAhub1bQimSxYsnGKYLpkRz+H0FTb2jAMzV6NIf3L6u59F50Rgz EXVOgy2tFn1z44TzEmFdfQOtTeYS1RkgCPVEc3+wz7dial3OzIqMfY1q+0PlErAUoAZTsz CLxJ1vywllC0fBgtkLwqjpai649Eb+4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-99-5FLsHFI2PH2Mt0MI1ywIPA-1; Tue, 10 Jan 2023 11:02:40 -0500 X-MC-Unique: 5FLsHFI2PH2Mt0MI1ywIPA-1 Received: by mail-wm1-f72.google.com with SMTP id r15-20020a05600c35cf00b003d9a14517b2so9217722wmq.2 for ; Tue, 10 Jan 2023 08:02:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/alYy8O92DxdcA4HyUkM0DF2NwTmR7PHdUG+Enp9h6M=; b=UseFVIEJkkoSx9xRPPmhmwbBJUY3es47JGnpFW61UxWKP09BoEYrn3mqAZrhkrhTr8 szdSPirWKwKiKSxCmRUF3u0rnql1gG0SsPDFA0HKC45HTaU485jHU8d1QQYjdag1BiHE ecoyUUKpot0wKEhfSVhfvofIK5v+efXC0TBWHXmQN/Ij0FXMIz2FUP8pkw7zHb4MYr5o heejh7r6MJjXayJIrSnlhkNrgozGdWv+2eHdUAxziiw4BoCya+PB7nyjILZcFJGRo9vK q/cPGik+22+VGacyQ1+RN6PQPsYUyfPB39wihbujvUmFy1PK6YVFSEjEGzndlehc4XVg UkcA== X-Gm-Message-State: AFqh2koq9dYwfxhWwZczyWwCaqcUNVnEKpFsGyYacl7d1jw4R9xjqmtz hlaJtQxix7jFnCR3gCIVQsw+U6AECM+GgIX5w98RtFPf3iMRgGyufNVoYNK4sqM2IQ0CbsJ/j8M ExAZIlcjkrYguTKEF0MwlI5pdsbVTCpdq9wv+wbnwPPk8c0DMQa4hl8HYhy+yqYoN0hQ= X-Received: by 2002:a05:600c:3509:b0:3d9:e9a2:eea3 with SMTP id h9-20020a05600c350900b003d9e9a2eea3mr7983586wmq.37.1673366558664; Tue, 10 Jan 2023 08:02:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtt8OU7peswHyKVJ+9TzfnLHTt9pWCkl/KtHxFuktsSdLs9wzQ3pL5fKDJcl4xr5uKsP4crPg== X-Received: by 2002:a05:600c:3509:b0:3d9:e9a2:eea3 with SMTP id h9-20020a05600c350900b003d9e9a2eea3mr7983563wmq.37.1673366558428; Tue, 10 Jan 2023 08:02:38 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id bh13-20020a05600c3d0d00b003d358beab9dsm15182218wmb.47.2023.01.10.08.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?b?0JLQsNC70LXQvdGC0LjQvQ==?= , qemu-stable@nongnu.org Subject: [PULL 01/29] configure: fix GLIB_VERSION for cross-compilation Date: Tue, 10 Jan 2023 17:02:05 +0100 Message-Id: <20230110160233.339771-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org configure uses "pkg-config" directly so that GLIB_VERSION is always based on host glib version. To correctly handle cross-compilation it should use "$pkg_config" and take GLIB_VERSION from the cross-compiled glib. Reported-by: Валентин Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1414 Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 22818926576c..6f5e77a71361 100755 --- a/configure +++ b/configure @@ -2375,7 +2375,7 @@ echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=$glib_libs" >> $config_host_mak echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak -echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak +echo "GLIB_VERSION=$($pkg_config --modversion glib-2.0)" >> $config_host_mak echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak From patchwork Tue Jan 10 16:02:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S2//HngR; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ns17k6jtqz23g2 for ; Wed, 11 Jan 2023 06:28:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH63-0003F7-A8; Tue, 10 Jan 2023 11:03:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5R-0002tE-5X for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5O-0004z5-QP for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mhbP2nj+YKePeUN8E3Nxb3/GqgA/LcoW7bGgdJgbHSo=; b=S2//HngReDgHFqDNQ7Ytcn/k/ZpzaG7VZuGosHiV3zXCJqd/zAHkWQkXTVRuO6a5R9Q7Ju zWv8SGRoeaCNtrzegKCobiEYT9PNbBaV1OXOpaiuDmGADq+QnJJ3uImw4XU1e/pMzJFcUZ IT8nsshZbWR+7OzAJwL5DsrnWMeGKpQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-86-auZl4dVpMEiAp77DKun4oA-1; Tue, 10 Jan 2023 11:02:48 -0500 X-MC-Unique: auZl4dVpMEiAp77DKun4oA-1 Received: by mail-wr1-f72.google.com with SMTP id j18-20020adfb312000000b00293def622d1so2129571wrd.17 for ; Tue, 10 Jan 2023 08:02:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=mhbP2nj+YKePeUN8E3Nxb3/GqgA/LcoW7bGgdJgbHSo=; b=BxkUp2zq3W5JleHAht2WFZRm19LmmWf/hgKEoxz4VcUGJduhitVA6tzMGgKHT17dc6 rXdVkx5IAw82sKnhIru0BbGPARrr6CpAHGdly+w0KzGLLBA+I79xD1MXEZiXxayRlBnP 2EOM4+WxFjmgC5CgjWOVNKC2H1X+Geym4BSTajiaPkFq7EQSIjSuUbUsmZgKaSvKAJXW g0h4HmY426R3CR6hmBYmVL/eYDHLzsqyx6YjtbRHWyWEiyrc7kr1JeC+6ksyp869Pb9s 0UCP96o9F18DWoO9k7kYTv2q92RdMBu+r/cxJScFxsv0boegn6C022ovAMufCpELl5e7 /hzA== X-Gm-Message-State: AFqh2ko1EQkEnqoaOUL7WSoOq1KQfI9G0SJsT5x58TIF6bYBXFFGFik+ ibwPOBCsVDFBLFnPz2Iw+gfu879Can7ERjM1CdlWT9PO4HKM/gnHU/hT0bHCRAwKgEcFsPq7wWZ EJ08Jkj+WNwACJbrwgJ9N5CldBf5ZZsbiV55+9yEUolwEnbPGp+IlvGmulHU68liMbjA= X-Received: by 2002:a05:600c:d2:b0:3d2:2b70:f2fd with SMTP id u18-20020a05600c00d200b003d22b70f2fdmr50712889wmm.21.1673366561438; Tue, 10 Jan 2023 08:02:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1Qm7IV2fkSKJ6GQOgqAwKmMYdw0G72qFACCTrGwTB2jV6B5Rr8V/ajroOVLR1lPAmq/m9ng== X-Received: by 2002:a05:600c:d2:b0:3d2:2b70:f2fd with SMTP id u18-20020a05600c00d200b003d22b70f2fdmr50712855wmm.21.1673366561082; Tue, 10 Jan 2023 08:02:41 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id 2-20020a05600c020200b003d9ef8ad6b2sm7411398wmi.13.2023.01.10.08.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Joe Richey Subject: [PULL 02/29] i386: Emit correct error code for 64-bit IDT entry Date: Tue, 10 Jan 2023 17:02:06 +0100 Message-Id: <20230110160233.339771-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Joe Richey When in 64-bit mode, IDT entiries are 16 bytes, so `intno * 16` is used for base/limit/offset calculations. However, even in 64-bit mode, the exception error code still uses bits [3,16) for the invlaid interrupt index. This means the error code should still be `intno * 8 + 2` even in 64-bit mode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1382 Signed-off-by: Joe Richey Signed-off-by: Paolo Bonzini --- target/i386/tcg/seg_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 539189b4d184..03b58e94a2d4 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -882,7 +882,7 @@ static void do_interrupt64(CPUX86State *env, int intno, int is_int, dt = &env->idt; if (intno * 16 + 15 > dt->limit) { - raise_exception_err(env, EXCP0D_GPF, intno * 16 + 2); + raise_exception_err(env, EXCP0D_GPF, intno * 8 + 2); } ptr = dt->base + intno * 16; e1 = cpu_ldl_kernel(env, ptr); @@ -895,18 +895,18 @@ static void do_interrupt64(CPUX86State *env, int intno, int is_int, case 15: /* 386 trap gate */ break; default: - raise_exception_err(env, EXCP0D_GPF, intno * 16 + 2); + raise_exception_err(env, EXCP0D_GPF, intno * 8 + 2); break; } dpl = (e2 >> DESC_DPL_SHIFT) & 3; cpl = env->hflags & HF_CPL_MASK; /* check privilege if software int */ if (is_int && dpl < cpl) { - raise_exception_err(env, EXCP0D_GPF, intno * 16 + 2); + raise_exception_err(env, EXCP0D_GPF, intno * 8 + 2); } /* check valid bit */ if (!(e2 & DESC_P_MASK)) { - raise_exception_err(env, EXCP0B_NOSEG, intno * 16 + 2); + raise_exception_err(env, EXCP0B_NOSEG, intno * 8 + 2); } selector = e1 >> 16; offset = ((target_ulong)e3 << 32) | (e2 & 0xffff0000) | (e1 & 0x0000ffff); From patchwork Tue Jan 10 16:02:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724283 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KM9nEj7t; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ns0J25Kv5z23g8 for ; Wed, 11 Jan 2023 05:50:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH63-0003F5-9K; Tue, 10 Jan 2023 11:03:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5P-0002sw-3H for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5N-0004z1-1j for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mv3QnxHWpyE3uOtMtG1TyDeNUQV1dkXfxbpTsNv2gGE=; b=KM9nEj7tabhbq3vyWwAZ0iDbgv/elMjppxJTb1Wr8DL1i5rWWL8d8TpMapBaoeoGkFa5fV sTd/UlWtnz+IFynYRWwG8DN9bgYiXtHOLJ1MNrLN3cB9fXSpwM1s7X50oFpLCcphWVyjWA 19VmG6BzMmbGY/7RZSnt4ATfcg36ylM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-544-QRG6_m_HMb2MKoIvDfwybQ-1; Tue, 10 Jan 2023 11:02:46 -0500 X-MC-Unique: QRG6_m_HMb2MKoIvDfwybQ-1 Received: by mail-wm1-f72.google.com with SMTP id m38-20020a05600c3b2600b003d23f8c6ebdso875447wms.0 for ; Tue, 10 Jan 2023 08:02:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Mv3QnxHWpyE3uOtMtG1TyDeNUQV1dkXfxbpTsNv2gGE=; b=PE31jxYYrB8YsnTNgLss6IDFASGyJCikO2+08gzYr14xoESbI7EwhCXK5AzmWtPLDe 9XnzMMn8DaYGe4cBFllFPK6kZ5BG443rNP5S98sVacEP+mXUgziI0S+kIcI55EW2Xxlh vTQcWSBn5FRRR1lgQ5juRqPl8xg6HO3ft2lsyoz8TDeb2B+Whr0QakLaWFVwo+AQf6oX CbseldPHLC5zZ6UzJ1yNU4A0gYlVtIt23D/9hrV96cU0HfB/daR3cjVUWCUSvAbg27qT 6koR4FTnqUrXQ1btiDGF3tmO3hBOW/jQC0lZMR4oAAOxtzKML8ezUU8bPQu115T519Ju ZurQ== X-Gm-Message-State: AFqh2krDui33ALtaLl0VJBiC56LZ7TvgAbdYcZ/3KiLVXNvZAVoQyR4q ZfNg7z86M84FMSaHVAtbJJKuU1/pvLZrALlIjxHq+/5nM16Y99OurCy23CKYiBgFwqdc7B9GA8b bR52wIbfZ96J3dGdPxCroy3x8/P/RO7dOVu7IecbRF8xk8bEQ3/R8qAt/b5FR1Za52HQ= X-Received: by 2002:a05:600c:1d89:b0:3d3:5cd6:781 with SMTP id p9-20020a05600c1d8900b003d35cd60781mr49127841wms.37.1673366564150; Tue, 10 Jan 2023 08:02:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtP5Uei3ee+UyPxcQhcuNDdLg39aHx5VqNyS5WHA5/snBoIKVyZA5Uy9Z2Tz3QcWs4Hl/OnrA== X-Received: by 2002:a05:600c:1d89:b0:3d3:5cd6:781 with SMTP id p9-20020a05600c1d8900b003d35cd60781mr49127802wms.37.1673366563761; Tue, 10 Jan 2023 08:02:43 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id k9-20020a5d6d49000000b002bc8130cca7sm3512408wri.23.2023.01.10.08.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Emanuele Giuseppe Esposito , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 03/29] accel: introduce accelerator blocker API Date: Tue, 10 Jan 2023 17:02:07 +0100 Message-Id: <20230110160233.339771-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Emanuele Giuseppe Esposito This API allows the accelerators to prevent vcpus from issuing new ioctls while execting a critical section marked with the accel_ioctl_inhibit_begin/end functions. Note that all functions submitting ioctls must mark where the ioctl is being called with accel_{cpu_}ioctl_begin/end(). This API requires the caller to always hold the BQL. API documentation is in sysemu/accel-blocker.h Internally, it uses a QemuLockCnt together with a per-CPU QemuLockCnt (to minimize cache line bouncing) to keep avoid that new ioctls run when the critical section starts, and a QemuEvent to wait that all running ioctls finish. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221111154758.1372674-2-eesposit@redhat.com> Signed-off-by: Paolo Bonzini --- accel/accel-blocker.c | 154 +++++++++++++++++++++++++++++++++ accel/meson.build | 2 +- hw/core/cpu-common.c | 2 + include/hw/core/cpu.h | 3 + include/sysemu/accel-blocker.h | 56 ++++++++++++ util/meson.build | 2 +- 6 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 accel/accel-blocker.c create mode 100644 include/sysemu/accel-blocker.h diff --git a/accel/accel-blocker.c b/accel/accel-blocker.c new file mode 100644 index 000000000000..1e7f423462df --- /dev/null +++ b/accel/accel-blocker.c @@ -0,0 +1,154 @@ +/* + * Lock to inhibit accelerator ioctls + * + * Copyright (c) 2022 Red Hat Inc. + * + * Author: Emanuele Giuseppe Esposito + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qemu/thread.h" +#include "qemu/main-loop.h" +#include "hw/core/cpu.h" +#include "sysemu/accel-blocker.h" + +static QemuLockCnt accel_in_ioctl_lock; +static QemuEvent accel_in_ioctl_event; + +void accel_blocker_init(void) +{ + qemu_lockcnt_init(&accel_in_ioctl_lock); + qemu_event_init(&accel_in_ioctl_event, false); +} + +void accel_ioctl_begin(void) +{ + if (likely(qemu_mutex_iothread_locked())) { + return; + } + + /* block if lock is taken in kvm_ioctl_inhibit_begin() */ + qemu_lockcnt_inc(&accel_in_ioctl_lock); +} + +void accel_ioctl_end(void) +{ + if (likely(qemu_mutex_iothread_locked())) { + return; + } + + qemu_lockcnt_dec(&accel_in_ioctl_lock); + /* change event to SET. If event was BUSY, wake up all waiters */ + qemu_event_set(&accel_in_ioctl_event); +} + +void accel_cpu_ioctl_begin(CPUState *cpu) +{ + if (unlikely(qemu_mutex_iothread_locked())) { + return; + } + + /* block if lock is taken in kvm_ioctl_inhibit_begin() */ + qemu_lockcnt_inc(&cpu->in_ioctl_lock); +} + +void accel_cpu_ioctl_end(CPUState *cpu) +{ + if (unlikely(qemu_mutex_iothread_locked())) { + return; + } + + qemu_lockcnt_dec(&cpu->in_ioctl_lock); + /* change event to SET. If event was BUSY, wake up all waiters */ + qemu_event_set(&accel_in_ioctl_event); +} + +static bool accel_has_to_wait(void) +{ + CPUState *cpu; + bool needs_to_wait = false; + + CPU_FOREACH(cpu) { + if (qemu_lockcnt_count(&cpu->in_ioctl_lock)) { + /* exit the ioctl, if vcpu is running it */ + qemu_cpu_kick(cpu); + needs_to_wait = true; + } + } + + return needs_to_wait || qemu_lockcnt_count(&accel_in_ioctl_lock); +} + +void accel_ioctl_inhibit_begin(void) +{ + CPUState *cpu; + + /* + * We allow to inhibit only when holding the BQL, so we can identify + * when an inhibitor wants to issue an ioctl easily. + */ + g_assert(qemu_mutex_iothread_locked()); + + /* Block further invocations of the ioctls outside the BQL. */ + CPU_FOREACH(cpu) { + qemu_lockcnt_lock(&cpu->in_ioctl_lock); + } + qemu_lockcnt_lock(&accel_in_ioctl_lock); + + /* Keep waiting until there are running ioctls */ + while (true) { + + /* Reset event to FREE. */ + qemu_event_reset(&accel_in_ioctl_event); + + if (accel_has_to_wait()) { + /* + * If event is still FREE, and there are ioctls still in progress, + * wait. + * + * If an ioctl finishes before qemu_event_wait(), it will change + * the event state to SET. This will prevent qemu_event_wait() from + * blocking, but it's not a problem because if other ioctls are + * still running the loop will iterate once more and reset the event + * status to FREE so that it can wait properly. + * + * If an ioctls finishes while qemu_event_wait() is blocking, then + * it will be waken up, but also here the while loop makes sure + * to re-enter the wait if there are other running ioctls. + */ + qemu_event_wait(&accel_in_ioctl_event); + } else { + /* No ioctl is running */ + return; + } + } +} + +void accel_ioctl_inhibit_end(void) +{ + CPUState *cpu; + + qemu_lockcnt_unlock(&accel_in_ioctl_lock); + CPU_FOREACH(cpu) { + qemu_lockcnt_unlock(&cpu->in_ioctl_lock); + } +} + diff --git a/accel/meson.build b/accel/meson.build index 3a480cc2efef..49558dd232c2 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -1,4 +1,4 @@ -specific_ss.add(files('accel-common.c')) +specific_ss.add(files('accel-common.c', 'accel-blocker.c')) softmmu_ss.add(files('accel-softmmu.c')) user_ss.add(files('accel-user.c')) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index b177e761f010..5ccc3837b678 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -238,6 +238,7 @@ static void cpu_common_initfn(Object *obj) cpu->cflags_next_tb = -1; qemu_mutex_init(&cpu->work_mutex); + qemu_lockcnt_init(&cpu->in_ioctl_lock); QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); @@ -249,6 +250,7 @@ static void cpu_common_finalize(Object *obj) { CPUState *cpu = CPU(obj); + qemu_lockcnt_destroy(&cpu->in_ioctl_lock); qemu_mutex_destroy(&cpu->work_mutex); } diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 88305461212f..2417597236bc 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -398,6 +398,9 @@ struct CPUState { uint32_t kvm_fetch_index; uint64_t dirty_pages; + /* Use by accel-block: CPU is executing an ioctl() */ + QemuLockCnt in_ioctl_lock; + /* Used for events with 'vcpu' and *without* the 'disabled' properties */ DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); diff --git a/include/sysemu/accel-blocker.h b/include/sysemu/accel-blocker.h new file mode 100644 index 000000000000..72020529ef35 --- /dev/null +++ b/include/sysemu/accel-blocker.h @@ -0,0 +1,56 @@ +/* + * Accelerator blocking API, to prevent new ioctls from starting and wait the + * running ones finish. + * This mechanism differs from pause/resume_all_vcpus() in that it does not + * release the BQL. + * + * Copyright (c) 2022 Red Hat Inc. + * + * Author: Emanuele Giuseppe Esposito + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef ACCEL_BLOCKER_H +#define ACCEL_BLOCKER_H + +#include "qemu/osdep.h" +#include "sysemu/cpus.h" + +extern void accel_blocker_init(void); + +/* + * accel_{cpu_}ioctl_begin/end: + * Mark when ioctl is about to run or just finished. + * + * accel_{cpu_}ioctl_begin will block after accel_ioctl_inhibit_begin() is + * called, preventing new ioctls to run. They will continue only after + * accel_ioctl_inibith_end(). + */ +extern void accel_ioctl_begin(void); +extern void accel_ioctl_end(void); +extern void accel_cpu_ioctl_begin(CPUState *cpu); +extern void accel_cpu_ioctl_end(CPUState *cpu); + +/* + * accel_ioctl_inhibit_begin: start critical section + * + * This function makes sure that: + * 1) incoming accel_{cpu_}ioctl_begin() calls block + * 2) wait that all ioctls that were already running reach + * accel_{cpu_}ioctl_end(), kicking vcpus if necessary. + * + * This allows the caller to access shared data or perform operations without + * worrying of concurrent vcpus accesses. + */ +extern void accel_ioctl_inhibit_begin(void); + +/* + * accel_ioctl_inhibit_end: end critical section started by + * accel_ioctl_inhibit_begin() + * + * This function allows blocked accel_{cpu_}ioctl_begin() to continue. + */ +extern void accel_ioctl_inhibit_end(void); + +#endif /* ACCEL_BLOCKER_H */ diff --git a/util/meson.build b/util/meson.build index d8d109ff842b..26c73e586be6 100644 --- a/util/meson.build +++ b/util/meson.build @@ -58,6 +58,7 @@ util_ss.add(files('yank.c')) util_ss.add(files('int128.c')) util_ss.add(files('memalign.c')) util_ss.add(files('interval-tree.c')) +util_ss.add(files('lockcnt.c')) if have_user util_ss.add(files('selfmap.c')) @@ -72,7 +73,6 @@ endif if have_block or have_ga util_ss.add(files('aiocb.c', 'async.c')) util_ss.add(files('base64.c')) - util_ss.add(files('lockcnt.c')) util_ss.add(files('main-loop.c')) util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c')) util_ss.add(files('coroutine-@0@.c'.format(config_host['CONFIG_COROUTINE_BACKEND']))) From patchwork Tue Jan 10 16:02:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ESMwW39x; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrzVQ2gg1z23g2 for ; Wed, 11 Jan 2023 05:14:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH61-0003Bm-W2; Tue, 10 Jan 2023 11:03:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5T-0002tn-AD for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5Q-0004zF-51 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:02:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vK7tRlKetPWfu1xFcYQJylkefi9bwf8+ewl3JjUXMVY=; b=ESMwW39xAq2YQj1u4kOhkDQz0ipMbg7jvB1UGs09twUnHw/mTATpY9E0+fcpilHxFpAsF4 dRe6NgnT/+ri2SGUvaAaZ/dmC2VHhVllajdpeRzt2V+ArYA8TaO+LvLwsqMXEUyJ5du5uB qIW8DtzdU1FuFrDcOS1FncCWvJEjdak= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-596-iqoO-PKAM_Cw_k-ZtXawSQ-1; Tue, 10 Jan 2023 11:02:49 -0500 X-MC-Unique: iqoO-PKAM_Cw_k-ZtXawSQ-1 Received: by mail-wm1-f72.google.com with SMTP id k20-20020a05600c1c9400b003d9717c8b11so6480386wms.7 for ; Tue, 10 Jan 2023 08:02:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vK7tRlKetPWfu1xFcYQJylkefi9bwf8+ewl3JjUXMVY=; b=ts+2qJPL7/x8YEgBsu3u5w9p8jIWL++54TwOsGlFw24ddUIkJmliZGgnJxj6G8JeVY mOpCBXTL/8DDmZ96Hz6Qek1SNgntAUbvab/xgSr/Y0/88LKSxGzMIhIeibOM8Kuxt73e YoIseSm2ijMeBsAxeopBYbKM8me85GeRF+g9nhQTQwQpE/6XPi0TKaehfoOjoNWL7IZ4 yMHa/TVpX0LKVkhbHEVzqumPm7GhsWmT8tmnRvwfGKPgonQfrgoWaF9VPwCBJq6Z7h/H n/peBI3hn4vrECfcYKx9utuir4qzvUMn3eecmirlBBH53k45bq4h00+IbP3JA2/FckyR va1A== X-Gm-Message-State: AFqh2kq+q1xAXOIZlUDaPpp5lyVFQXaqwkD1YhFa7jlVznyF9uAzFwC/ qvx2NtPSuNUNZF9QvKsLbktDplRxMypEyAU3dC7NCG3bpSmfEgYAnzXT93ZYpzna0pMR9eIReFq QNKp6D5ftIxO/IRTrWsFXw9tNPqs88Mwzxhs90U9W9O8UYZAv37XYGlK/Di14BHbNCVY= X-Received: by 2002:a05:600c:1d0e:b0:3cf:7c8b:a7c7 with SMTP id l14-20020a05600c1d0e00b003cf7c8ba7c7mr49348989wms.39.1673366566734; Tue, 10 Jan 2023 08:02:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvx+Go2R1HDUazY1BypKSRP26M/hR0pfJKdb45NcD5+PJlG41CDf3gZhivXWqwSWcEzKAmvTQ== X-Received: by 2002:a05:600c:1d0e:b0:3cf:7c8b:a7c7 with SMTP id l14-20020a05600c1d0e00b003cf7c8ba7c7mr49348964wms.39.1673366566459; Tue, 10 Jan 2023 08:02:46 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0a4700b003c6bbe910fdsm23582630wmq.9.2023.01.10.08.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Emanuele Giuseppe Esposito , David Hildenbrand Subject: [PULL 04/29] KVM: keep track of running ioctls Date: Tue, 10 Jan 2023 17:02:08 +0100 Message-Id: <20230110160233.339771-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Emanuele Giuseppe Esposito Using the new accel-blocker API, mark where ioctls are being called in KVM. Next, we will implement the critical section that will take care of performing memslots modifications atomically, therefore preventing any new ioctl from running and allowing the running ones to finish. Signed-off-by: David Hildenbrand Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20221111154758.1372674-3-eesposit@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e86c33e0e612..8760d55002cc 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2310,6 +2310,7 @@ static int kvm_init(MachineState *ms) assert(TARGET_PAGE_SIZE <= qemu_real_host_page_size()); s->sigmask_len = 8; + accel_blocker_init(); #ifdef KVM_CAP_SET_GUEST_DEBUG QTAILQ_INIT(&s->kvm_sw_breakpoints); @@ -3014,7 +3015,9 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) va_end(ap); trace_kvm_vm_ioctl(type, arg); + accel_ioctl_begin(); ret = ioctl(s->vmfd, type, arg); + accel_ioctl_end(); if (ret == -1) { ret = -errno; } @@ -3032,7 +3035,9 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) va_end(ap); trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg); + accel_cpu_ioctl_begin(cpu); ret = ioctl(cpu->kvm_fd, type, arg); + accel_cpu_ioctl_end(cpu); if (ret == -1) { ret = -errno; } @@ -3050,7 +3055,9 @@ int kvm_device_ioctl(int fd, int type, ...) va_end(ap); trace_kvm_device_ioctl(fd, type, arg); + accel_ioctl_begin(); ret = ioctl(fd, type, arg); + accel_ioctl_end(); if (ret == -1) { ret = -errno; } From patchwork Tue Jan 10 16:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N8Bblfvn; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrz60224Xz23g2 for ; Wed, 11 Jan 2023 04:56:56 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH60-0003BR-BT; Tue, 10 Jan 2023 11:03:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5Y-0002y4-Jr for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5W-00050I-GR for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jZdZ+Ed4sPgstOy+j/WJzw309cl2DoqofYhm37475xc=; b=N8BblfvncayV6ZClr5o2/pnOgTmSeAO1pxuS0E/+dI3HUNmozyG1s9Y4htDrRfc1ZbJ31x CJZrV2Mgi6xOv5C19YSib7S9eJdYqS6bweMb38d5LgY/BPBQdFCNRoAWWmVrDeVX6F1KzP 1P3XixQKpqk9VsUT/pD/KyLDRTJ+E4A= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-511-6BJT65HeMAST4puhYI9KvA-1; Tue, 10 Jan 2023 11:02:51 -0500 X-MC-Unique: 6BJT65HeMAST4puhYI9KvA-1 Received: by mail-wm1-f71.google.com with SMTP id j15-20020a05600c1c0f00b003d9ec0eaa74so754144wms.1 for ; Tue, 10 Jan 2023 08:02:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=jZdZ+Ed4sPgstOy+j/WJzw309cl2DoqofYhm37475xc=; b=BhlxQsmcI/8EnMKX2Z7JBp9n181lvFUGhxlxAjvyraWUhf3OKvYNE2u/CIHilL/GAr kyHPK8GF9G2IlHvectM5ghvFWfmFZBl19/f54Vo4XGfnVEGV+s/vqlAYqTYLPSy2vsN+ nHvPq7+k3ubXdMCjH9ZCB+NKWsvYi5EAbm4h9Hy5CvwudRTLao4yQxvEYlxlEnm7uF2H F4METbS2Z6e3om0YoQFwxavqhVexOl4MvdFxXiNFkx63uPpuaAKTRQkJmE/fnFwSnHnZ M+zFxZmHqFcc4BOnHec1TOBqT0onxy9eeiofzl2e4FB8ORZRirx4IT4sLH7OsaRCUrY5 wAWQ== X-Gm-Message-State: AFqh2kruZ+0MwlHQQHtUP5QsjffjTKbU92wmOXWmvgSqQiesGW4e/c0P KgGi4EAt8JLKYg+j+RQrBOSIQAnaxpdFt/cOOPmhrnyo1PdJq9RgiVZvXTJ58QTnx4xHHsSxZmi qA3r2RfNcL9ubF9aMSY/tF4UhhuZZffKhGC+np1JvL6AVE5aOYHyH1eegLvQiOjbu6j0= X-Received: by 2002:a05:600c:3c93:b0:3d9:ed30:79d with SMTP id bg19-20020a05600c3c9300b003d9ed30079dmr7088975wmb.18.1673366569537; Tue, 10 Jan 2023 08:02:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtWysH/2KQuDpBanxa3ipoA7spq0tnG4XKPfzLcDclbtNOCEbdyfnbKRAjIpUfEVsf8235IMQ== X-Received: by 2002:a05:600c:3c93:b0:3d9:ed30:79d with SMTP id bg19-20020a05600c3c9300b003d9ed30079dmr7088940wmb.18.1673366569188; Tue, 10 Jan 2023 08:02:49 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id i14-20020a05600c354e00b003d1d5a83b2esm22086376wmq.35.2023.01.10.08.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: David Hildenbrand , Emanuele Giuseppe Esposito Subject: [PULL 05/29] kvm: Atomic memslot updates Date: Tue, 10 Jan 2023 17:02:09 +0100 Message-Id: <20230110160233.339771-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: David Hildenbrand If we update an existing memslot (e.g., resize, split), we temporarily remove the memslot to re-add it immediately afterwards. These updates are not atomic, especially not for KVM VCPU threads, such that we can get spurious faults. Let's inhibit most KVM ioctls while performing relevant updates, such that we can perform the update just as if it would happen atomically without additional kernel support. We capture the add/del changes and apply them in the notifier commit stage instead. There, we can check for overlaps and perform the ioctl inhibiting only if really required (-> overlap). To keep things simple we don't perform additional checks that wouldn't actually result in an overlap -- such as !RAM memory regions in some cases (see kvm_set_phys_mem()). To minimize cache-line bouncing, use a separate indicator (in_ioctl_lock) per CPU. Also, make sure to hold the kvm_slots_lock while performing both actions (removing+re-adding). We have to wait until all IOCTLs were exited and block new ones from getting executed. This approach cannot result in a deadlock as long as the inhibitor does not hold any locks that might hinder an IOCTL from getting finished and exited - something fairly unusual. The inhibitor will always hold the BQL. AFAIKs, one possible candidate would be userfaultfd. If a page cannot be placed (e.g., during postcopy), because we're waiting for a lock, or if the userfaultfd thread cannot process a fault, because it is waiting for a lock, there could be a deadlock. However, the BQL is not applicable here, because any other guest memory access while holding the BQL would already result in a deadlock. Nothing else in the kernel should block forever and wait for userspace intervention. Note: pause_all_vcpus()/resume_all_vcpus() or start_exclusive()/end_exclusive() cannot be used, as they either drop the BQL or require to be called without the BQL - something inhibitors cannot handle. We need a low-level locking mechanism that is deadlock-free even when not releasing the BQL. Signed-off-by: David Hildenbrand Signed-off-by: Emanuele Giuseppe Esposito Tested-by: Emanuele Giuseppe Esposito Message-Id: <20221111154758.1372674-4-eesposit@redhat.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 101 ++++++++++++++++++++++++++++++++++----- include/sysemu/kvm_int.h | 8 ++++ 2 files changed, 98 insertions(+), 11 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 8760d55002cc..7e6a6076b16c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -31,6 +31,7 @@ #include "sysemu/kvm_int.h" #include "sysemu/runstate.h" #include "sysemu/cpus.h" +#include "sysemu/accel-blocker.h" #include "qemu/bswap.h" #include "exec/memory.h" #include "exec/ram_addr.h" @@ -46,6 +47,7 @@ #include "sysemu/hw_accel.h" #include "kvm-cpus.h" #include "sysemu/dirtylimit.h" +#include "qemu/range.h" #include "hw/boards.h" #include "monitor/stats.h" @@ -1292,6 +1294,7 @@ void kvm_set_max_memslot_size(hwaddr max_slot_size) kvm_max_slot_size = max_slot_size; } +/* Called with KVMMemoryListener.slots_lock held */ static void kvm_set_phys_mem(KVMMemoryListener *kml, MemoryRegionSection *section, bool add) { @@ -1326,14 +1329,12 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, ram = memory_region_get_ram_ptr(mr) + mr_offset; ram_start_offset = memory_region_get_ram_addr(mr) + mr_offset; - kvm_slots_lock(); - if (!add) { do { slot_size = MIN(kvm_max_slot_size, size); mem = kvm_lookup_matching_slot(kml, start_addr, slot_size); if (!mem) { - goto out; + return; } if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { /* @@ -1371,7 +1372,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, start_addr += slot_size; size -= slot_size; } while (size); - goto out; + return; } /* register the new slot */ @@ -1396,9 +1397,6 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, ram += slot_size; size -= slot_size; } while (size); - -out: - kvm_slots_unlock(); } static void *kvm_dirty_ring_reaper_thread(void *data) @@ -1455,18 +1453,95 @@ static void kvm_region_add(MemoryListener *listener, MemoryRegionSection *section) { KVMMemoryListener *kml = container_of(listener, KVMMemoryListener, listener); + KVMMemoryUpdate *update; - memory_region_ref(section->mr); - kvm_set_phys_mem(kml, section, true); + update = g_new0(KVMMemoryUpdate, 1); + update->section = *section; + + QSIMPLEQ_INSERT_TAIL(&kml->transaction_add, update, next); } static void kvm_region_del(MemoryListener *listener, MemoryRegionSection *section) { KVMMemoryListener *kml = container_of(listener, KVMMemoryListener, listener); + KVMMemoryUpdate *update; - kvm_set_phys_mem(kml, section, false); - memory_region_unref(section->mr); + update = g_new0(KVMMemoryUpdate, 1); + update->section = *section; + + QSIMPLEQ_INSERT_TAIL(&kml->transaction_del, update, next); +} + +static void kvm_region_commit(MemoryListener *listener) +{ + KVMMemoryListener *kml = container_of(listener, KVMMemoryListener, + listener); + KVMMemoryUpdate *u1, *u2; + bool need_inhibit = false; + + if (QSIMPLEQ_EMPTY(&kml->transaction_add) && + QSIMPLEQ_EMPTY(&kml->transaction_del)) { + return; + } + + /* + * We have to be careful when regions to add overlap with ranges to remove. + * We have to simulate atomic KVM memslot updates by making sure no ioctl() + * is currently active. + * + * The lists are order by addresses, so it's easy to find overlaps. + */ + u1 = QSIMPLEQ_FIRST(&kml->transaction_del); + u2 = QSIMPLEQ_FIRST(&kml->transaction_add); + while (u1 && u2) { + Range r1, r2; + + range_init_nofail(&r1, u1->section.offset_within_address_space, + int128_get64(u1->section.size)); + range_init_nofail(&r2, u2->section.offset_within_address_space, + int128_get64(u2->section.size)); + + if (range_overlaps_range(&r1, &r2)) { + need_inhibit = true; + break; + } + if (range_lob(&r1) < range_lob(&r2)) { + u1 = QSIMPLEQ_NEXT(u1, next); + } else { + u2 = QSIMPLEQ_NEXT(u2, next); + } + } + + kvm_slots_lock(); + if (need_inhibit) { + accel_ioctl_inhibit_begin(); + } + + /* Remove all memslots before adding the new ones. */ + while (!QSIMPLEQ_EMPTY(&kml->transaction_del)) { + u1 = QSIMPLEQ_FIRST(&kml->transaction_del); + QSIMPLEQ_REMOVE_HEAD(&kml->transaction_del, next); + + kvm_set_phys_mem(kml, &u1->section, false); + memory_region_unref(u1->section.mr); + + g_free(u1); + } + while (!QSIMPLEQ_EMPTY(&kml->transaction_add)) { + u1 = QSIMPLEQ_FIRST(&kml->transaction_add); + QSIMPLEQ_REMOVE_HEAD(&kml->transaction_add, next); + + memory_region_ref(u1->section.mr); + kvm_set_phys_mem(kml, &u1->section, true); + + g_free(u1); + } + + if (need_inhibit) { + accel_ioctl_inhibit_end(); + } + kvm_slots_unlock(); } static void kvm_log_sync(MemoryListener *listener, @@ -1610,8 +1685,12 @@ void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml, kml->slots[i].slot = i; } + QSIMPLEQ_INIT(&kml->transaction_add); + QSIMPLEQ_INIT(&kml->transaction_del); + kml->listener.region_add = kvm_region_add; kml->listener.region_del = kvm_region_del; + kml->listener.commit = kvm_region_commit; kml->listener.log_start = kvm_log_start; kml->listener.log_stop = kvm_log_stop; kml->listener.priority = 10; diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 3b4adcdc101d..60b520a13e84 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -12,6 +12,7 @@ #include "exec/memory.h" #include "qapi/qapi-types-common.h" #include "qemu/accel.h" +#include "qemu/queue.h" #include "sysemu/kvm.h" typedef struct KVMSlot @@ -31,10 +32,17 @@ typedef struct KVMSlot ram_addr_t ram_start_offset; } KVMSlot; +typedef struct KVMMemoryUpdate { + QSIMPLEQ_ENTRY(KVMMemoryUpdate) next; + MemoryRegionSection section; +} KVMMemoryUpdate; + typedef struct KVMMemoryListener { MemoryListener listener; KVMSlot *slots; int as_id; + QSIMPLEQ_HEAD(, KVMMemoryUpdate) transaction_add; + QSIMPLEQ_HEAD(, KVMMemoryUpdate) transaction_del; } KVMMemoryListener; #define KVM_MSI_HASHTAB_SIZE 256 From patchwork Tue Jan 10 16:02:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KdnYS92k; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ns1Bm4F4sz23fY for ; Wed, 11 Jan 2023 06:31:12 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH63-0003F4-AK; Tue, 10 Jan 2023 11:03:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5i-00030R-Bc for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5g-000516-R5 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZsOVWPR+s9kRXm5uSXMvjV3P56UvRsZYwNaZye5lpg=; b=KdnYS92k4WWCCirBlYu92MY4hA+XDgtPI7aTjx8/dCqIUqJ3Ih4hEEzINvb/xWJfWoc7MB jVDiSlIgvjEFBVwU1N8UlNnMUnVWRZH62bVYxmtxmi6GtmxBWott410fTqfNw2OP36hfZe 3ntJKfJVFka3GjHz8wo3N1enJ400Glw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-663-HTAHk57ONLmtqlZQW_8usg-1; Tue, 10 Jan 2023 11:03:04 -0500 X-MC-Unique: HTAHk57ONLmtqlZQW_8usg-1 Received: by mail-wm1-f70.google.com with SMTP id l17-20020a05600c1d1100b003d9a145366cso6482401wms.4 for ; Tue, 10 Jan 2023 08:02:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lZsOVWPR+s9kRXm5uSXMvjV3P56UvRsZYwNaZye5lpg=; b=nvP3IcObF0lbIy3rGsh5G+vg5RGXtJQ6KEjqe6FOOQzmzbCEd3jb3oFOetT/e1aup3 iVCDHNyE+kjD+kN42oopY27eHeECG6GPfehnq2FuSjffL8Mp/2/XfyV+prSS/0xYhcRK VM6gzWyFzPCTLd+AiSudG0aaLR0rmUwX7NVIs3bXL4XFmolHNVb0JF4TrMv8PvwmOvRi yMoUWY9fy/82DNiAKf3FZy4jSFvH2JMaEAmvHpMZSo5gXpwYt21xFolTOyINfMrPm5Mm BBA2MTHDIf8TVjA/P7GxnjxVRMUwRR7P+61YVkUsotzC4jDZ7tjsfk4T9b/8/PsOY3RK VTIg== X-Gm-Message-State: AFqh2kok3i/OZmFLXjTWFcqfL7DyUaUt6QB0ZxlGFQAxuChg8MYJDLOu GvEHyUXZ8PpgypO/GUU93rYWUu8a61XqCAINlw3KuGMO6PgPKol5IM2gA6OrTTTE9vh1SXzfb7w scOJ6sGQ2kUtkc3lwQNpQJg+rMnrhyKdb+EmVF28bLjiHvAreqQNSsyOrklfxjpiA0xI= X-Received: by 2002:a05:600c:4fc5:b0:3d9:ecae:84f2 with SMTP id o5-20020a05600c4fc500b003d9ecae84f2mr7281991wmq.25.1673366571921; Tue, 10 Jan 2023 08:02:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9uN2cq+l/sGtaTY1cWuT8pYHG/ie45N/e4PefFCZfOEMhmo8yuYPs29x9wHaVaC+JFyZBjA== X-Received: by 2002:a05:600c:4fc5:b0:3d9:ecae:84f2 with SMTP id o5-20020a05600c4fc500b003d9ecae84f2mr7281964wmq.25.1673366571695; Tue, 10 Jan 2023 08:02:51 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id u13-20020a05600c19cd00b003c6f1732f65sm21812719wmq.38.2023.01.10.08.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Eric Auger , Stefan Weil Subject: [PULL 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized Date: Tue, 10 Jan 2023 17:02:10 +0100 Message-Id: <20230110160233.339771-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eric Auger To avoid compilation errors when -Werror=maybe-uninitialized is used, replace 'case 3' by 'default'. Otherwise we get: ../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’: ../target/i386/ops_sse.h:2495:13: error: ‘r3’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2495 | d->Q(3) = r3; | ~~~~~~~~^~~~ ../target/i386/ops_sse.h:2494:13: error: ‘r2’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2494 | d->Q(2) = r2; | ~~~~~~~~^~~~ ../target/i386/ops_sse.h:2493:13: error: ‘r1’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2493 | d->Q(1) = r1; | ~~~~~~~~^~~~ ../target/i386/ops_sse.h:2492:13: error: ‘r0’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2492 | d->Q(0) = r0; | ~~~~~~~~^~~~ Signed-off-by: Eric Auger Suggested-by: Stefan Weil Fixes: 790684776861 ("target/i386: reimplement 0x0f 0x3a, add AVX") Message-Id: <20221221163652.1239362-1-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 3cbc36a59d1a..c442c8c10cdc 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -2466,7 +2466,7 @@ void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order) r0 = s->Q(0); r1 = s->Q(1); break; - case 3: + default: r0 = s->Q(2); r1 = s->Q(3); break; @@ -2484,7 +2484,7 @@ void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order) r2 = s->Q(0); r3 = s->Q(1); break; - case 3: + default: r2 = s->Q(2); r3 = s->Q(3); break; From patchwork Tue Jan 10 16:02:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LcwSPLW0; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NryKR6wdSz23fY for ; Wed, 11 Jan 2023 04:21:47 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH66-0003Iu-O7; Tue, 10 Jan 2023 11:03:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5Z-0002y8-2Q for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5X-00050M-Hp for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpagXfRHheB3cgO38uMf1S16+fdPzjO7pS5QWsjJ4sc=; b=LcwSPLW0sndpltK74laQR5s+pqIXKfMQBbXy8H/ovhafEKBnecA1+4fdN55rhRHz/o61hF DmATU10ANP6DKoBFR584U+m5VQmDqGj40TOHidtADKgs2lXIIupgq+p34EjUMVbV+923gD rXvDfZIsgO/7LGWj2blHKt1IX7Hb9HE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-541-hj3-imHCP1q39TWMYCDS1g-1; Tue, 10 Jan 2023 11:02:56 -0500 X-MC-Unique: hj3-imHCP1q39TWMYCDS1g-1 Received: by mail-wm1-f69.google.com with SMTP id q21-20020a7bce95000000b003d236c91639so2672831wmj.8 for ; Tue, 10 Jan 2023 08:02:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zpagXfRHheB3cgO38uMf1S16+fdPzjO7pS5QWsjJ4sc=; b=gzwSqScA7+D6dwxC+s6wwiFNgS0503ONYFeavDT+n1SIlL7dd5w1Xd3/UOkJSQFvN3 viq1SuzEurowsJXfNfqvFm71z4u8jMoyDH9TJusHIyEggK5/CESIzMv9KQw2HIA63ZVW +9VMYjajsFwV/esRV+4bHk1itDRsRddn2m4TwJrpgWxYaWtc0vfUGPCDOKmHcNmPl1M+ y/nhyAN+lffwqbRKffnkeTFPdODtNqA2soC1Nx3OcSOYpphS9mTuOIadU7WFgd5tbyNM Qnvf/RhwbDbqum8o3rTFfnI+I8J72ixCxXq72CMFrz8I0KECo1uajAK0OF7oRVc3e1jl lc7A== X-Gm-Message-State: AFqh2krDTbO3fOKDPm61OjTjmp2MVHV7wKZ4XUbna3VrTCizV6VEWil7 VrY1F0S8R4StuEei5cD41kRkYRr10e8UkwwmJ6JsqB25Iffb+pp2FhTnaW1dnRXbphSiIeVbjye TR/vcOn8EgSY5Zjrmx0DQZiWZ/0ZBVl+W9BKRo4VrY7rHur/Gf+uUy/pyVy0qxeuTRhw= X-Received: by 2002:a5d:6447:0:b0:2bb:9f31:3568 with SMTP id d7-20020a5d6447000000b002bb9f313568mr7323125wrw.69.1673366574636; Tue, 10 Jan 2023 08:02:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKigboLcZOoFGRUkDA8RLUBsG6rk/MfLayqwV0Z1deWd+6zX3T0eJP4AuG+F8fLO1fhx5Dyw== X-Received: by 2002:a5d:6447:0:b0:2bb:9f31:3568 with SMTP id d7-20020a5d6447000000b002bb9f313568mr7323094wrw.69.1673366574061; Tue, 10 Jan 2023 08:02:54 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id w10-20020a5d404a000000b00275970a85f4sm11457740wrp.74.2023.01.10.08.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/29] chardev: clean up chardev-parallel.c Date: Tue, 10 Jan 2023 17:02:11 +0100 Message-Id: <20230110160233.339771-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Replace HAVE_CHARDEV_PARPORT with a Meson conditional, remove unnecessary defines, and close the file descriptor on FreeBSD/DragonFly. Signed-off-by: Paolo Bonzini --- chardev/char-parallel.c | 15 ++------------- chardev/meson.build | 5 ++++- include/qemu/osdep.h | 5 ----- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c index 05e7efbd6ca9..a5164f975af3 100644 --- a/chardev/char-parallel.c +++ b/chardev/char-parallel.c @@ -238,7 +238,6 @@ static void qemu_chr_open_pp_fd(Chardev *chr, } #endif -#ifdef HAVE_CHARDEV_PARPORT static void qmp_chardev_open_parallel(Chardev *chr, ChardevBackend *backend, bool *be_opened, @@ -276,29 +275,21 @@ static void char_parallel_class_init(ObjectClass *oc, void *data) cc->parse = qemu_chr_parse_parallel; cc->open = qmp_chardev_open_parallel; -#if defined(__linux__) cc->chr_ioctl = pp_ioctl; -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__DragonFly__) - cc->chr_ioctl = pp_ioctl; -#endif } static void char_parallel_finalize(Object *obj) { -#if defined(__linux__) Chardev *chr = CHARDEV(obj); ParallelChardev *drv = PARALLEL_CHARDEV(chr); int fd = drv->fd; +#if defined(__linux__) pp_hw_mode(drv, IEEE1284_MODE_COMPAT); ioctl(fd, PPRELEASE); +#endif close(fd); qemu_chr_be_event(chr, CHR_EVENT_CLOSED); -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__DragonFly__) - /* FIXME: close fd? */ -#endif } static const TypeInfo char_parallel_type_info = { @@ -315,5 +306,3 @@ static void register_types(void) } type_init(register_types); - -#endif diff --git a/chardev/meson.build b/chardev/meson.build index 664f77b8879a..789b50056ae4 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -14,9 +14,12 @@ chardev_ss.add(files( )) chardev_ss.add(when: 'CONFIG_POSIX', if_true: [files( 'char-fd.c', - 'char-parallel.c', 'char-pty.c', ), util]) +if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly'] + chardev_ss.add(files('char-parallel.c')) +endif + chardev_ss.add(when: 'CONFIG_WIN32', if_true: files( 'char-console.c', 'char-win-stdio.c', diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index b9c4307779c5..4886361be6a7 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -421,11 +421,6 @@ void qemu_anon_ram_free(void *ptr, size_t size); #define HAVE_CHARDEV_SERIAL 1 #endif -#if defined(__linux__) || defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#define HAVE_CHARDEV_PARPORT 1 -#endif - #if defined(__HAIKU__) #define SIGIO SIGPOLL #endif From patchwork Tue Jan 10 16:02:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TcgShcOU; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrwpT26GSz23g8 for ; Wed, 11 Jan 2023 03:13:21 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6Y-0003Wl-Nz; Tue, 10 Jan 2023 11:04:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5f-0002zx-M4 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5e-00050w-1u for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eTxgzICoPV0Y7l5bNsw7lmfX8M4gzc3Wrg6/6XmCqvQ=; b=TcgShcOUGXLPa9JBfjhyXNaBCLtEtaobhiYtOs6oPHARBWaNasiZmukYE6lzDDjxci5puZ DOuzklGryotmmFfXoSVEAYC95CxztEX8VGU2MKb/xqdSQShhrG3leIV9gNfaTpB+GQY9Ci BqscNZYHtVfYRN8/n5woYPhzaQW4DP0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-602-Iun0lcOXMNi6zG3Njpiqvg-1; Tue, 10 Jan 2023 11:03:03 -0500 X-MC-Unique: Iun0lcOXMNi6zG3Njpiqvg-1 Received: by mail-wm1-f70.google.com with SMTP id n8-20020a05600c294800b003d1cc68889dso2672257wmd.7 for ; Tue, 10 Jan 2023 08:02:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eTxgzICoPV0Y7l5bNsw7lmfX8M4gzc3Wrg6/6XmCqvQ=; b=aFrzROZ+v8X9yp95ZVnZhsyHk8FWHUhqYhPibKLRXgBpWOnUeZ93z1v1X/9pZ7p3X8 iA2NPv7zEqD3xOjwhq43s+WypjQTrlCaW7S58lpBf7d/6eX94GlNJ+buDcxiGSKGAs/B sF4YzSKEH6UVxWc/ipiJc7IFWtu3FQIaWNyqwFqBXg8d+6cqyn4lyrHMboSHdU5qdQrz ZxyOn8Z1/u+UudXM4KmGaZJ62Bzww6pgIFWpPFhm0HQFby9zfQN7qS7wOBy0yCjFgneV hDqhCnaMkvbgaI84PIJDXP+ayc0BzAQoCqsdut7Cpn/PfE1rGQE5xHS7Dw77lyJhjxvQ YTxA== X-Gm-Message-State: AFqh2kpFXDtc17QPg1yMjkm4WJyTiR+ogQ/uAYWe/kgg1O0ktAOmj/a0 M+4g6DDNBtnFMdlV7DFGtyWOvGEjGBFgkxJAOuhG53iG3IOF/WeeiFEGRTpEINKRXNxI4aYLnpo mximz6zHAaKYBBxuPuT65HAVar/b+xBI2haC63gL7YX76OJgmwBPHPgVHTBMUUyPD+Ew= X-Received: by 2002:a05:600c:c87:b0:3d9:73fb:8aaa with SMTP id fj7-20020a05600c0c8700b003d973fb8aaamr40366644wmb.8.1673366576973; Tue, 10 Jan 2023 08:02:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXuPei2Vf7sN4Al9BJSWDsbl8EeJ1zk/n77tZhf1oZmwmtYKZjz8VC9bIDy2w+BeQkhP+zCa0g== X-Received: by 2002:a05:600c:c87:b0:3d9:73fb:8aaa with SMTP id fj7-20020a05600c0c8700b003d973fb8aaamr40366620wmb.8.1673366576708; Tue, 10 Jan 2023 08:02:56 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id z9-20020a7bc7c9000000b003d9ef37ec1bsm9640675wmk.5.2023.01.10.08.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:56 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 08/29] gitlab: remove redundant setting of PKG_CONFIG_PATH Date: Tue, 10 Jan 2023 17:02:12 +0100 Message-Id: <20230110160233.339771-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé The PKG_CONFIG_PATH variable is not defined in GitLab CI envs and even if it was, we don't need to set it to its existing value. Signed-off-by: Daniel P. Berrangé Reviewed-by: Stefan Hajnoczi Message-Id: <20221103173044.3969425-2-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/crossbuild-template.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml index 5e8892fd4998..6d709628f127 100644 --- a/.gitlab-ci.d/crossbuild-template.yml +++ b/.gitlab-ci.d/crossbuild-template.yml @@ -6,8 +6,7 @@ script: - mkdir build - cd build - - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS --disable-user --target-list-exclude="arm-softmmu cris-softmmu i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu mips64-softmmu ppc-softmmu riscv32-softmmu sh4-softmmu @@ -32,8 +31,7 @@ script: - mkdir build - cd build - - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS --disable-tools --enable-${ACCEL:-kvm} $EXTRA_CONFIGURE_OPTS - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS @@ -44,8 +42,7 @@ script: - mkdir build - cd build - - PKG_CONFIG_PATH=$PKG_CONFIG_PATH - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS + - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS --disable-system --target-list-exclude="aarch64_be-linux-user alpha-linux-user cris-linux-user m68k-linux-user microblazeel-linux-user nios2-linux-user or1k-linux-user ppc-linux-user sparc-linux-user From patchwork Tue Jan 10 16:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M1yF7XNl; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx2l41dLz23gB for ; Wed, 11 Jan 2023 03:23:58 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH68-0003JN-Pg; Tue, 10 Jan 2023 11:03:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5m-00033B-NC for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5j-00051Y-Lc for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QBgkZzjzAEb+D7EykMmybI26MmcaMg0LTD9LL3+JAWE=; b=M1yF7XNlJi7hPBfUA+rQX/L9xO9IefQ41ZwEq/V9URpT8lPzMTktbu0fTA6Zycd1nqh+Vn sv9zlbw8gVuxaDz4qYRm96bDOzoqyxAz3RqQJtbRculDX1WeHOcVGMWJZnPH1gUSbxuI+F VF925mOvv7pJbjiIy8vJ7Gs7qiCyNU4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-630-hLq6F2mnPjmVdHdpzDMRxQ-1; Tue, 10 Jan 2023 11:03:02 -0500 X-MC-Unique: hLq6F2mnPjmVdHdpzDMRxQ-1 Received: by mail-wr1-f70.google.com with SMTP id n13-20020adfc60d000000b0029bdfcf52eeso2106127wrg.8 for ; Tue, 10 Jan 2023 08:03:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=QBgkZzjzAEb+D7EykMmybI26MmcaMg0LTD9LL3+JAWE=; b=enZkkowyiDC0DkwUQ79Q5RBGxfhpuXgI64BM1eHp0KRFkPWhAWBlu5MpvV8tu2otq4 R3F3M+XprP6M3Uz9qXd3pR5QGfY2gC1JyNDzZi4yMJJmmZkqpsLCFjeeN1t4aIVB38Ab JKFIBxcTCJrMiQbsGPiBRoeNsEkYgpvG9pyHsjLwCU3ga/uxKJIPR9g2rdYYjAYL+NLW 9LYZuVHjOqNyuRvjOfzR8ptV5Ngjdh065ubizwHfw5lK+Xqa909aqBu2gRoWIkOo2RhT Pt71I2sWwwFMV+jc0g/h0sjB3lL/ij7BgJUAfL4kWREgnjXu7sikLmG+yUwqLR4+9lOU 8YMQ== X-Gm-Message-State: AFqh2kpSxvm/IQjJejr+cNOzAnSpem44ay4+TA79YGNENlogEce4JlfW ZocHooPxAvqT1IHBRMYASKNs50kPkpC0pRxlef6uzRXCl35rsqVDJpyBdVbklrPc87kXsVhgHRS Xjgvh8K+U51dv4hbaq6SucDcq7AUSpTEr83uKYtCSqb2eYav+iylM9KvIZk7woWuPUFU= X-Received: by 2002:a05:6000:10f:b0:286:ad19:731f with SMTP id o15-20020a056000010f00b00286ad19731fmr29822339wrx.19.1673366579788; Tue, 10 Jan 2023 08:02:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXv8qLNLe53sDM3mEqYVh+Z1Zo5s1ehVS9zCM3H2hOVz+tv1qauMSrv9sB8uo31I1Uzm3avzhA== X-Received: by 2002:a05:6000:10f:b0:286:ad19:731f with SMTP id o15-20020a056000010f00b00286ad19731fmr29822318wrx.19.1673366579469; Tue, 10 Jan 2023 08:02:59 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id d16-20020a5d5390000000b00281b594c725sm11467478wrv.38.2023.01.10.08.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:02:58 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 09/29] disas: add G_GNUC_PRINTF to gstring_printf Date: Tue, 10 Jan 2023 17:02:13 +0100 Message-Id: <20230110160233.339771-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-2-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- disas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disas.c b/disas.c index 94d3b4504260..3b31315f4038 100644 --- a/disas.c +++ b/disas.c @@ -239,7 +239,8 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code, } } -static int gstring_printf(FILE *stream, const char *fmt, ...) +static int G_GNUC_PRINTF(2, 3) +gstring_printf(FILE *stream, const char *fmt, ...) { /* We abuse the FILE parameter to pass a GString. */ GString *s = (GString *)stream; From patchwork Tue Jan 10 16:02:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724215 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gTfrkezr; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NryRV3n96z23g2 for ; Wed, 11 Jan 2023 04:27:01 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH66-0003It-OB; Tue, 10 Jan 2023 11:03:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5r-00034f-TU for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5q-00052F-Ad for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WJ5zDUpYAW7GvU6+KEdiAVNPtpTVRWeAqKaWxQ4CG+c=; b=gTfrkezr1u9l6H+5080EWYaK9mPiwIU183IFoIcMG0NQKaKPyaJhT43Frh0sFawKUtEAmV jzkQgPcOk1Bkyard9fcPkH6CDSQRp5f/keWI8Q6uzbncY7rjHIpLybctCSIEjUaVEyRZzV aca5PA6/5HcV2pAi5Os1iDy52cSQCq0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-18-X2uBBvPyPbm9hw5oejdbcg-1; Tue, 10 Jan 2023 11:03:10 -0500 X-MC-Unique: X2uBBvPyPbm9hw5oejdbcg-1 Received: by mail-wm1-f71.google.com with SMTP id c7-20020a1c3507000000b003d355c13ba8so6478423wma.6 for ; Tue, 10 Jan 2023 08:03:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WJ5zDUpYAW7GvU6+KEdiAVNPtpTVRWeAqKaWxQ4CG+c=; b=cU0cN9i6LekpDEENJutdtCgSTHdBzIQxvIxyeYIlWUbc8g44R//t9oLIv4DGHJmAym V3vWa9X8R98CmtWLBg5j/4oKnMKKr6I06x290TtZyzt2/ttDECTKFQRS3MzUiJMsbNhA cJX6TOMM8u8BnbsIiMQstpqCN0kr3jnCkI76Xwh5vbVfudynTsu5ft4jPb0554QC1K9z GNjbgB2ugTPN/oFqx7kKj+7JC1SAeT9ZGHHOUVB6hEaHtaKBbzbdMqigTuUgrMUoSy5y aOWl3tVih/uO05HhN0kk2UeJLR4P2T7eHaQSUE3NGlyuY2KZpFi4uGLSphr12CbH6AEq bKpQ== X-Gm-Message-State: AFqh2kohRTeFqKe+3t0H5CToL2BYzXs0oKqAHlcG52HVBsU7z7NvGGim BBBxvbcSS4ZC2rmmR16qKmndXuCPi/Y1jBh/iiG7exn4Vfg2aTofmsoEt5MbjoMTHFUF9ce0qLJ y8LHaiph7csZXLFqENibt+QCf+y06I6BE9lJhNxp/Lu9fAJIyKC2LochUSVSkTJoQ91I= X-Received: by 2002:a05:600c:1c97:b0:3d2:274d:be7c with SMTP id k23-20020a05600c1c9700b003d2274dbe7cmr50838104wms.19.1673366582470; Tue, 10 Jan 2023 08:03:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvGpTEAocX1FO5jqi3kMiOP4gMxBHXxIH+oPixCDkWss/DssbQkmQSnIFcJy/HlIPav0CoVw== X-Received: by 2002:a05:600c:1c97:b0:3d2:274d:be7c with SMTP id k23-20020a05600c1c9700b003d2274dbe7cmr50838075wms.19.1673366582141; Tue, 10 Jan 2023 08:03:02 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id t8-20020a1c7708000000b003d9f00c8f07sm7339188wmi.21.2023.01.10.08.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Anthony PERARD Subject: [PULL 10/29] hw/xen: use G_GNUC_PRINTF/SCANF for various functions Date: Tue, 10 Jan 2023 17:02:14 +0100 Message-Id: <20230110160233.339771-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Acked-by: Anthony PERARD Message-Id: <20221219130205.687815-3-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- hw/xen/xen-bus.c | 1 + hw/xen/xen_pvdev.c | 1 + include/hw/xen/xen-bus-helper.h | 6 ++++-- include/hw/xen/xen-bus.h | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 645a29a5a070..df3f6b9ae00f 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -561,6 +561,7 @@ void xen_device_backend_printf(XenDevice *xendev, const char *key, } } +G_GNUC_SCANF(3, 4) static int xen_device_backend_scanf(XenDevice *xendev, const char *key, const char *fmt, ...) { diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 037152f06350..1a5177b35468 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -196,6 +196,7 @@ const char *xenbus_strstate(enum xenbus_state state) * 2 == noisy debug messages (logfile only). * 3 == will flood your log (logfile only). */ +G_GNUC_PRINTF(3, 0) static void xen_pv_output_msg(struct XenLegacyDevice *xendev, FILE *f, const char *fmt, va_list args) { diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helper.h index 629a904d1a86..8782f3055086 100644 --- a/include/hw/xen/xen-bus-helper.h +++ b/include/hw/xen/xen-bus-helper.h @@ -31,10 +31,12 @@ void xs_node_printf(struct xs_handle *xsh, xs_transaction_t tid, /* Read from node/key unless node is empty, in which case read from key */ int xs_node_vscanf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, - const char *fmt, va_list ap); + const char *fmt, va_list ap) + G_GNUC_SCANF(6, 0); int xs_node_scanf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, - const char *fmt, ...); + const char *fmt, ...) + G_GNUC_SCANF(6, 7); /* Watch node/key unless node is empty, in which case watch key */ void xs_node_watch(struct xs_handle *xsh, const char *node, const char *key, diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 713e763348f4..4d966a2dbbc1 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -94,7 +94,8 @@ void xen_device_frontend_printf(XenDevice *xendev, const char *key, G_GNUC_PRINTF(3, 4); int xen_device_frontend_scanf(XenDevice *xendev, const char *key, - const char *fmt, ...); + const char *fmt, ...) + G_GNUC_SCANF(3, 4); void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs, Error **errp); From patchwork Tue Jan 10 16:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gtF20BuC; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrwmD5QfTz23g8 for ; Wed, 11 Jan 2023 03:11:24 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6Z-0003Xi-H4; Tue, 10 Jan 2023 11:04:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5q-00033o-IG for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5n-00051w-Rp for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxoDxdJoAu7ijonzxciG985n50ebA+2y8TPA6VcbWzg=; b=gtF20BuC19xIGANOySDUdvOicDVMzrEbrzLWTojxxI/ad+qGgEW0c0xlbEv3gwt66p/346 A0H63Rupx/zIw7Akujp+RM3idJg+J6NvR2yvuJ1aih/Ujg0ze0sNq1/1x12tzOeOCVx/w9 SWCZYWGMO3oFFeNhnrGXkKtfwxYD/3E= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-139-hgYceHObMcmVvgX5vuzPng-1; Tue, 10 Jan 2023 11:03:13 -0500 X-MC-Unique: hgYceHObMcmVvgX5vuzPng-1 Received: by mail-wr1-f70.google.com with SMTP id m12-20020adfa3cc000000b002b881cb0cb4so2098394wrb.3 for ; Tue, 10 Jan 2023 08:03:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kxoDxdJoAu7ijonzxciG985n50ebA+2y8TPA6VcbWzg=; b=XQ6tw3iy0R/1hy8f4vG2p50rEgQnEWtPTXBfkprDkovBsmYsCtEf9gavt6Nn8w8n+B Cj24030KqelOWzzuULQ+SaumoHkyjfOJog7da9+0d5lq87k8M5MrnSIdr5sh/NU3U700 Gu8vac8rHdE9888gU5/hTjFOXOfxJBCzN3dnYRZrJiYHEjwTU+EyhZO/1v+akHNalcO0 10x4hzkckPAF9IAGEk7dSSuYUv2o1voDBLIKhvw13phhw1yqymtn01SKjEF9yLLjXowa acdmaht0uzoUlvkQrLLn974kv9wZDf+9IYtCQ0XjlDhifVpN2cWQOUDM5rA9ykl8ezSO 8c9g== X-Gm-Message-State: AFqh2krm0UXmElMBljBaLdtuJZsxjVHM+OixDNjGZYTu8H670qJG10QW Jz/edkNsQ28UQXPB1Md7A+kF+C0que+aEW7q0d54qwCqmXsiMoBB2Yo6JoknEb/9xrGu1Ir8asB Y0MChAseQAh3rJT+QReZ8BWZmXz2+UHZXa2OhIOksUrsmADBNRPDNxb1WnpB3bpE2dBo= X-Received: by 2002:a7b:c4c8:0:b0:3d3:5a4a:9101 with SMTP id g8-20020a7bc4c8000000b003d35a4a9101mr53567178wmk.23.1673366585228; Tue, 10 Jan 2023 08:03:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXtureUI8Cp/efs0GXqvwEMUFiExBFERQG1uFo6OuW9LgF8ByO4tftmT45A4z7gVGxw3WI/uOQ== X-Received: by 2002:a7b:c4c8:0:b0:3d3:5a4a:9101 with SMTP id g8-20020a7bc4c8000000b003d35a4a9101mr53567143wmk.23.1673366584937; Tue, 10 Jan 2023 08:03:04 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x14-20020a1c7c0e000000b003d9f15efcd5sm6557050wmc.6.2023.01.10.08.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 11/29] tools/virtiofsd: add G_GNUC_PRINTF for logging functions Date: Tue, 10 Jan 2023 17:02:15 +0100 Message-Id: <20230110160233.339771-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-4-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- tools/virtiofsd/fuse_log.c | 1 + tools/virtiofsd/fuse_log.h | 6 ++++-- tools/virtiofsd/passthrough_ll.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c index 745d88cd2a49..2de3f48ee7ea 100644 --- a/tools/virtiofsd/fuse_log.c +++ b/tools/virtiofsd/fuse_log.c @@ -12,6 +12,7 @@ #include "fuse_log.h" +G_GNUC_PRINTF(2, 0) static void default_log_func(__attribute__((unused)) enum fuse_log_level level, const char *fmt, va_list ap) { diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h index 8d7091bd4d0b..e5c2967ab95a 100644 --- a/tools/virtiofsd/fuse_log.h +++ b/tools/virtiofsd/fuse_log.h @@ -45,7 +45,8 @@ enum fuse_log_level { * @param ap format string arguments */ typedef void (*fuse_log_func_t)(enum fuse_log_level level, const char *fmt, - va_list ap); + va_list ap) + G_GNUC_PRINTF(2, 0); /** * Install a custom log handler function. @@ -68,6 +69,7 @@ void fuse_set_log_func(fuse_log_func_t func); * @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc) * @param fmt sprintf-style format string including newline */ -void fuse_log(enum fuse_log_level level, const char *fmt, ...); +void fuse_log(enum fuse_log_level level, const char *fmt, ...) + G_GNUC_PRINTF(2, 3); #endif /* FUSE_LOG_H_ */ diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 20f0f41f99a5..40ea2ed27fef 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -4182,6 +4182,7 @@ static void setup_nofile_rlimit(unsigned long rlimit_nofile) } } +G_GNUC_PRINTF(2, 0) static void log_func(enum fuse_log_level level, const char *fmt, va_list ap) { g_autofree char *localfmt = NULL; From patchwork Tue Jan 10 16:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dYkyqhKe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrxbg62xTz23g8 for ; Wed, 11 Jan 2023 03:49:03 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6W-0003WW-MI; Tue, 10 Jan 2023 11:04:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5q-00033n-Hv for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5n-00051o-Fs for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5geKxrZ9SVaENVV+7JQNCEHlK7JI4nrgTkAwQRpZSRM=; b=dYkyqhKeeCef8lCk/eZgqbsKgXsQgLWtB4V6KEJA6A0iFQagrSarK9PKjkvTz1WTK3y9GU J7sH+hEGeeQMviLPAv92TKWTloNa40NhaOyDsDORb5WyITC6PAOA3+pb6JrqdACQO88es0 wOPlKHC1zz1Ftt9EW44lOX6kEaSZaaI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-49-dYnFyoLGMxq47duC8tIkZw-1; Tue, 10 Jan 2023 11:03:13 -0500 X-MC-Unique: dYnFyoLGMxq47duC8tIkZw-1 Received: by mail-wr1-f69.google.com with SMTP id q3-20020adfab03000000b002b32e25058dso2123397wrc.5 for ; Tue, 10 Jan 2023 08:03:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=5geKxrZ9SVaENVV+7JQNCEHlK7JI4nrgTkAwQRpZSRM=; b=vwvh1XsKGKA1mNWy4qZsct9z1yAc6+6yEgwoUmwOQST6rDWI/ta8U+a0GQb2aQUDAl IsOJmhH3PQBvHBC2rQTYAeF5zzoaAiO6km5u1ZPLq8t3CrbGNcjcEVpGzZ58KuyvwojM lQZPQaR5FwEbiQnT19eDDKuVoW7aJHn9y7f4pT+MkYIKJaQzQpf6itR0bzpxQRispzvb 1HgobW8mBlPc23elkiWB2JdOL0jbiRt65Dprr56oSQDWw4ohn209h4tt/2m5QZRfMnrP ifVafjybcRuGY2yW2pfKf0J7WnO49ilvXnk5PHN+JA6LMMhz0nQDBN9rEncISbeilumf vKJw== X-Gm-Message-State: AFqh2kqHoA94zAqnKSVz+tRuA//gL3ilY/weh17ZJpeLQM3QFor1+EDq UOUCYb6FKC9FLgL/SFAIaTVWaoX28CNtxtr1mRebEKmLDhFEQ5nt2LF2Djdw0mUnozpcmKPinOK yEKS++QNDBrMdoadeHt85jEkqTCPj+DdWo6HdhUZRGfeZj7TvEFt9rqZ1AWfHEHnd1SQ= X-Received: by 2002:adf:f482:0:b0:2bb:f4bf:e758 with SMTP id l2-20020adff482000000b002bbf4bfe758mr4996055wro.48.1673366588307; Tue, 10 Jan 2023 08:03:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSeoZcxa6jkDgCoWRyBXzUVoHUX0Giex3z49otRDKv/R0OOo80g184kSK9QdqyFQCsw5iCDw== X-Received: by 2002:adf:f482:0:b0:2bb:f4bf:e758 with SMTP id l2-20020adff482000000b002bbf4bfe758mr4996010wro.48.1673366587654; Tue, 10 Jan 2023 08:03:07 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id g2-20020a5d4882000000b00286ad197346sm11623480wrq.70.2023.01.10.08.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= Subject: [PULL 12/29] util/error: add G_GNUC_PRINTF for various functions Date: Tue, 10 Jan 2023 17:02:16 +0100 Message-Id: <20230110160233.339771-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221219130205.687815-5-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- util/error-report.c | 1 + util/error.c | 1 + 2 files changed, 2 insertions(+) diff --git a/util/error-report.c b/util/error-report.c index 5edb2e604061..6e44a5573217 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -193,6 +193,7 @@ real_time_iso8601(void) * a single phrase, with no newline or trailing punctuation. * Prepend the current location and append a newline. */ +G_GNUC_PRINTF(2, 0) static void vreport(report_type type, const char *fmt, va_list ap) { gchar *timestr; diff --git a/util/error.c b/util/error.c index b6c89d141208..1e7af665b838 100644 --- a/util/error.c +++ b/util/error.c @@ -45,6 +45,7 @@ static void error_handle_fatal(Error **errp, Error *err) } } +G_GNUC_PRINTF(6, 0) static void error_setv(Error **errp, const char *src, int line, const char *func, ErrorClass err_class, const char *fmt, va_list ap, From patchwork Tue Jan 10 16:02:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GZ3d1Axx; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx5Y3QVmz23g8 for ; Wed, 11 Jan 2023 03:26:25 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6W-0003WV-I8; Tue, 10 Jan 2023 11:04:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5p-00033V-E1 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5n-00051k-8K for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qFzwud0tCEEBPQ1AKKxOkIC1M2ZNueA5Gpue5JhlQOc=; b=GZ3d1Axxcks3AhWXeJkisticZZr7g2F8rZzE9f+QhGB4BxTmL9dvIUaVnnlJ5bOH4bJFCP 30Uf9+lwpVcjUUWhjKk5Hz/SQvR1kbOMj3qthJSkTCQU0fiZNmrD+PPVJ3Hh2ClgE/M3qd nCo9iumRjc5/8ePQpBVZFRHAieDccDA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-553-J1HvgjjsMTSrGeFzYGRbbA-1; Tue, 10 Jan 2023 11:03:12 -0500 X-MC-Unique: J1HvgjjsMTSrGeFzYGRbbA-1 Received: by mail-wm1-f70.google.com with SMTP id q19-20020a1cf313000000b003d96c95e2f9so2676566wmq.2 for ; Tue, 10 Jan 2023 08:03:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qFzwud0tCEEBPQ1AKKxOkIC1M2ZNueA5Gpue5JhlQOc=; b=1VMLRTl30D8bEeE0HEn8gLOsfFXH9YrtIN/tDI7PE9JjdYtC9TQzlqwga3X38qI4M/ 12fuVOtcoZLWossGyUNIWmxXaZ/Lwi0LtnqCNwhM1ygSwS/6GDtZqRvmfaa9DP22AaHD vdP9v/nZGMdcHOKRd902uDuJuPQp9r4lCguukLXPFuYsXXQNPrTa+r/8NDx8VDNvax+7 WwgaKN7TbRU2YG7V3yB2F2tc5LH0mdA35+KY2xPJ7XoKuwnaGqWBz/hApNJz/ZfbX6aa 6cek406ScKz8r2CdFftsrriIYpPKUVhCxiiywVKfklIdX96nk58YI/W2iFvZt8gfKLPa uCpw== X-Gm-Message-State: AFqh2ko6c1LP+LapKOAX97ogBm2txZExiRvribDUAT9WAaKzcwomPyHH o3kiDqVOYBDrmEkHaoYNyBJ35r68CXz/rEy1vGWel2CQWbKT2OJEJi4xR9UMyyHkRe9R3PYMNG1 5OI5EacthhAKCRg/T3oc6Y3zORJnVS8yCjzic+vEquwQtLP4pEGhyM/ZiKREwCC5+WkQ= X-Received: by 2002:a7b:c7ca:0:b0:3d3:4cbf:3a51 with SMTP id z10-20020a7bc7ca000000b003d34cbf3a51mr49355561wmk.14.1673366590644; Tue, 10 Jan 2023 08:03:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSs7QNeTr0v21Yw2XkyxjU1tlziROxfUu5/+tWVAqxvZLVQ4lLoh8RoVgPwwLsRYtXNdkSBw== X-Received: by 2002:a7b:c7ca:0:b0:3d3:4cbf:3a51 with SMTP id z10-20020a7bc7ca000000b003d34cbf3a51mr49355522wmk.14.1673366590222; Tue, 10 Jan 2023 08:03:10 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id q20-20020a7bce94000000b003c6c3fb3cf6sm15136938wmj.18.2023.01.10.08.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:09 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 13/29] tests: add G_GNUC_PRINTF for various functions Date: Tue, 10 Jan 2023 17:02:17 +0100 Message-Id: <20230110160233.339771-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-6-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- tests/qtest/ahci-test.c | 3 +++ tests/qtest/arm-cpu-features.c | 1 + tests/qtest/erst-test.c | 2 +- tests/qtest/ide-test.c | 3 ++- tests/qtest/ivshmem-test.c | 4 ++-- tests/qtest/libqmp.c | 2 +- tests/qtest/libqos/libqos-pc.h | 6 ++++-- tests/qtest/libqos/libqos-spapr.h | 6 ++++-- tests/qtest/libqos/libqos.h | 6 ++++-- tests/qtest/libqos/virtio-9p.c | 1 + tests/qtest/migration-helpers.h | 1 + tests/qtest/rtas-test.c | 2 +- tests/qtest/usb-hcd-uhci-test.c | 4 ++-- tests/unit/test-qmp-cmds.c | 13 +++++++++---- 14 files changed, 36 insertions(+), 18 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index 66652fed0465..1967cd589855 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -154,6 +154,7 @@ static void ahci_migrate(AHCIQState *from, AHCIQState *to, const char *uri) /** * Start a Q35 machine and bookmark a handle to the AHCI device. */ +G_GNUC_PRINTF(1, 0) static AHCIQState *ahci_vboot(const char *cli, va_list ap) { AHCIQState *s; @@ -171,6 +172,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) /** * Start a Q35 machine and bookmark a handle to the AHCI device. */ +G_GNUC_PRINTF(1, 2) static AHCIQState *ahci_boot(const char *cli, ...) { AHCIQState *s; @@ -209,6 +211,7 @@ static void ahci_shutdown(AHCIQState *ahci) * Boot and fully enable the HBA device. * @see ahci_boot, ahci_pci_enable and ahci_hba_enable. */ +G_GNUC_PRINTF(1, 2) static AHCIQState *ahci_boot_and_enable(const char *cli, ...) { AHCIQState *ahci; diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 5a145273860c..8691802950ca 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -32,6 +32,7 @@ static QDict *do_query_no_props(QTestState *qts, const char *cpu_type) QUERY_TAIL, cpu_type); } +G_GNUC_PRINTF(3, 4) static QDict *do_query(QTestState *qts, const char *cpu_type, const char *fmt, ...) { diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c index 974e8bcfe5b7..c45bee7f054c 100644 --- a/tests/qtest/erst-test.c +++ b/tests/qtest/erst-test.c @@ -98,7 +98,7 @@ static void setup_vm_cmd(ERSTState *s, const char *cmd) const char *arch = qtest_get_arch(); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { - s->qs = qtest_pc_boot(cmd); + s->qs = qtest_pc_boot("%s", cmd); } else { g_printerr("erst-test tests are only available on x86\n"); exit(EXIT_FAILURE); diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index dbe1563b230f..dcb050bf9b4d 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -125,6 +125,7 @@ static QGuestAllocator guest_malloc; static char *tmp_path[2]; static char *debug_path; +G_GNUC_PRINTF(1, 2) static QTestState *ide_test_start(const char *cmdline_fmt, ...) { QTestState *qts; @@ -788,7 +789,7 @@ static void test_flush_nodev(void) QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; - qts = ide_test_start(""); + qts = ide_test_start("%s", ""); dev = get_pci_device(qts, &bmdma_bar, &ide_bar); diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index cd550c8935ef..9bf8e78df672 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -109,9 +109,9 @@ static void setup_vm_cmd(IVState *s, const char *cmd, bool msix) const char *arch = qtest_get_arch(); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { - s->qs = qtest_pc_boot(cmd); + s->qs = qtest_pc_boot("%s", cmd); } else if (strcmp(arch, "ppc64") == 0) { - s->qs = qtest_spapr_boot(cmd); + s->qs = qtest_spapr_boot("%s", cmd); } else { g_printerr("ivshmem-test tests are only available on x86 or ppc64\n"); exit(EXIT_FAILURE); diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c index 2b08382e5d1c..a89cab03c3b6 100644 --- a/tests/qtest/libqmp.c +++ b/tests/qtest/libqmp.c @@ -134,7 +134,7 @@ static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, * in the case that they choose to discard all replies up until * a particular EVENT is received. */ -static void +static G_GNUC_PRINTF(4, 0) void _qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, const char *fmt, va_list ap) { diff --git a/tests/qtest/libqos/libqos-pc.h b/tests/qtest/libqos/libqos-pc.h index 1a9923ead42f..a2e4209a4932 100644 --- a/tests/qtest/libqos/libqos-pc.h +++ b/tests/qtest/libqos/libqos-pc.h @@ -3,8 +3,10 @@ #include "libqos.h" -QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap); -QOSState *qtest_pc_boot(const char *cmdline_fmt, ...); +QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(1, 0); +QOSState *qtest_pc_boot(const char *cmdline_fmt, ...) + G_GNUC_PRINTF(1, 2); void qtest_pc_shutdown(QOSState *qs); #endif diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-spapr.h index c61338917acd..e4483c14f801 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -3,8 +3,10 @@ #include "libqos.h" -QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap); -QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...); +QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(1, 0); +QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...) + G_GNUC_PRINTF(1, 2); void qtest_spapr_shutdown(QOSState *qs); /* List of capabilities needed to silence warnings with TCG */ diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index 9b4dd509f08e..12d05b236595 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -21,8 +21,10 @@ struct QOSState { QOSOps *ops; }; -QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap); -QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...); +QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(2, 0); +QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...) + G_GNUC_PRINTF(2, 3); void qtest_common_shutdown(QOSState *qs); void qtest_shutdown(QOSState *qs); bool have_qemu_img(void); diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c index 7f2102825622..186fcc1141ad 100644 --- a/tests/qtest/libqos/virtio-9p.c +++ b/tests/qtest/libqos/virtio-9p.c @@ -211,6 +211,7 @@ static void *virtio_9p_pci_create(void *pci_bus, QGuestAllocator *t_alloc, * variable arguments of this function to this * replacement string */ +G_GNUC_PRINTF(3, 4) static void regex_replace(GString *haystack, const char *pattern, const char *replace_fmt, ...) { diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index db0684de48b2..a188b6278796 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -25,6 +25,7 @@ QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...); G_GNUC_PRINTF(2, 3) QDict *wait_command(QTestState *who, const char *command, ...); +G_GNUC_PRINTF(2, 3) QDict *qmp_command(QTestState *who, const char *command, ...); G_GNUC_PRINTF(3, 4) diff --git a/tests/qtest/rtas-test.c b/tests/qtest/rtas-test.c index 50df60e5b20e..1ba42b37d219 100644 --- a/tests/qtest/rtas-test.c +++ b/tests/qtest/rtas-test.c @@ -13,7 +13,7 @@ static void run_test_rtas_get_time_of_day(const char *machine) uint64_t ret; time_t t1, t2; - qs = qtest_spapr_boot(machine); + qs = qtest_spapr_boot("%s", machine); t1 = time(NULL); ret = qrtas_get_time_of_day(qs->qts, &qs->alloc, &tm, &ns); diff --git a/tests/qtest/usb-hcd-uhci-test.c b/tests/qtest/usb-hcd-uhci-test.c index 7a117b64d90c..f264d2bf734d 100644 --- a/tests/qtest/usb-hcd-uhci-test.c +++ b/tests/qtest/usb-hcd-uhci-test.c @@ -72,9 +72,9 @@ int main(int argc, char **argv) qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotplug); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { - qs = qtest_pc_boot(cmd); + qs = qtest_pc_boot("%s", cmd); } else if (strcmp(arch, "ppc64") == 0) { - qs = qtest_spapr_boot(cmd); + qs = qtest_spapr_boot("%s", cmd); } else { g_printerr("usb-hcd-uhci-test tests are only " "available on x86 or ppc64\n"); diff --git a/tests/unit/test-qmp-cmds.c b/tests/unit/test-qmp-cmds.c index 2373cd64cbfa..6d52b4e5d811 100644 --- a/tests/unit/test-qmp-cmds.c +++ b/tests/unit/test-qmp-cmds.c @@ -138,6 +138,7 @@ void qmp___org_qemu_x_command(__org_qemu_x_EnumList *a, } +G_GNUC_PRINTF(2, 3) static QObject *do_qmp_dispatch(bool allow_oob, const char *template, ...) { va_list ap; @@ -160,6 +161,7 @@ static QObject *do_qmp_dispatch(bool allow_oob, const char *template, ...) return ret; } +G_GNUC_PRINTF(3, 4) static void do_qmp_dispatch_error(bool allow_oob, ErrorClass cls, const char *template, ...) { @@ -269,7 +271,7 @@ static void test_dispatch_cmd_io(void) static void test_dispatch_cmd_deprecated(void) { - const char *cmd = "{ 'execute': 'test-command-features1' }"; + #define cmd "{ 'execute': 'test-command-features1' }" QDict *ret; memset(&compat_policy, 0, sizeof(compat_policy)); @@ -287,12 +289,13 @@ static void test_dispatch_cmd_deprecated(void) compat_policy.deprecated_input = COMPAT_POLICY_INPUT_REJECT; do_qmp_dispatch_error(false, ERROR_CLASS_COMMAND_NOT_FOUND, cmd); + #undef cmd } static void test_dispatch_cmd_arg_deprecated(void) { - const char *cmd = "{ 'execute': 'test-features0'," - " 'arguments': { 'fs1': { 'foo': 42 } } }"; + #define cmd "{ 'execute': 'test-features0'," \ + " 'arguments': { 'fs1': { 'foo': 42 } } }" QDict *ret; memset(&compat_policy, 0, sizeof(compat_policy)); @@ -310,11 +313,12 @@ static void test_dispatch_cmd_arg_deprecated(void) compat_policy.deprecated_input = COMPAT_POLICY_INPUT_REJECT; do_qmp_dispatch_error(false, ERROR_CLASS_GENERIC_ERROR, cmd); + #undef cmd } static void test_dispatch_cmd_ret_deprecated(void) { - const char *cmd = "{ 'execute': 'test-features0' }"; + #define cmd "{ 'execute': 'test-features0' }" QDict *ret; memset(&compat_policy, 0, sizeof(compat_policy)); @@ -334,6 +338,7 @@ static void test_dispatch_cmd_ret_deprecated(void) ret = qobject_to(QDict, do_qmp_dispatch(false, cmd)); assert(ret && qdict_size(ret) == 0); qobject_unref(ret); + #undef cmd } /* test generated dealloc functions for generated types */ From patchwork Tue Jan 10 16:02:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724206 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gRZ458Wt; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrxpv4gbqz23g2 for ; Wed, 11 Jan 2023 03:58:47 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH68-0003JM-PY; Tue, 10 Jan 2023 11:03:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5y-0003Ai-1N for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5w-00053C-ME for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tgs6K9/4SfQyc51ntmqCZsH1HyOpi0CzHAt9QG1by7Y=; b=gRZ458WtFu2AYjSZBi0Y8g5imhi9gCujte3s9VhixkAJupV74FnKcegeGkcSX96KGqakTu fGRfGzSr63uL4zANUpdn6Pc1flEvLD44ZbA3DpAj7xsNZDZ6dXqWDwQsIfLV2KbJW+vPgl a061qkpkUB+c09geRgxmw+FeY9/VCks= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-474-Ztnay-jUPeScs4EJDHQzsA-1; Tue, 10 Jan 2023 11:03:17 -0500 X-MC-Unique: Ztnay-jUPeScs4EJDHQzsA-1 Received: by mail-wr1-f72.google.com with SMTP id s3-20020adf9783000000b002ab389f64c1so2151756wrb.22 for ; Tue, 10 Jan 2023 08:03:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tgs6K9/4SfQyc51ntmqCZsH1HyOpi0CzHAt9QG1by7Y=; b=gogzbmNKfFYddRyPJQUR/2lEgckjlP3fSx2k68hGiwHBQrkW5yjuW+Nwqjp6t/9v80 ektE42TQ/iqHoQZPAWDTBNpclntmtgXL+siAbUGxyd3gh74NFpsSm8Kfh85fpsMno+hR JmBTV/1Hym3w1A3S/3P+MQGKoeAY2/cAtI2rCr22u8qdWDaWhjybL9VTnA5wPZaoM6OR 4cuAOHOFCwcjksRk8Z4S7i/8WWdLfHKn1HXYcEnX3AUeJu5vhcfernbXgvuO1doOGAzH 6f3km/aRxQ36GQVSUZ0C7O1tS1M/5imUNhRQF4iEN8kCSd1fa2wBRCJf+NIJ9pNA61tJ 3xpg== X-Gm-Message-State: AFqh2kqS1W2uabKqxXWilR4uZdv9mWF0VxnogwFi2+tqjfujTgjirNgH XjBrUNSb6aHWZT5TWEr3rkvtHEqSB7rW2gdXPvaoUxwOb0CGpq8TMAbPHI3idZmdhWOKH1M1shi 4b7q6RYMJLQgzg3IRuXm4lNo+WduGsestVEYdMs4LwDT3FSJIEn2vkfd3mbtTbxLKhnE= X-Received: by 2002:a05:600c:54c2:b0:3d3:3c74:dbd0 with SMTP id iw2-20020a05600c54c200b003d33c74dbd0mr49296662wmb.13.1673366593263; Tue, 10 Jan 2023 08:03:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjZuVvQMDycC80SAy0kH5Ya4AfIxvDCmgcSA5IVGrZqGZjIvIPsNZ83wBtWrm0s9bONZwkkQ== X-Received: by 2002:a05:600c:54c2:b0:3d3:3c74:dbd0 with SMTP id iw2-20020a05600c54c200b003d33c74dbd0mr49296628wmb.13.1673366592909; Tue, 10 Jan 2023 08:03:12 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id g12-20020a05600c310c00b003c70191f267sm21621257wmo.39.2023.01.10.08.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 14/29] enforce use of G_GNUC_PRINTF attributes Date: Tue, 10 Jan 2023 17:02:18 +0100 Message-Id: <20230110160233.339771-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé We've been very gradually adding G_GNUC_PRINTF annotations to functions over years. This has been useful in detecting certain malformed printf strings, or cases where we pass user data as the printf format which is a potential security flaw. Given the inherant memory corruption danger in use of format strings vs mis-matched variadic arguments, it is worth applying G_GNUC_PRINTF to all functions using printf, even if we know they are safe. The compilers can reasonably reliably identify such places with the -Wsuggest-attribute=format / -Wmissing-format-attribute flags. Signed-off-by: Daniel P. Berrangé Message-Id: <20221219130205.687815-7-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 6f5e77a71361..203b957a045f 100755 --- a/configure +++ b/configure @@ -1183,6 +1183,8 @@ add_to warn_flags -Wnested-externs add_to warn_flags -Wendif-labels add_to warn_flags -Wexpansion-to-defined add_to warn_flags -Wimplicit-fallthrough=2 +add_to warn_flags -Wsuggest-attribute=format +add_to warn_flags -Wmissing-format-attribute nowarn_flags= add_to nowarn_flags -Wno-initializer-overrides From patchwork Tue Jan 10 16:02:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PcJ4Z/MY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrz202lrpz23g8 for ; Wed, 11 Jan 2023 04:53:28 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6X-0003Wg-Pg; Tue, 10 Jan 2023 11:04:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5t-00037e-31 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5r-00052S-3y for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mz+9V6TK5S6+W3L8zAGE/ylgLN+mHyjmSzm4zgt8mIk=; b=PcJ4Z/MYp8FHQ4lQ5DfeaBFKzXu2u4F48xkUxKVuOkDw1jOGNs86cJT9oKA0n2eN48jrV8 cCN8nLpt7golJecquOjIILyJV0KVUOWHzIy1FUiKgSEJ7k8xE7DkcFSk45KUez7aEoYHZj yrfHmpKWLHkZi+Z2dv8qd8bn7dypvK0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-426-3jLWExeXO1yHzed0wl-YKQ-1; Tue, 10 Jan 2023 11:03:17 -0500 X-MC-Unique: 3jLWExeXO1yHzed0wl-YKQ-1 Received: by mail-wm1-f69.google.com with SMTP id m7-20020a05600c4f4700b003d971a5e770so6489344wmq.3 for ; Tue, 10 Jan 2023 08:03:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=mz+9V6TK5S6+W3L8zAGE/ylgLN+mHyjmSzm4zgt8mIk=; b=UIjV5Q2TLxY+uR93pEaIr+U86pgpn4K0o/11aE7w23c6QnAxDy4tZyG1AlheVUUSXs 0INZRhaYND/rwkvCNezuxQjOREBbjkXUSOGcogIgYghjXUefww0TO8q+vYyvBrPKUQoL yUxFOX28lOQ3dWwoOqgDqgWJqefc1RFvmV0/FcynrIag04oeswjZbaBQ8YMudAEv+vWV O4z1er7rZItrR5h+kUOvbZKEg+PprSIQid5wJ4+iyi/PZuQ++GznDZjGUo2SzuIzpD++ Bs6f3kdvsGCTTyjMPh/iwUENzigjOww7sfB3k1nOy9v4GPNva1ISNacj40g7ZKlUvEQR kT6w== X-Gm-Message-State: AFqh2ko0y8O9AetBL0/WgjD6W099C5sQMDa+jxaEYU5qY3cC1LrYTqBJ 63gXZ7kfRWiflTWhlgKutbiR27AJ0JDXavA1WNRSwtt7TIWZkL9wR33grosWi475D89iz4t3KJb /LMoL0Qwj+3FMZs5CiUy6X/XtCwNWkIF/pAmj4H2/SzeT9Oy9C7cRkUDyA8aAaf6E2u4= X-Received: by 2002:adf:df06:0:b0:292:27d:9647 with SMTP id y6-20020adfdf06000000b00292027d9647mr25396317wrl.10.1673366595630; Tue, 10 Jan 2023 08:03:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvP4fWWg4wEekNZGrxRWeOeh7iNfGsXj5Dbz4QTwFUGI/ptCre8Q6TO/CfTetXcO+gKXuChEw== X-Received: by 2002:adf:df06:0:b0:292:27d:9647 with SMTP id y6-20020adfdf06000000b00292027d9647mr25396295wrl.10.1673366595290; Tue, 10 Jan 2023 08:03:15 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id w6-20020adfd4c6000000b0027cb20605e3sm11414986wrk.105.2023.01.10.08.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:14 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 15/29] hw/display: avoid creating empty loadable modules Date: Tue, 10 Jan 2023 17:02:19 +0100 Message-Id: <20230110160233.339771-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Daniel P. Berrangé When using --disable-virglrenderer, QEMU still creates hw-display-virtio-gpu-gl.so hw-display-virtio-vga-gl.so hw-display-virtio-gpu-pci-gl.so but when these are loaded, they provide no functionality as the code which registers types is not compiled in. Funtionally this is relatively harmless, because QEMU is fine loading a module with no types. This is rather confusing for users and OS distro maintainers though, as they think they have the GL functionality built, but in fact the module they are looking at provides nothing of value. The root cause is the use of 'when/if_true' rules when adding sources to the module source set. If all the rules evaluate to false, then we have declared the module, but not added anything to it. We need to put declaration of the entire module inside a condition based on existance of the 3rd party library deps that are mandatory. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1352 Signed-off-by: Daniel P. Berrangé Message-Id: <20221219125830.2369169-1-berrange@redhat.com> [Do not check for pixman. - Paolo] Signed-off-by: Paolo Bonzini --- hw/display/meson.build | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/display/meson.build b/hw/display/meson.build index 7a725ed80eb5..f860c2c562ac 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -73,10 +73,12 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU') virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c')) hw_display_modules += {'virtio-gpu': virtio_gpu_ss} - virtio_gpu_gl_ss = ss.source_set() - virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl], - if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c'), pixman, virgl]) - hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss} + if virgl.found() and opengl.found() + virtio_gpu_gl_ss = ss.source_set() + virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl], + if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c'), pixman, virgl]) + hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss} + endif endif if config_all_devices.has_key('CONFIG_VIRTIO_PCI') @@ -87,10 +89,12 @@ if config_all_devices.has_key('CONFIG_VIRTIO_PCI') if_true: files('vhost-user-gpu-pci.c')) hw_display_modules += {'virtio-gpu-pci': virtio_gpu_pci_ss} - virtio_gpu_pci_gl_ss = ss.source_set() - virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', virgl, opengl], - if_true: [files('virtio-gpu-pci-gl.c'), pixman]) - hw_display_modules += {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss} + if virgl.found() and opengl.found() + virtio_gpu_pci_gl_ss = ss.source_set() + virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', virgl, opengl], + if_true: [files('virtio-gpu-pci-gl.c'), pixman]) + hw_display_modules += {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss} + endif endif if config_all_devices.has_key('CONFIG_VIRTIO_VGA') From patchwork Tue Jan 10 16:02:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BhxVv0ws; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrz5m40JTz23g2 for ; Wed, 11 Jan 2023 04:56:44 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH67-0003J1-53; Tue, 10 Jan 2023 11:03:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5y-0003BY-TF for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5x-00053I-Fv for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPdeH0pp/2DTJfVhe1E5vHI0WDekZ9SmrfU0ri7dK28=; b=BhxVv0wsTFuyY5bcFhT3FDEMkzlfUIrh05KgoER+Dw/7QDos11/V2BphRN7NJYVdrLC045 y3sZgYIfmtIDbQ8UASoOz9GOZmj3QEjztWeQ9TNyEt/R4B/K86y1QLy4pwILz7UPXqH9Fu rm3g5nolDcm27PDDo0902KCEK00kTB4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-235-yDLgL-ckNJ6cw_n95u9Cfw-1; Tue, 10 Jan 2023 11:03:22 -0500 X-MC-Unique: yDLgL-ckNJ6cw_n95u9Cfw-1 Received: by mail-wr1-f70.google.com with SMTP id h24-20020adfa4d8000000b002b4d24b7006so2116501wrb.0 for ; Tue, 10 Jan 2023 08:03:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=QPdeH0pp/2DTJfVhe1E5vHI0WDekZ9SmrfU0ri7dK28=; b=pkZMxV1WTTYqDO+ZAYfMEHtkpLPtKezmFNOdVmawWKUZ213dGbmTB6jIzOL1hlVnx2 rShjMTVRz1mFUQNMq+COFBakNDPmirIear8X49gjHdbZX9hB3LAce5TxjgTuxaDhL3e7 7ZISEzfz1pIVYQe21WhmNPRQb7s7U2uIVtXH29L6phzC2NhGp77b5xRsQ9jQgxfvAxUi 9YM7d+rXZLEeWfzP+xjup8pEGu1f1PbXbyBtuTO3rq1zK8zpdwzb2LsVVYs+aPmXWgBV OG1FjjloTLdaXGWapJoBCdaFGmolvjzxPU7jnx/SLIJeOU3vGmwzizNvDIbjyz2PacjR TNuQ== X-Gm-Message-State: AFqh2kp39pRznBMu2PDcY6JFe9GpL9kyKa/4kg+7TtzbksWox0FRd6WP Xjlwa8bj9GTvylcmAUe5MAGHnGZyK66PH0poZ40TY4GQd+CBOlXit7OwXKDaQJREE/+uRDUVQdw 2fLmB2SRs1AU8Qrxl4e/SZPqLfE0Cfqf9Ogp80m/EAyjIMUeot7m7OK6FV8oJwZy2mkc= X-Received: by 2002:a5d:4950:0:b0:26e:7604:6575 with SMTP id r16-20020a5d4950000000b0026e76046575mr40443060wrs.65.1673366598165; Tue, 10 Jan 2023 08:03:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXtR/OLpw5QD8Y+6IyX8PW3/QxaMJIxGmrH1P50S2D0A6sztpXdCeUo80NO7cjimvnx/DDBJrA== X-Received: by 2002:a5d:4950:0:b0:26e:7604:6575 with SMTP id r16-20020a5d4950000000b0026e76046575mr40443032wrs.65.1673366597812; Tue, 10 Jan 2023 08:03:17 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id k9-20020adfd229000000b002bdbef07f7csm582633wrh.50.2023.01.10.08.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:17 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 16/29] libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU Date: Tue, 10 Jan 2023 17:02:20 +0100 Message-Id: <20230110160233.339771-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann Then the libvhost-user sources are used by another project, it can not be guaranteed that _GNU_SOURCE is set by the build system. If it is for example not set, errors like this show up. CC libvhost-user.o libvhost-user.c: In function ‘vu_panic’: libvhost-user.c:195:9: error: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Werror=implicit-function-declaration] 195 | if (vasprintf(&buf, msg, ap) < 0) { | ^~~~~~~~~ | vsprintf The simplest way to allow external complication of libvhost-user.[ch] is by setting _GNU_SOURCE if it is not already set by the build system. Signed-off-by: Marcel Holtmann Message-Id: Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index d6ee6e7d9168..b55b9e244d9a 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -13,6 +13,10 @@ * later. See the COPYING file in the top-level directory. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + /* this code avoids GLib dependency */ #include #include From patchwork Tue Jan 10 16:02:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cWxc0H37; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NryF31nlCz23g2 for ; Wed, 11 Jan 2023 04:17:59 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6a-0003Yo-Ja; Tue, 10 Jan 2023 11:04:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5x-0003AT-Lh for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5w-000538-7i for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4RTiLb6IkSRfHEH978vGHK7YphgS54b204kI9E5ptdA=; b=cWxc0H377Cjq410+rSYHP3XFfWLqqqAcvh/l+A+2fplIi0nhhCiUlgQah384xo2z2jqhRT JO5W4U4aJgmG1sW+m6VOIwaMenFsU0SxvFN+YfnodGHpE/r8Ia4vi/1TzVbt1/S+CqBLya 9MCviKwyf10AoqXMPJLYI7WhfAzJ25Q= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-569-kCpyuZSWO56nqc0oCjqNIA-1; Tue, 10 Jan 2023 11:03:22 -0500 X-MC-Unique: kCpyuZSWO56nqc0oCjqNIA-1 Received: by mail-wm1-f71.google.com with SMTP id l17-20020a05600c1d1100b003d9a145366cso6483046wms.4 for ; Tue, 10 Jan 2023 08:03:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4RTiLb6IkSRfHEH978vGHK7YphgS54b204kI9E5ptdA=; b=v6Gc1i6Dc2tbs7TXK+uWj1pPFYArzlDm4QQsZMUVKqUu1U0BAptx77gXVWUo/llqZK W534+dX4+CaiUqpVNzCqpaq3MDrFcJRiw5IsCGGgo+lxsBaDYZIsbpBQTGGkFjtWYWrn BieWmSu4BRXQwA6VmrGFhKvcql6LdFv80H4VXzidf/NUbficSoo5JzvE4bmOsEe5Q0sJ GsoM5ZUpDytO8/KIV1XPsgrWnt/yUDKr8PqCvvznGDIGTxUJ0Hxu18d5mtmaa33etwub rAxwFuDTMbPUZ6wN+8KurySYLEvdtTYX0dnnHc7Id4mhnEf5eDkNXnmGnq0IbcK3dP/A 5egw== X-Gm-Message-State: AFqh2kpnino3uZGKgdbYHOJK8QARGA2DYv2KtM7CyCdBPfbV1likxnbZ xsfGhwknE3zmQ3FUJYsaDHt9HCG5PdKPCsOtelwWFfRXxHXRIV9QobHBNNTe1Kfv1MBRg9NBTYe Boo1zV6kRWam6aCa7FijdKw2Y79ii4JDH1pIg9lpHDB8qflORTXWUP/11MFRZvWqL3uA= X-Received: by 2002:a5d:5685:0:b0:2bb:4b40:2d18 with SMTP id f5-20020a5d5685000000b002bb4b402d18mr8672878wrv.62.1673366600602; Tue, 10 Jan 2023 08:03:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQV9QQRp9JoAQC8P3ERgQB1Fi9lMWvPig51S8pyrn9ABXu6i+6q+5ww3dg4kG5iCshXhEGEQ== X-Received: by 2002:a5d:5685:0:b0:2bb:4b40:2d18 with SMTP id f5-20020a5d5685000000b002bb4b402d18mr8672857wrv.62.1673366600338; Tue, 10 Jan 2023 08:03:20 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id bu3-20020a056000078300b002bbe7efd88csm7097263wrb.41.2023.01.10.08.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 17/29] libvhost-user: Replace typeof with __typeof__ Date: Tue, 10 Jan 2023 17:02:21 +0100 Message-Id: <20230110160233.339771-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann Strictly speaking only -std=gnu99 support the usage of typeof and for easier inclusion in external projects, it is better to use __typeof__. CC libvhost-user.o libvhost-user.c: In function ‘vu_log_queue_fill’: libvhost-user.c:86:13: error: implicit declaration of function ‘typeof’ [-Werror=implicit-function-declaration] 86 | typeof(x) _min1 = (x); \ | ^~~~~~ Changing these two users of typeof makes the compiler happy and no extra flags or pragmas need to be provided. Signed-off-by: Marcel Holtmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <981aa822bcaaa2b8d74f245339a99a85c25b346f.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index b55b9e244d9a..67d75ece53b7 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -62,8 +62,8 @@ #endif /* !__GNUC__ */ #ifndef MIN #define MIN(x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ + __typeof__(x) _min1 = (x); \ + __typeof__(y) _min2 = (y); \ (void) (&_min1 == &_min2); \ _min1 < _min2 ? _min1 : _min2; }) #endif From patchwork Tue Jan 10 16:02:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Fcwmp6Ld; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrxdd5z6Qz23fY for ; Wed, 11 Jan 2023 03:50:45 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6Z-0003Xh-H4; Tue, 10 Jan 2023 11:04:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH61-0003CU-IE for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH5z-00053l-3q for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9O3BN5gfcppFFZIaNOYVHyXQRdxB1gK+dJTzE8XK+ys=; b=Fcwmp6Ld8H4MiQiO5YgcpIy1kVEYnGzRVGyKsTFmPxnsGSyH0mWdztH5w4fzofuSIzseC+ B0G32h3fZ5mjBUJEJY8dHtPzAcOedsfkEhVCpSXjYO6IT2l2sHt7J/wl0vDDe/p8DFCbYG BtInvRb3/y5uXN9IalwqI0OfXZVmN9o= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-658-VYmA4IvrPZON7REe8EofRw-1; Tue, 10 Jan 2023 11:03:25 -0500 X-MC-Unique: VYmA4IvrPZON7REe8EofRw-1 Received: by mail-wm1-f72.google.com with SMTP id i7-20020a05600c354700b003d62131fe46so9210078wmq.5 for ; Tue, 10 Jan 2023 08:03:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9O3BN5gfcppFFZIaNOYVHyXQRdxB1gK+dJTzE8XK+ys=; b=lUGCQQ9p0RJ6YkEg8H+IA1OIu7ZMJWCQTuqxNnYMXTpfhMLyUq9dl1TpVEM+ptu8p6 hgVsxXnPMhkQn2rFhwoC9PPgl4xAWV3TPSLwO5otg+wx+Sv1ICEyLIEvVrm3BjQUQj6m LIggOOOxhWRTbweqqpVsK0VgI9juwnW49c3ws+4s2HLHpAGIVUKBPErWTPyCDfSkfMmN QqMrxrFJfe0nmrA+8tdIdasDUMj78wbumNfDUgrPjc19W5HlB8bAEtb30xgmOF37ogpb g6F5cLDekEeRPVjaBxA4c6285Bsong+4yuMOd+vE3UsnrOd90kw0MsQItsplf4Z9atq2 7dZw== X-Gm-Message-State: AFqh2kqXqm75RzloK87KCPh4L2Md5ed8TPsHokfQh78Qi0PSQllOK8Ae YAWbQXHDqIR1/ao7H8QENoaZ9ZP67MXwwNtWkqQD2G7BMznQs+HSXNksCFw9HFGtHp2l5P5xR5V y8SCyvTPqp6JS00jJxd9VWm+kTawRRkORQQqnV+9plTgpoyCEs9s18ZH0ovdyVE0pxFA= X-Received: by 2002:a05:600c:539a:b0:3d9:efe8:a42d with SMTP id hg26-20020a05600c539a00b003d9efe8a42dmr5765815wmb.21.1673366603179; Tue, 10 Jan 2023 08:03:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXsDj3O29v41oFN7dVmACFVSkm6/GiIZpMoYyk/FFHg3c0AhZFO03X9va4GOXsM/7IPerOWXQQ== X-Received: by 2002:a05:600c:539a:b0:3d9:efe8:a42d with SMTP id hg26-20020a05600c539a00b003d9efe8a42dmr5765779wmb.21.1673366602881; Tue, 10 Jan 2023 08:03:22 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id g12-20020a05600c310c00b003c70191f267sm21621782wmo.39.2023.01.10.08.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 18/29] libvhost-user: Cast rc variable to avoid compiler warning Date: Tue, 10 Jan 2023 17:02:22 +0100 Message-Id: <20230110160233.339771-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann The assert from recvmsg() return value against an uint32_t size field from a protocol struct throws a compiler warning. CC libvhost-user.o In file included from libvhost-user.c:27: libvhost-user.c: In function ‘vu_message_read_default’: libvhost-user.c:363:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 363 | assert(rc == vmsg->size); | ^~ This is not critical, but annoying when the libvhost-user source are used in an external project that has this compiler warning switched on. Signed-off-by: Marcel Holtmann Message-Id: <7a791e27b7bd3e0a8b8cc8fbb15090a870d226d5.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 67d75ece53b7..bcdf32a24f60 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -339,7 +339,7 @@ vu_message_read_default(VuDev *dev, int conn_fd, VhostUserMsg *vmsg) goto fail; } - assert(rc == vmsg->size); + assert((uint32_t)rc == vmsg->size); } return true; From patchwork Tue Jan 10 16:02:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=esbhnjku; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx8B0JMWz23g8 for ; Wed, 11 Jan 2023 03:28:39 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6a-0003Yk-IO; Tue, 10 Jan 2023 11:04:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH63-0003Et-1o for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH61-000547-F3 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FGj8IQlWpv2y2riqIaJ8PdXei8fcGgNZRSbE0ZwjN10=; b=esbhnjkuO5Jh0oMtQOnCapMLUys+Q6hbqfA/ALZ4Kxl2o6pyaQGBEYJK1Xk5w+Agd2+r0k HN5C3erCe62rFsv/JaGKUouRxt2UHwnVYnJm/SX0DBYJlJR5WR2WGco3CC/VLLeDRhFcg9 /uuxsSlnBHyn/AgMBZeC97CW6ollQB0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-146-wYvUS1b5MEiABeBcirTl9A-1; Tue, 10 Jan 2023 11:03:27 -0500 X-MC-Unique: wYvUS1b5MEiABeBcirTl9A-1 Received: by mail-wm1-f69.google.com with SMTP id q21-20020a7bce95000000b003d236c91639so2673333wmj.8 for ; Tue, 10 Jan 2023 08:03:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=FGj8IQlWpv2y2riqIaJ8PdXei8fcGgNZRSbE0ZwjN10=; b=l6s6WG9CgdsAtxCVTudfvUNLZl3usVzOJjjCX1o22CP8tgpK1xkjuvNuwWl6heTAEs SIbmKpFDdvZF5fIX92nLVfbJ7qrZVieN9MH+OrS3KCSeQaWnTdUTZdYOkST5qb5/joxr 8yJEjCnSYvZk3HIh5unSigHY4H5HDFNbM0dTtINyrqEUSxh2z0HtyxZL0VZOCvhclddZ ZaBezmbDswQvyQGNaxR0F9fFWgLLMbMPNbkU/ypmt68/RPZa6Qs77jMSMdOxIUMeGqHz W2HEqwNZ+rO/7z9LPbUkV4zjFDQr/l/YuiOxZ6K6ZxORTvhXcquHcq3gciibBK2rq+nO vYGQ== X-Gm-Message-State: AFqh2kr7+t0xH3LN5u9llzcneDfzSMebEwjUPTIziKbm2SUxpCnjtz+d wYYXLTu7DEuIag/jF3edIfBgXVeUwry7A/74gSD5klNWySwPxdaSBsVWLsI4hmqb9fjDEAYScpt Qp+sawA/dmpado+XtbkwqMm59XQG7De6bMmJ7h+6r+hul+ZqOiw7tesLx8ezrYoca5To= X-Received: by 2002:a05:600c:3592:b0:3d1:ebdf:d58b with SMTP id p18-20020a05600c359200b003d1ebdfd58bmr49756979wmq.5.1673366605656; Tue, 10 Jan 2023 08:03:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKA3h3yds65bpQNNOB6GKVjGPvXJTALDWMcFuNzNteJfobHtk6rW7ADD3A1Lw9O1Ss0e2Zxw== X-Received: by 2002:a05:600c:3592:b0:3d1:ebdf:d58b with SMTP id p18-20020a05600c359200b003d1ebdfd58bmr49756946wmq.5.1673366605355; Tue, 10 Jan 2023 08:03:25 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id q1-20020a1ce901000000b003b3307fb98fsm14870344wmc.24.2023.01.10.08.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 19/29] libvhost-user: Use unsigned int i for some for-loop iterations Date: Tue, 10 Jan 2023 17:02:23 +0100 Message-Id: <20230110160233.339771-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann The sign-compare warning also hits some of the for-loops, but it easy fixed by just making the iterator variable unsigned int. CC libvhost-user.o libvhost-user.c: In function ‘vu_gpa_to_va’: libvhost-user.c:223:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 223 | for (i = 0; i < dev->nregions; i++) { | ^ Signed-off-by: Marcel Holtmann Message-Id: Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index bcdf32a24f60..211d31a4cc88 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -192,7 +192,7 @@ vu_panic(VuDev *dev, const char *msg, ...) void * vu_gpa_to_va(VuDev *dev, uint64_t *plen, uint64_t guest_addr) { - int i; + unsigned int i; if (*plen == 0) { return NULL; @@ -218,7 +218,7 @@ vu_gpa_to_va(VuDev *dev, uint64_t *plen, uint64_t guest_addr) static void * qva_to_va(VuDev *dev, uint64_t qemu_addr) { - int i; + unsigned int i; /* Find matching memory region. */ for (i = 0; i < dev->nregions; i++) { @@ -621,7 +621,7 @@ map_ring(VuDev *dev, VuVirtq *vq) static bool generate_faults(VuDev *dev) { - int i; + unsigned int i; for (i = 0; i < dev->nregions; i++) { VuDevRegion *dev_region = &dev->regions[i]; int ret; @@ -829,7 +829,7 @@ static inline bool reg_equal(VuDevRegion *vudev_reg, static bool vu_rem_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { VhostUserMemoryRegion m = vmsg->payload.memreg.region, *msg_region = &m; - int i; + unsigned int i; bool found = false; if (vmsg->fd_num > 1) { @@ -895,7 +895,7 @@ vu_rem_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { static bool vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg) { - int i; + unsigned int i; VhostUserMemory m = vmsg->payload.memory, *memory = &m; dev->nregions = memory->nregions; @@ -972,7 +972,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg) static bool vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg) { - int i; + unsigned int i; VhostUserMemory m = vmsg->payload.memory, *memory = &m; for (i = 0; i < dev->nregions; i++) { @@ -1980,7 +1980,7 @@ end: void vu_deinit(VuDev *dev) { - int i; + unsigned int i; for (i = 0; i < dev->nregions; i++) { VuDevRegion *r = &dev->regions[i]; From patchwork Tue Jan 10 16:02:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iZcmDe+i; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ns0V00Mndz23g2 for ; Wed, 11 Jan 2023 05:59:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6V-0003V8-T5; Tue, 10 Jan 2023 11:03:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH65-0003IP-OG for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH64-00054T-8E for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F0m+oaujy6Qxd5mN3bMkWen0X+N06gV/UBfSfVbYUnw=; b=iZcmDe+iUbXKOs8RPe+FxiY9ehd0rg0T6JO3Stk+/XQDuptMbUae0Jm6ObD6NboGtuXFcD HetCoqsR2QWcgQQ1QeMxOTjeJ6/CBsZmC03YSpdA4XDr+QBDqblA3gp9SDzmuJD+7nH5Wi UQLKIOpa04+DXSUuya60QKwYVm0S/xY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-553-ZsoXekedOqm7MhAoBu5oLw-1; Tue, 10 Jan 2023 11:03:30 -0500 X-MC-Unique: ZsoXekedOqm7MhAoBu5oLw-1 Received: by mail-wr1-f69.google.com with SMTP id m12-20020adfa3cc000000b002b881cb0cb4so2098789wrb.3 for ; Tue, 10 Jan 2023 08:03:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=F0m+oaujy6Qxd5mN3bMkWen0X+N06gV/UBfSfVbYUnw=; b=FZCY9rw97cjBb0yq3Gg2Di11LWgrH8l+4p2akaTX8he+0DIJceEicrOsTppr1yS7FC T6jq3MOvO8Ua35e2DXtcf888yVHuuw5adHkicIMQUjl8TwFMV94Xp+qfbDZMkJGLtjJE Ap+1xGzQ8Gm8NkSV3mr4arDN2hqJIa5sK1Razs0m36+lsNa0/gdT56UIgdwtmD/v133O WaxkBOWeF/zHXfyaHu+weGLDduPX8dZ3Qx6LaNtttszfn/hQ7zi2k5SdbOEKCpYRVCNB ctKWcWpauBNGjNCeryCn/tMsfEWJXpaKfb99pB6VDUn7K0XQHWYS/omjsA3+YAIq8BUC 1vqw== X-Gm-Message-State: AFqh2kp9qeRksHcWxRofzvNb6nGGKRI54NqIMOCTJXD7leh23gO2Xg+r DsuEIaL+NdS+sl7nMgdzRKT7abAGA2VcNrK++2BtPld6iifdcZpkzRJs3kr/Y4tqXHmMioWAuO6 Qw67+ukVswJZbd8Q+k0ltga7wffzhid/dmbrIan7wRtvH27WbIkA+fJkyh7th03Y+55E= X-Received: by 2002:a05:6000:1b88:b0:242:5dd7:8115 with SMTP id r8-20020a0560001b8800b002425dd78115mr41728666wru.64.1673366608204; Tue, 10 Jan 2023 08:03:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzsTHVX/HAktplHIaI/O7GPLVjq9kKCdrQeKo0cd6bZh3VENvmqZJRNLB9wM7koCLN2eH/uQ== X-Received: by 2002:a05:6000:1b88:b0:242:5dd7:8115 with SMTP id r8-20020a0560001b8800b002425dd78115mr41728637wru.64.1673366607863; Tue, 10 Jan 2023 08:03:27 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id k2-20020a5d5182000000b00236545edc91sm11689539wrv.76.2023.01.10.08.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:27 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 20/29] libvhost-user: Declare uffdio_register early to make it C90 compliant Date: Tue, 10 Jan 2023 17:02:24 +0100 Message-Id: <20230110160233.339771-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann When using libvhost-user source in an external project that wants to comply with the C90 standard, it is best to declare variables before code. CC libvhost-user.o libvhost-user.c: In function ‘generate_faults’: libvhost-user.c:683:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 683 | struct uffdio_register reg_struct; | ^~~~~~ In this case, it is also simple enough and doesn't cause any extra ifdef additions. Signed-off-by: Marcel Holtmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <556c2d00c01fa134d13c0371d4014c90694c2943.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 211d31a4cc88..bf92cc85c086 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -626,6 +626,8 @@ generate_faults(VuDev *dev) { VuDevRegion *dev_region = &dev->regions[i]; int ret; #ifdef UFFDIO_REGISTER + struct uffdio_register reg_struct; + /* * We should already have an open ufd. Mark each memory * range as ufd. @@ -659,7 +661,7 @@ generate_faults(VuDev *dev) { "%s: Failed to madvise(NOHUGEPAGE) region %d: %s\n", __func__, i, strerror(errno)); } - struct uffdio_register reg_struct; + reg_struct.range.start = (uintptr_t)dev_region->mmap_addr; reg_struct.range.len = dev_region->size + dev_region->mmap_offset; reg_struct.mode = UFFDIO_REGISTER_MODE_MISSING; From patchwork Tue Jan 10 16:02:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bSJQCECq; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx2l42RYz23gG for ; Wed, 11 Jan 2023 03:23:58 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6e-0003bQ-Tw; Tue, 10 Jan 2023 11:04:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6B-0003Jk-9k for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH68-00054h-6A for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hiAekfFiEvKLd8dB3ANRhfP/pRCQs37ncgREKupv5eE=; b=bSJQCECquA6mzaeJqvWPB8c+z6xeOOHQi0NeV5123ecAxTK4I+FAJs2Rz26v5U1GhDAcbc zVc9cLS5QKhnAhHff8bNhyFNSh+VXWNefDbTjVhRh0ZWKi9hugfQjowjL7CsZGrtMrN7S+ 0JNzurOwVcLoPWQHb2J4Vnb9ve6E3fs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-536-7IHXaekBO-CirSS9ncL0oQ-1; Tue, 10 Jan 2023 11:03:34 -0500 X-MC-Unique: 7IHXaekBO-CirSS9ncL0oQ-1 Received: by mail-wm1-f72.google.com with SMTP id fl12-20020a05600c0b8c00b003d96f0a7f36so6494499wmb.1 for ; Tue, 10 Jan 2023 08:03:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hiAekfFiEvKLd8dB3ANRhfP/pRCQs37ncgREKupv5eE=; b=pHTpQ1vFWHAiPynkqnziA/Wa0RlxuZpJ0Pt56Gi5JGnth7H4bNnp8e44bdBzQ62kCs OpDuVzBXbODxZl8FCa/95tG4wahkznB7uQ6wZauPxIoujIsIWckDlZsy7PzwSNmH45TW LjUoa7X0eOWjzHydafsElB1baM/41yptgugux7J4415HgOuXs/DA6u6p3DPf2qiLVm7A GBdgCWFmEo3EacQ5s3IuGus5Rwmv2pbbM7AHrRLgKp35Q4FCbCnvuwSpPCd90yhRxsfA 4x8+tXSebDk14iHMCs6D1IdeIUEE2c0SEgvmekAsiwT8NiXaGhB6CiaWxVgazekO3pFe 01GQ== X-Gm-Message-State: AFqh2kor4vmzLNI5j2QpY9N8QPozTWq/o9ZxNPjpgSW22kEFvkIRAS/J VFCmtVsj8vnpkHDkrHRP+2/Uq6u4djAW/nCJAswmPwzmp1ir8tTPFM3mQSbqGdiP5KztDP9USND C35U8Yp/j8eBe9DiFvZG6ovfaNW+cZm1z3wK0UW+xaiZbRTxXc7bUXcrTkj0koxUAiJk= X-Received: by 2002:adf:e184:0:b0:2ba:4ee8:d708 with SMTP id az4-20020adfe184000000b002ba4ee8d708mr12936818wrb.32.1673366612754; Tue, 10 Jan 2023 08:03:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXubGoKQmnJHMn0QHOj3QwOWeTamXssPqE/5ao5SDKMyoY7g5dg9pHz4KX8gmnKBpPDwGRCkEw== X-Received: by 2002:adf:e184:0:b0:2ba:4ee8:d708 with SMTP id az4-20020adfe184000000b002ba4ee8d708mr12936791wrb.32.1673366612469; Tue, 10 Jan 2023 08:03:32 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id t6-20020adfe446000000b002bb28209744sm11166960wrm.31.2023.01.10.08.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 21/29] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant Date: Tue, 10 Jan 2023 17:02:25 +0100 Message-Id: <20230110160233.339771-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann The assignment of dev->postcopy_ufd can be moved into an else clause and then the code becomes C90 compliant. CC libvhost-user.o libvhost-user.c: In function ‘vu_set_postcopy_advise’: libvhost-user.c:1625:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 1625 | struct uffdio_api api_struct; | ^~~~~~ Understandable, it might be desired to avoid else clauses, but in this case it seems clear enough and frankly the dev->postcopy_ufd is only assigned once. Signed-off-by: Marcel Holtmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <74db52afb1203c4580ffc7fa462b4b2ba260a353.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index bf92cc85c086..b28b66cdb159 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -1599,12 +1599,13 @@ vu_set_config(VuDev *dev, VhostUserMsg *vmsg) static bool vu_set_postcopy_advise(VuDev *dev, VhostUserMsg *vmsg) { - dev->postcopy_ufd = -1; #ifdef UFFDIO_API struct uffdio_api api_struct; dev->postcopy_ufd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK); vmsg->size = 0; +#else + dev->postcopy_ufd = -1; #endif if (dev->postcopy_ufd == -1) { From patchwork Tue Jan 10 16:02:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YKxkQq9C; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrycS16kXz23fY for ; Wed, 11 Jan 2023 04:34:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6Z-0003X9-1n; Tue, 10 Jan 2023 11:04:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6D-0003KF-8m for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6B-000557-Pe for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LD0ZnDQG+7PlYWCzQLV8D8Fhy1u5VFQqJLQLd70bB28=; b=YKxkQq9C7EKmSCibEPsO1oxeqRKmWSwoqhEgwCCpIgk775wG+roOkJQtSFycaFkvodE63r rQup+iAOzAjdbjy1VCIDpfy5Y8aQL6VO+JD/gmmCXlF09Nf61pfWFTm22Lp+tgT1nclxsb kOuxn1Bwa4xfG9ZKI8Ysroi7J7xxOzY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-445-AjJv8aqbOvWD80NKpoNd6g-1; Tue, 10 Jan 2023 11:03:37 -0500 X-MC-Unique: AjJv8aqbOvWD80NKpoNd6g-1 Received: by mail-wm1-f69.google.com with SMTP id m7-20020a05600c4f4700b003d971a5e770so6489849wmq.3 for ; Tue, 10 Jan 2023 08:03:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LD0ZnDQG+7PlYWCzQLV8D8Fhy1u5VFQqJLQLd70bB28=; b=kgcmkRvLBuggI2oP6N96GvmlnINo7RZKfGXErxdQhHqcqCtX9LVKmohk/nnWLihZKk 69+dnXKJlUQZEO6hBiejIGPchA6pfmUKAQV8ILPsiA78FqGKIJ/BCfSu/0JnJgZRH696 NMwQg/0MgKTv8u/PzydMCmpnfWryTWpGwJxntNT46z7+nVMODct1N5UYtAcg1QwZPRzY 2V398DpHWNglU4F4uMPzd+9jvmFfiGNk6oF6oldOWyvOS+tfNwR2Em4N6H/sgjk5Y9HU zFQWM96KAN6cdZZtgWf2QYKQBZ5oGqAI/7MIOk2juFEfXvLJFAU81QzobH18y8RiuXe0 TpDg== X-Gm-Message-State: AFqh2koGLwqUgpWOZ/nKwQ09rRGo0Qn6luuORKT6BRntnbyfsIzZa90Z Elb/4ZLL/N41qZNU1rJTRWgefDvBuKImEdPoklrmZZl5y5rvGvbpkOI54dAqkXLANozXPFixBUN oLe3zdVYSt5A1MyY58OeOVKUg9g+wb072zWrX4gnw0CnMVeWDgvKZs1q96xfeLEDFblI= X-Received: by 2002:a5d:470b:0:b0:2bb:9106:d0e with SMTP id y11-20020a5d470b000000b002bb91060d0emr8006551wrq.18.1673366615952; Tue, 10 Jan 2023 08:03:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsP14plIxoYY/I5BJ+j9M4+YNy5IkkdN2GiV8tkmSuOUK/N51xyI2VRVWpm1r76P6MRmjQdlQ== X-Received: by 2002:a5d:470b:0:b0:2bb:9106:d0e with SMTP id y11-20020a5d470b000000b002bb91060d0emr8006528wrq.18.1673366615671; Tue, 10 Jan 2023 08:03:35 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id s1-20020a5d4ec1000000b002882600e8a0sm11665573wrv.12.2023.01.10.08.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 22/29] libvduse: Provide _GNU_SOURCE when compiling outside of QEMU Date: Tue, 10 Jan 2023 17:02:26 +0100 Message-Id: <20230110160233.339771-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann When the libvduse sources are used by another project, it can not be guaranteed that _GNU_SOURCE is set by the build system. If it is for example not set, errors like this show up. CC libvduse.o libvduse.c: In function ‘vduse_log_get’: libvduse.c:172:9: error: implicit declaration of function ‘ftruncate’; did you mean ‘strncat’? [-Werror=implicit-function-declaration] 172 | if (ftruncate(fd, size) == -1) { | ^~~~~~~~~ | strncat The simplest way to allow external complication of libvduse.[ch] by setting _GNU_SOURCE if it is not already set by the build system. Signed-off-by: Marcel Holtmann Message-Id: <407f3665f0605df936e5bfe60831d180edfb8cca.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvduse/libvduse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c index e089d4d546cf..c871bd331a6b 100644 --- a/subprojects/libvduse/libvduse.c +++ b/subprojects/libvduse/libvduse.c @@ -16,6 +16,10 @@ * later. See the COPYING file in the top-level directory. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #include #include #include From patchwork Tue Jan 10 16:02:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qrtwnbnk; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrxHt6gNDz23gB for ; Wed, 11 Jan 2023 03:35:21 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6c-0003aj-0h; Tue, 10 Jan 2023 11:04:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6G-0003M0-5N for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6E-00056d-OM for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NMrUd07MfUZG/5ocZjzOkUszpCqrIAmJ6EfxLJBAlz4=; b=QrtwnbnkbcxHNbHFqJdLd0k3zKI4Z5Gi7Dk7nARIiAGsfCfdxrtNdWEM7QbiV1OpX+CuyS LR+MNnxAkHqBBYpch4GSOQSC+Ecw2QKlp83xqhOPyPxNHNziKqpgIBPnx5WqCCd7YZjE8l LLFlGNCHF92vnKTCJPLAT28t3oPC9fA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-620-vFD55wRfPhWDjxn7Z4EeNQ-1; Tue, 10 Jan 2023 11:03:40 -0500 X-MC-Unique: vFD55wRfPhWDjxn7Z4EeNQ-1 Received: by mail-wr1-f70.google.com with SMTP id i2-20020adfaac2000000b002bc40f98167so1365418wrc.2 for ; Tue, 10 Jan 2023 08:03:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NMrUd07MfUZG/5ocZjzOkUszpCqrIAmJ6EfxLJBAlz4=; b=0nfTom7eKixEaR/5S3kLsq+miPrY2WLmoCADy+ISivzvnCzmWYKZLBB+Hp1/cxUbe1 0lqQ/w7sTYeYa6XpE1fKP4nOeZk0C+lSWq1R7zrvA2CmLpafyVuo5Icj6jA40VT/LXwb FqONb8NPfvHYgEpfo95VI81EfL/x0Oo7eSe0jEkqHGykJiWKh2Nc7jzWmvXlrcISyHVR y45bvVK5fqX5yM28OQv0ZA0+HHI0tOqQukOT0g43wES7OyjVZQ+9IopzA9I1jxnlBmiZ UWufeYY+ksB/l7OFRUtTiJLOHJsXPqR3cHkBYZs6kJpvXj3aZXIeKOqkiAOhcbh8c0Ud lwCA== X-Gm-Message-State: AFqh2koCUBP7HjJlIogQZMfPZZ7zYsG9ueJNGiDCsuMluRr7b0CtnK/I 3GpNaAuPKCl6/fNROZjhCA5j/yUYfImP0pYByTCvuSutZGWcZk8zE54r5OiuJefVmFhD4+Tt+wL I6vNToeHpl9iSGRZcYS4GNyhtSPut8jXHz4iu47G1sm+tXNOmZCMOWN/vAFqr+ZuLlJw= X-Received: by 2002:a05:600c:4e51:b0:3d1:e1f4:21d1 with SMTP id e17-20020a05600c4e5100b003d1e1f421d1mr60813663wmq.26.1673366618686; Tue, 10 Jan 2023 08:03:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEyzCX7eOfWadQd/kOREPPyHPPqy8TPnqbpZV6RZB+u1oZ39IR1ZWPTRJBXtIr5SXGgUD6sw== X-Received: by 2002:a05:600c:4e51:b0:3d1:e1f4:21d1 with SMTP id e17-20020a05600c4e5100b003d1e1f421d1mr60813633wmq.26.1673366618395; Tue, 10 Jan 2023 08:03:38 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id j30-20020a05600c1c1e00b003d9f14e9085sm7539910wms.17.2023.01.10.08.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann , Xie Yongji Subject: [PULL 23/29] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq Date: Tue, 10 Jan 2023 17:02:27 +0100 Message-Id: <20230110160233.339771-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann It seems there is no need to keep the inuse field signed and end up with compiler warnings for sign-compare. CC libvduse.o libvduse.c: In function ‘vduse_queue_pop’: libvduse.c:789:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] 789 | if (vq->inuse >= vq->vring.num) { | ^~ Instead of casting the comparison to unsigned int, just make the inuse field unsigned int in the fist place. Signed-off-by: Marcel Holtmann Reviewed-by: Xie Yongji Message-Id: <9fe3fd8b042e048bd04d506ca6e43d738b5c45b7.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvduse/libvduse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c index c871bd331a6b..338ad5e352e7 100644 --- a/subprojects/libvduse/libvduse.c +++ b/subprojects/libvduse/libvduse.c @@ -101,7 +101,7 @@ struct VduseVirtq { uint16_t signalled_used; bool signalled_used_valid; int index; - int inuse; + unsigned int inuse; bool ready; int fd; VduseDev *dev; From patchwork Tue Jan 10 16:02:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aHgiDQVv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nry0c5ylMz23fY for ; Wed, 11 Jan 2023 04:07:12 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6b-0003aQ-Oo; Tue, 10 Jan 2023 11:04:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6J-0003PZ-9L for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6H-00056o-Pz for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JxFwuoY0l5szGFqjgOPodO6ocLa/m3CKjP5XJeoQJfw=; b=aHgiDQVvarXl69BPQ4jeLmKgYkE1d7ttbvjhC2agHwDuCunZ8c0L1ikbztT52uQG+ZICrw 0ZEatmhgD2fkKgcNy89Ovd7e04rkGo48qGn2xVLdouoYikFG/+WaxQsfVnM+x1oa5KQD16 IaI6tjYRKTHVaNsm34TPKpI9583MmWs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-596-eAmRQmyHMMmYo90XzMEy_g-1; Tue, 10 Jan 2023 11:03:43 -0500 X-MC-Unique: eAmRQmyHMMmYo90XzMEy_g-1 Received: by mail-wm1-f72.google.com with SMTP id m7-20020a05600c4f4700b003d971a5e770so6490017wmq.3 for ; Tue, 10 Jan 2023 08:03:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JxFwuoY0l5szGFqjgOPodO6ocLa/m3CKjP5XJeoQJfw=; b=HIWOUblKhtwvFMTeNm/MJ3BJ59p5+Kqsr7OgGWsg5IkgXoE2I8lDzaBUpH70MKeJiF Jy+a5E85veOSTL06+n5gOZQkUDuHXGl/HPnOdWLPkMMu7nRMxvAHBTMUHI52508hqWHj aUJgLi7LH7UTs3sTLLwTYXIWhvCiwrxa/0ByMQQpNs8OuQXiPC8SrralfNDi7U9WBcRB QteKlLl8mpcLCRxsf/8SBd4TAzH+0TgCmqppz7mZNoyRqT7WuF/60XoeCnu+mQa9UFxq ZlXIT2q4saCThy/vAtj/Pe8ATEzgMOCOIn56qPABHSHyDRcUBsCwOGZSVi0GWSs4tzp/ XLfg== X-Gm-Message-State: AFqh2ko7G7NY7kBp+DA6TJFLBOf9CykhpzkMImDsp2V5ohRzM+HI0yD/ IO5Ivu8Ilm8NhqTybcDDage4B4703FOW3EJZtJZXDjaZFOXeAjAiWKodnzMgrqg7ZQt/4bhh47g lC4D2gdVuXlXVc7D0wyjg7cvOqkW0glogaPERaI3IAQEOFXr0EMPrwUUtMYwJ6SyxOHU= X-Received: by 2002:a05:600c:1e1d:b0:3cf:b07a:cd2f with SMTP id ay29-20020a05600c1e1d00b003cfb07acd2fmr48816531wmb.37.1673366621357; Tue, 10 Jan 2023 08:03:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXujK+aUjfokkOYZxDs+7TneEItPwD85YE0iMkZjMq2PTf5k+WZZOI6GXhw2lQPnHS+GQQSBqQ== X-Received: by 2002:a05:600c:1e1d:b0:3cf:b07a:cd2f with SMTP id ay29-20020a05600c1e1d00b003cfb07acd2fmr48816506wmb.37.1673366621120; Tue, 10 Jan 2023 08:03:41 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id m18-20020a05600c4f5200b003c71358a42dsm26783902wmq.18.2023.01.10.08.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann , Xie Yongji Subject: [PULL 24/29] libvduse: Fix assignment in vring_set_avail_event Date: Tue, 10 Jan 2023 17:02:28 +0100 Message-Id: <20230110160233.339771-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann Since the assignment is causing a compiler warning, fix it by using memcpy instead. CC libvduse.o libvduse.c: In function ‘vring_set_avail_event’: libvduse.c:603:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasin] 603 | *((uint16_t *)&vq->vring.used->ring[vq->vring.num]) = htole16(val); | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Marcel Holtmann Suggested-by: Xie Yongji Suggested-by: Paolo Bonzini Message-Id: <4a0fe2a6436464473119fdbf0bc4076b36fbb37f.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvduse/libvduse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c index 338ad5e352e7..377959a0b4fb 100644 --- a/subprojects/libvduse/libvduse.c +++ b/subprojects/libvduse/libvduse.c @@ -582,7 +582,8 @@ void vduse_queue_notify(VduseVirtq *vq) static inline void vring_set_avail_event(VduseVirtq *vq, uint16_t val) { - *((uint16_t *)&vq->vring.used->ring[vq->vring.num]) = htole16(val); + uint16_t val_le = htole16(val); + memcpy(&vq->vring.used->ring[vq->vring.num], &val_le, sizeof(uint16_t)); } static bool vduse_queue_map_single_desc(VduseVirtq *vq, unsigned int *p_num_sg, From patchwork Tue Jan 10 16:02:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jMN8D4Se; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrxr32gDDz23g2 for ; Wed, 11 Jan 2023 03:59:45 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6f-0003dE-Nj; Tue, 10 Jan 2023 11:04:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6N-0003QJ-Nf for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6J-000570-J1 for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sp+v90SdO17Q3YnQ/1B/0vwvm96JM/TGxpmtJEW9yPU=; b=jMN8D4SevxRSOr1bA9VlA88MpYX7+z9mrSev2PpKpALoWOmrreqT8qZqsQRMRd/9VeivDR h6nHA9/R5MMc5Liu2RoBkB7EVGKGPsvx7DTH4togc6viPT2ij45fGSZBcmLkLtuJCqHZZp Hg+N//8QKzJsR26k683/kgrfGJ/2D+s= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-29-BI6ZGeE9OOuzv6ETOVv2FQ-1; Tue, 10 Jan 2023 11:03:45 -0500 X-MC-Unique: BI6ZGeE9OOuzv6ETOVv2FQ-1 Received: by mail-wr1-f71.google.com with SMTP id e29-20020adf9bdd000000b002bb0d0ea681so2083534wrc.20 for ; Tue, 10 Jan 2023 08:03:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sp+v90SdO17Q3YnQ/1B/0vwvm96JM/TGxpmtJEW9yPU=; b=1pFr93HifRMKQKUlKoaK84lmt7GARAq0Slbf4RJPw2NIX0q+qjvQ5Gxkv2JFaUiONv w542uvNbWwynv54URy6drtguy3XYelin0G+s+pJ9Y2HpI+SSgMzVr9AgFSd92NbHdFyf cWx7r6mPQ7lSOoDkoWRe5Ws6WSO5SGknWMJbkIBSolOnJmYBsfp8j39LwP2B0jyCGMyA C6h6PfjUKfhsHFD1QkyQwy/bNK/OegmfBvIjkewnd3cTyCixdvvn5Doy8ly0nt2JP7ki mXsvA4GBUNUvZ9HiL2S0nPw1qnSe7jJ2hCrSxXBZx97owP8NbzRngWHpVk5uEzhp82TG kLdQ== X-Gm-Message-State: AFqh2kphyy7yfxGRxGofrHdJLMDZ0ePqe70fw3UyE6/fSzLvortDOS9t qAIMr1tf8TCFja7wE28vkzlSYT4YTFUKL0NTrgOvNiKOXWwmU0xPcF3vBE6Q/EGq2U+/S18EKSm SShj12vwXTZ+zXm+zkk3O2ifsQamVZAyYzAArbrsUZpAe/9+w26NG5SYwgaQ3NPdjPTw= X-Received: by 2002:a05:600c:3b22:b0:3c6:e63e:814b with SMTP id m34-20020a05600c3b2200b003c6e63e814bmr49259803wms.2.1673366624057; Tue, 10 Jan 2023 08:03:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXscw8V9y5pMGMPZdULldWUfchJ+K9Y5vKP2cYxXsSWCINC0kLX5po0D651GwkEFaKEkx1pAAw== X-Received: by 2002:a05:600c:3b22:b0:3c6:e63e:814b with SMTP id m34-20020a05600c3b2200b003c6e63e814bmr49259770wms.2.1673366623692; Tue, 10 Jan 2023 08:03:43 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id l36-20020a05600c1d2400b003d9fb59c16fsm2122120wms.11.2023.01.10.08.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 25/29] libvhost-user: Fix assignment in vring_set_avail_event Date: Tue, 10 Jan 2023 17:02:29 +0100 Message-Id: <20230110160233.339771-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann Since it was proposed to change the code in libvduse.c to use memcpy instead of an assignment, the code in libvhost-user.c should also be changed to use memcpy. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini Message-Id: <502b22723264db064e4b05008233a9c1f2f8aaaa.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/libvhost-user.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index b28b66cdb159..fc69783d2bf6 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -2478,14 +2478,13 @@ vring_used_flags_unset_bit(VuVirtq *vq, int mask) static inline void vring_set_avail_event(VuVirtq *vq, uint16_t val) { - uint16_t *avail; + uint16_t val_le = htole16(val); if (!vq->notification) { return; } - avail = (uint16_t *)&vq->vring.used->ring[vq->vring.num]; - *avail = htole16(val); + memcpy(&vq->vring.used->ring[vq->vring.num], &val_le, sizeof(uint16_t)); } void From patchwork Tue Jan 10 16:02:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EJH6XVNe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrxp76gKKz23g2 for ; Wed, 11 Jan 2023 03:58:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6g-0003db-0F; Tue, 10 Jan 2023 11:04:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6P-0003QT-NF for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6N-00057Q-FJ for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XbOaISPlploGt1778joFsAZkH0/JisRO5CprslAGWp4=; b=EJH6XVNegWE4zLUlNChaZSsITgzKmOTrdGIEhLRoCI8rxubW53zCd5OVyINNMm1hfa3YPd 44L3MTYxegX/0VIvARyPb7zdbLORA7+Rm3su5EpjiKfV16X2WnJ7Cz48Y9HEO1hbcvya9e jQ7Zgfh6L471wYI0RANP7+YS13e1b6M= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-16-Vn4qQFbpPyOjVtFFuaRsWg-1; Tue, 10 Jan 2023 11:03:48 -0500 X-MC-Unique: Vn4qQFbpPyOjVtFFuaRsWg-1 Received: by mail-wr1-f69.google.com with SMTP id u15-20020adfa18f000000b002b129dc55bfso2132577wru.11 for ; Tue, 10 Jan 2023 08:03:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XbOaISPlploGt1778joFsAZkH0/JisRO5CprslAGWp4=; b=zFhYP64lj4z2kTfRJ+XWLjEv/dZoqYxMsXIadDy7HYMSOuvZg+2XxBWw2bQXPTh7aS medrGCAiL/SCEFsly2Ek+a8Q9YllPmR0T984L/xco6b1FqXcOkkhpizSp2wcLU+nwfj1 f928Dxm/wsv7yS119yfSfOc8F1Ato3kdxRdVU2rio+qydOaKa72OOVoj0v5/R5emGC8t wGPL6voa/Q0zW2U+1L9Xwx59pYOhiuP4onN26L4Klzc9r7A6YiwR9JezDIecdsqKZJJL IdUqAraJqDeTxtJ5a6+lnRBQB1KhyXupcwykhmWN2+0ZP9THlKga6hSAYpeSUfwc5V6N lHgg== X-Gm-Message-State: AFqh2koIIs7wPoTf49TYQ0jynbNwSG+WMfUtC8NL+liVg1zINZ5XbrA+ F9dxo5dhA3zeoZNV4+z4uly5DABG2+GSJofUdYd/la/Jhm09qGsCe324MVgW+PpTwRTHo5sJ3o/ Hm1L+3ZTrAlUjlC7P8TvMzcIKASp50k+ltHp3THLhzUICGmp2vJWnb5uHhR596FKIoQo= X-Received: by 2002:a7b:cd99:0:b0:3d3:5506:1bac with SMTP id y25-20020a7bcd99000000b003d355061bacmr50481763wmj.30.1673366626596; Tue, 10 Jan 2023 08:03:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXurB21YXVE/NWG4XCe/m2DVfhKVsSJwjEVdFqJN0TpCrBGmH9P0BB2SzTkIMS4gMvKEnamjmA== X-Received: by 2002:a7b:cd99:0:b0:3d3:5506:1bac with SMTP id y25-20020a7bcd99000000b003d355061bacmr50481737wmj.30.1673366626317; Tue, 10 Jan 2023 08:03:46 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id f28-20020a05600c491c00b003d9bd56e9c1sm14494316wmp.11.2023.01.10.08.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 26/29] libvhost-user: Add extra compiler warnings Date: Tue, 10 Jan 2023 17:02:30 +0100 Message-Id: <20230110160233.339771-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini Message-Id: <737ebf2e697f8640558e6f73d96a692711f548f6.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvhost-user/meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build index 39825d9404ae..a18014e7f26f 100644 --- a/subprojects/libvhost-user/meson.build +++ b/subprojects/libvhost-user/meson.build @@ -1,6 +1,12 @@ project('libvhost-user', 'c', license: 'GPL-2.0-or-later', - default_options: ['c_std=gnu99']) + default_options: ['warning_level=1', 'c_std=gnu99']) + +cc = meson.get_compiler('c') +add_project_arguments(cc.get_supported_arguments('-Wsign-compare', + '-Wdeclaration-after-statement', + '-Wstrict-aliasing'), + native: false, language: 'c') threads = dependency('threads') glib = dependency('glib-2.0') From patchwork Tue Jan 10 16:02:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SLKKvLCu; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrxPl2MDMz23g2 for ; Wed, 11 Jan 2023 03:40:26 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6d-0003bO-0M; Tue, 10 Jan 2023 11:04:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6S-0003Tx-6j for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6O-00057n-Sg for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:03:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J9GluDZMGEQc7BsTewqVDUoFAHAmOZfv8WtZCminAlg=; b=SLKKvLCuG+y3M7epZpqNF4XJIDK/eNVy6+EXi9sHb/tQeWGGq1VAQUvXVuBPjvgirdUVEs XWi+J3FTmWFNXHn+hL5ymN6/D8iTKDPWG2xBDqDSmYA3uUba9uTAkx2/G7y7Sdui2rxhe+ g3HdDjKNdw7YLp4OxdHG5D3e37YvwO0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-266-VAU2YSTROhadifuKbgwhqA-1; Tue, 10 Jan 2023 11:03:50 -0500 X-MC-Unique: VAU2YSTROhadifuKbgwhqA-1 Received: by mail-wm1-f70.google.com with SMTP id r15-20020a05600c35cf00b003d9a14517b2so9219368wmq.2 for ; Tue, 10 Jan 2023 08:03:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=J9GluDZMGEQc7BsTewqVDUoFAHAmOZfv8WtZCminAlg=; b=x9nGq81dpbL5L/mkZK/OrxKYh1eIqjZi2jqE80pH9eegJRSA1Czc4xAr0EUfZUz3xX RR7hvTuGRJp5C2pJ01sYGktj69qlbinI1Z2R1U8vjWTOCkbE74OcL0c/rNNdj/k+5J1n L0VZyE8PtuEtfmbGlWdMcwyKEiGdf2vS+TIsrMp8R02NCkuDlSpT93mfp3ano5gidY89 PW41ITgsvOwMXksOzPpFZZ+yx+wSyJO1aywi+BXJWIaufWsSlcuQPdUzzWBymWEi5yPs bGOkcgtZYPDYXOT5UvAErwNNBSeeVo5iIH6SS9giwPN8ozJDYl+81VhoX/cV3X8anY0l 810A== X-Gm-Message-State: AFqh2kqE7PGxNVsJzFxxc4cCXdLh76oFLEl8Lgm5uEFJOvQhB9egjzaZ yKPVESefr0XNVeaVs/Vpv50boW+T1Q4lhaJR+WcYGACl+ZCkTFc+wYocS372NaZlR0ZWaWW0TwZ TF6aseagT/xG/cTqCJP9c+LoYjbHBOCFyAdJodIvXzKgtpXpQvQf97/Bxf6rDBWiJ7JI= X-Received: by 2002:adf:f851:0:b0:2bc:7e19:fe84 with SMTP id d17-20020adff851000000b002bc7e19fe84mr3906921wrq.62.1673366629284; Tue, 10 Jan 2023 08:03:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXuCbbF6VUWnUl7ydouuYwoI2K/7IxMN3dxrFQMKlITcyAZVQQDsaLpkJQosP2uNmWzZgmiPSQ== X-Received: by 2002:adf:f851:0:b0:2bc:7e19:fe84 with SMTP id d17-20020adff851000000b002bc7e19fe84mr3906900wrq.62.1673366628967; Tue, 10 Jan 2023 08:03:48 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id n6-20020adfe786000000b002bdbde1d3absm1230647wrm.78.2023.01.10.08.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Marcel Holtmann Subject: [PULL 27/29] libvduse: Add extra compiler warnings Date: Tue, 10 Jan 2023 17:02:31 +0100 Message-Id: <20230110160233.339771-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcel Holtmann In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on. Signed-off-by: Marcel Holtmann Suggested-by: Paolo Bonzini Message-Id: <08daa1896ad8824e17d57d6a970bc0b4bee73ece.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini --- subprojects/libvduse/meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subprojects/libvduse/meson.build b/subprojects/libvduse/meson.build index ba08f5ee1a03..3e3b53da33ae 100644 --- a/subprojects/libvduse/meson.build +++ b/subprojects/libvduse/meson.build @@ -1,6 +1,12 @@ project('libvduse', 'c', license: 'GPL-2.0-or-later', - default_options: ['c_std=gnu99']) + default_options: ['warning_level=1', 'c_std=gnu99']) + +cc = meson.get_compiler('c') +add_project_arguments(cc.get_supported_arguments('-Wsign-compare', + '-Wdeclaration-after-statement', + '-Wstrict-aliasing'), + native: false, language: 'c') libvduse = static_library('vduse', files('libvduse.c'), From patchwork Tue Jan 10 16:02:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fb/vBMRD; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrygz1x1rz23g8 for ; Wed, 11 Jan 2023 04:37:51 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6f-0003bs-Fl; Tue, 10 Jan 2023 11:04:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6a-0003ZM-SY for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:04:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6Z-00058q-7N for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:04:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUdyYI941CM9JHfuKD9PKFjZZcimdzGZDdfwkTBzE6Q=; b=fb/vBMRDlysK1lWzgNkv23OYKk9iacWG41FlPOV2cCR8EXSBm5GxqcKSG1T/0NAK6nMFo3 ljOX2WyJr/lvAo1HBZh6xMBX8VNC02/wpjhrOnOuPn6fkZTDN7nIEJFS4Q/lez3jVB3zWT oFn75noL84gWlHIGJ3ICNsOZRzG//7o= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-25-_XrZTs2mOoanQ_CMqkRkPQ-1; Tue, 10 Jan 2023 11:04:01 -0500 X-MC-Unique: _XrZTs2mOoanQ_CMqkRkPQ-1 Received: by mail-wm1-f70.google.com with SMTP id fm25-20020a05600c0c1900b003d9702a11e5so6514052wmb.0 for ; Tue, 10 Jan 2023 08:04:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oUdyYI941CM9JHfuKD9PKFjZZcimdzGZDdfwkTBzE6Q=; b=mOSk/M6nojtirfTOjj8o3+QnxnaxO0R/OigFnHXyacZWWqH9BlygGwOUXXq7Hv5iSK FV3YVxEKvsMmmDdQbSzhR0jJE/Kv2RHn2sCZdtwIxgUwsxINmqcgSyv3C1siFKIUp87C jdEuiI6KULCmv/osSQel4QP/2jHMQAJioV58ie/1vIWVls5cD4ooOkd3pQbBt9ZuO6Tk OkYmpJVcHOebKhouI+zDnjzM6YJ8fFuQoYoMSe7aCfX5V3FRUidiZg45su+DczMJ7fZw 10tDeS4nG5BRpfUREnr0GtRj5Izho7tiur6pKqfeHV8afn4Lw86EqUBnp6FrVlH5qHuP W4PQ== X-Gm-Message-State: AFqh2kpKI1tY0Dykp/sNw+MyDv619jzbSXPIUpVV4Mlw5Bvdz+YZUWog nI7Au1DGRBtNPfrkHRMwYchfkLz3/hpSvuIG5dUr+XBmbAte3wSAOxBCGOUUG/vWJPliwPxXuwz qKcb33p+mdHqYVYV9sUZHAkydr/rh+rvm2nhChelPPiMkHTLf+lJskSIwCrsRKAVA3P0= X-Received: by 2002:a05:600c:a56:b0:3cf:894d:1d06 with SMTP id c22-20020a05600c0a5600b003cf894d1d06mr49585035wmq.30.1673366639741; Tue, 10 Jan 2023 08:03:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3FbZm1V/1gvul7IMQo5sXqyHyJnO6UTBVuUt4v45XQ2v9aFDD8wJo1YqzjL+1RiQhhNxQEg== X-Received: by 2002:a05:600c:a56:b0:3cf:894d:1d06 with SMTP id c22-20020a05600c0a5600b003cf894d1d06mr49584996wmq.30.1673366639345; Tue, 10 Jan 2023 08:03:59 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id o14-20020a5d58ce000000b002879c013b8asm11501129wrf.42.2023.01.10.08.03.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:03:58 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 28/29] target/i386: fix operand size of unary SSE operations Date: Tue, 10 Jan 2023 17:02:32 +0100 Message-Id: <20230110160233.339771-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org VRCPSS, VRSQRTSS and VCVTSx2Sx have a 32-bit or 64-bit memory operand, which is represented in the decoding tables by X86_VEX_REPScalar. Add it to the tables, and make validate_vex() handle the case of an instruction that is in exception type 4 without the REP prefix and exception type 5 with it; this is the cas of VRCP and VRSQRT. Reported-by: yongwoo Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1377 Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 80c579164ff2..d5fd8d965c44 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -105,6 +105,7 @@ #define vex3 .vex_class = 3, #define vex4 .vex_class = 4, #define vex4_unal .vex_class = 4, .vex_special = X86_VEX_SSEUnaligned, +#define vex4_rep5 .vex_class = 4, .vex_special = X86_VEX_REPScalar, #define vex5 .vex_class = 5, #define vex6 .vex_class = 6, #define vex7 .vex_class = 7, @@ -839,8 +840,8 @@ static const X86OpEntry opcodes_0F[256] = { [0x50] = X86_OP_ENTRY3(MOVMSK, G,y, None,None, U,x, vex7 p_00_66), [0x51] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), - [0x52] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex5 p_00_f3), - [0x53] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex5 p_00_f3), + [0x52] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex4_rep5 p_00_f3), + [0x53] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex4_rep5 p_00_f3), [0x54] = X86_OP_ENTRY3(PAND, V,x, H,x, W,x, vex4 p_00_66), /* vand */ [0x55] = X86_OP_ENTRY3(PANDN, V,x, H,x, W,x, vex4 p_00_66), /* vandn */ [0x56] = X86_OP_ENTRY3(POR, V,x, H,x, W,x, vex4 p_00_66), /* vor */ @@ -878,7 +879,7 @@ static const X86OpEntry opcodes_0F[256] = { [0x58] = X86_OP_ENTRY3(VADD, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), [0x59] = X86_OP_ENTRY3(VMUL, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), - [0x5a] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex3 p_00_66_f3_f2), + [0x5a] = X86_OP_GROUP3(sse_unary, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), [0x5b] = X86_OP_GROUP0(0F5B), [0x5c] = X86_OP_ENTRY3(VSUB, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), [0x5d] = X86_OP_ENTRY3(VMIN, V,x, H,x, W,x, vex2_rep3 p_00_66_f3_f2), @@ -1447,9 +1448,9 @@ static bool validate_vex(DisasContext *s, X86DecodedInsn *decode) * Instructions which differ between 00/66 and F2/F3 in the * exception classification and the size of the memory operand. */ - assert(e->vex_class == 1 || e->vex_class == 2); + assert(e->vex_class == 1 || e->vex_class == 2 || e->vex_class == 4); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - e->vex_class = 3; + e->vex_class = e->vex_class < 4 ? 3 : 5; if (s->vex_l) { goto illegal; } From patchwork Tue Jan 10 16:02:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1724190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BpCoqePK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NrxBN5fY6z23g2 for ; Wed, 11 Jan 2023 03:30:36 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFH6i-0003fz-53; Tue, 10 Jan 2023 11:04:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6d-0003bW-Qy for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:04:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFH6c-000596-Dc for qemu-devel@nongnu.org; Tue, 10 Jan 2023 11:04:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673366645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RvLrvX68DfKN3YZTD7gEdtEA0Uk0Gjs9C6nZMEKq85E=; b=BpCoqePKkrLnJXDpp2mp4MGo2KjcpsZJcSKVeA/DoXWXHkBXvJuhereX0zv9avo3ujPk2w uzNMiJSC3X4mn32THY98BxzHMliQORa/CWfeL/X6ytHMVJRrn9fn5ZB+p/yChMNlrXuS57 1O2eMp7BUu4RPazoQItKXuVqtHi+BJE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-644-3MBejfgUPlSBPETGv0I7wg-1; Tue, 10 Jan 2023 11:04:03 -0500 X-MC-Unique: 3MBejfgUPlSBPETGv0I7wg-1 Received: by mail-wr1-f69.google.com with SMTP id l18-20020adfa392000000b002bbd5c680a3so1653254wrb.14 for ; Tue, 10 Jan 2023 08:04:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=RvLrvX68DfKN3YZTD7gEdtEA0Uk0Gjs9C6nZMEKq85E=; b=8DYmTw1sccuj+WAYj78JUzkVDxQmZXEkF/N8zt8wzEfjlODG6RcvdKyctbIUjipoet zxqWJCvt65M5XH+SJONsxF12Z/oyYOzIrwZ2y87nyGLc/DX0BBsMc0+nf/Yji4yjYXXC DeRiaGmoM+s1WxBNhM8DxqVKdBcNbREwNgpq9wSWyooOvhPDfL4sWLm+FrrIxtUCeA9x 8O2b+TenoWtK+Oh//NplzEpep2MkarKk+o7CaFIueqXVUGdM4SwghtHPRfYzPlYa8ELN gsoCx+9q0JuZITQEwB2K8Wno5hkMHdI0M4VJjnh2Z5ysiCGg+ZqwumT7tuN73n5wZcAk LVAA== X-Gm-Message-State: AFqh2kou4lFLC0BhCZGNUOJHsw8eGJqC5o9sx8p8wRNWk0LGeSkrSOo2 JeQYZY3ofeq3XqO1Bj0l1P90Y6TZ9NuiObqmTZCyutvM/Ad/RxNBNyFftMsXPLSUh8Rh8X32mIn y1Ls4t2OeUwf1S6Js3tR9hVxlY7+ZA+dlg8dwnp8jt7Fu3pXDiJ10L5BiodOTuFsiNxQ= X-Received: by 2002:a7b:c3c6:0:b0:3d2:3376:6f37 with SMTP id t6-20020a7bc3c6000000b003d233766f37mr49092205wmj.10.1673366642211; Tue, 10 Jan 2023 08:04:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXvhmtBdWVUR9414m2x4iow0ZgBN/Tdys7PlHq8IMzyGJnPp0Akrhq4qsVHm9r7D/0I+LKZM3w== X-Received: by 2002:a7b:c3c6:0:b0:3d2:3376:6f37 with SMTP id t6-20020a7bc3c6000000b003d233766f37mr49092174wmj.10.1673366641863; Tue, 10 Jan 2023 08:04:01 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id i6-20020a05600c4b0600b003d9e91cd08dsm10225332wmp.4.2023.01.10.08.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:04:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PULL 29/29] configure: remove backwards-compatibility code Date: Tue, 10 Jan 2023 17:02:33 +0100 Message-Id: <20230110160233.339771-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230110160233.339771-1-pbonzini@redhat.com> References: <20230110160233.339771-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The cmd_line.txt mangling is only needed when rebuilding from very old trees and is kept mostly as an example of how to extend it. However, Meson 0.63 introduces a deprecation mechanism for meson_options.txt that can be used instead, so get rid of our home-grown hack. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- configure | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configure b/configure index 203b957a045f..77c77068c7d6 100755 --- a/configure +++ b/configure @@ -2569,16 +2569,6 @@ if test "$skip_meson" = no; then if test "$?" -ne 0 ; then error_exit "meson setup failed" fi -else - if test -f meson-private/cmd_line.txt; then - # Adjust old command line options whose type was changed - # Avoids having to use "setup --wipe" when Meson is upgraded - perl -i -ne ' - s/^gettext = true$/gettext = auto/; - s/^gettext = false$/gettext = disabled/; - /^b_staticpic/ && next; - print;' meson-private/cmd_line.txt - fi fi # Save the configure command line for later reuse.