From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382395347817.8513152883751; Mon, 8 Nov 2021 06:39:55 -0800 (PST) Received: from localhost ([::1]:36608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5oP-00065z-PH for importer@patchew.org; Mon, 08 Nov 2021 09:39:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5l4-0008A6-M6 for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:27 -0500 Received: from [2a00:1450:4864:20::535] (port=42562 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5kz-00074v-BT for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:23 -0500 Received: by mail-ed1-x535.google.com with SMTP id v11so60832124edc.9; Mon, 08 Nov 2021 06:36:20 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ENOdbTpjWaps6H1BTH69NWFKpPcyVeSjIgQ8RCGKNss=; b=hSiJ+4Aemx0rUvrzQzHgPd7p3v6g7psXhqaa2th5GiAwDwbsTh8QjPI1Ai9HO7lcEr l7viYS2MMEh66k/Wjs7mmduqnMmEiYo/vLfDyN7w/xc+nta8Wa49bbMnFwpQ8LBl37yS dI09kiPzah2vPEKLDoVOgFUY+8IBSSTRgqF6+Xaz5lYm/BP0Ft5n5D/OKR31D8dokfrf XteZOGogedWlUA2omiEWUXTiUXQulJjIFeyW+YE6Dukf9jXos6K8GKDfy8jEYiO2jVEo nWZdVlb0V5AIoQwZ6CeQ5oG+61n4aS75qjEWjSeWEJwTrAUGeN6Qe9/+P9r4+M+qRInr CL0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ENOdbTpjWaps6H1BTH69NWFKpPcyVeSjIgQ8RCGKNss=; b=Uol6ad6C5r/8opPITw5YGp3LeNEH9iwypKmAIhpEft/sb0a3h0WoCtYVl/l9Fp01zi AMkI4STcSfVGKNgUF9wZ+q4NM98WTBWYFFG7kqHmDK0462abv6ydnk6ST0HNA57loNb1 D7AHjlztquAxYBDrF4HhANXs+TtHubof/Nk53+0Nl3HNtfwHlGdCaUuqUFiZ1bcTDTpD 2dxecrMbMrPWVt39NRFiM3DZ/TkVuKw4ZJJPYfzRjCIbWSqvqSFnCBuv4GQBe+U3andf FI0RnkeJxRHrbAfX9ZcXlKMzHgoCSgI4dDovdHG+JYvgx3KqzdXEPY3ZpLEdCzv5n9sK CPWw== X-Gm-Message-State: AOAM5338aO2u2HPjFvex0zX5ZG4wvUDDqpSkgTzY7qFLJyocWG+ryDLx m/EQPgvbNhrM0pYABiuOK5fQRymUq1w= X-Google-Smtp-Source: ABdhPJwvo4sXr96Qal0DWRqrDXiAF8fR8FX/BbXwKeRJHu3UyUKdrVp6YwjbavWueRf4k3JjF21LiQ== X-Received: by 2002:a17:907:9707:: with SMTP id jg7mr298174ejc.533.1636382179555; Mon, 08 Nov 2021 06:36:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/10] target-i386: mmu: use pg_mode instead of HF_LMA_MASK Date: Mon, 8 Nov 2021 15:36:07 +0100 Message-Id: <20211108143616.660340-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382396325100001 Content-Type: text/plain; charset="utf-8" Correctly look up the paging mode of the hypervisor when it is using 64-bit mode but the guest is not. Fixes: 68746930ae ("target/i386: use mmu_translate for NPT walk", 2021-05-1= 1) Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/excp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 7af887be4d..492b777de9 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -90,7 +90,7 @@ static int mmu_translate(CPUState *cs, hwaddr addr, MMUTr= anslateFunc get_hphys_f target_ulong pdpe_addr; =20 #ifdef TARGET_X86_64 - if (env->hflags & HF_LMA_MASK) { + if (pg_mode & PG_MODE_LMA) { bool la57 =3D pg_mode & PG_MODE_LA57; uint64_t pml5e_addr, pml5e; uint64_t pml4e_addr, pml4e; @@ -287,7 +287,7 @@ do_check_protect_pse36: *prot |=3D PAGE_EXEC; } =20 - if (!(env->hflags & HF_LMA_MASK)) { + if (!(pg_mode & PG_MODE_LMA)) { pkr =3D 0; } else if (ptep & PG_USER_MASK) { pkr =3D pg_mode & PG_MODE_PKE ? env->pkru : 0; --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382289312227.0085153881938; Mon, 8 Nov 2021 06:38:09 -0800 (PST) Received: from localhost ([::1]:58570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5mi-0001xe-AG for importer@patchew.org; Mon, 08 Nov 2021 09:38:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5l8-0008Ao-7E for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:30 -0500 Received: from [2a00:1450:4864:20::52e] (port=45617 helo=mail-ed1-x52e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-000752-CO for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:29 -0500 Received: by mail-ed1-x52e.google.com with SMTP id f4so63060828edx.12; Mon, 08 Nov 2021 06:36:21 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iHdXttUuLkFsoOSClyINDmKVq/XLT1QrgFTuJJMJyxE=; b=TBaChHeaIuFEoakPrA6HAwkPFPvxoGykxDzrm+8nf6binySVkdA/zRD5R1uHGAzSgm j3l8cT0abL0f1I3nhkpmRk3fabSOAim2sd2WBcVZjDTHIpB0qAxFkb+wO5Hmzvf15VAD e19aKxoMshdGORclKL+KsFboVKZyhc2g4g4ZtC+m7yze8Bq5UHlBaXrbTrLdo+rtOq1H 2lwo48h0aotHRVqw7Adoc0JVFmgURlCovF3kzrZjcrBt0VF6p8UghWGjrDguUgd60Svz N87rHRUpN/N+tWLpB9f18fz4wV6sx8Muwx2U/aWav4Xcda5jr9ao8TxRLsqnLvJmpqzo ZwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iHdXttUuLkFsoOSClyINDmKVq/XLT1QrgFTuJJMJyxE=; b=q4PsSCf/VnduFpkb2KwmqawISp+U31B1b9SHEDp4NrGgR8t93BzgCrlDBiBmEhLjER KSG9FhEYY1UTb+ce44PgCHJEUsejLyKTPR7sma4uzvDdGYKlsMLo2Yq4v23fDB9a2q+e l14HUypSke9qDQ+L/snLRsCuC+H9FY+0oHUyM0+1nw2L4zs09TmQHu3NB3SAla0wRVAu nDxBxTopvpijxcmCwxcq/FjsvMUyviDTRkYURMJj4eBM/GVjbKnjB/TdjEgHqf67rXM0 ZkVX0LSI9iR4G8CWAPMxlwmhBaQDuAbdr2M0g/mrp6+cvD1+J3LuiUnaQEj3IAKS2JG8 cajg== X-Gm-Message-State: AOAM533UoTjjSZ+4YTIviNsaHIk622APaXN5KFyUY9lSIGd2bf6Dez9M assx4DUMcWKtW1VQG/iM4sccPQErnPU= X-Google-Smtp-Source: ABdhPJwB8sHYJ8pHSMbitol+Yu5J4v3c4S6CLi/1i7CK7IJ7cnai5uOjlbYgRtENr8HyadEoTMPREg== X-Received: by 2002:aa7:c501:: with SMTP id o1mr82394edq.99.1636382180187; Mon, 08 Nov 2021 06:36:20 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/10] target-i386: mmu: fix handling of noncanonical virtual addresses Date: Mon, 8 Nov 2021 15:36:08 +0100 Message-Id: <20211108143616.660340-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Mark Cave-Ayland , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382290785100002 Content-Type: text/plain; charset="utf-8" mmu_translate is supposed to return an error code for page faults; it is not able to handle other exceptions. The #GP case for noncanonical virtual addresses is not handled correctly, and incorrectly raised as a page fault with error code 1. Since it cannot happen for nested page tables, move it directly to handle_mmu_fault, even before the invocation of mmu_translate. Fixes: #676 Fixes: 661ff4879e ("target/i386: extract mmu_translate", 2021-05-11) Cc: qemu-stable@nongnu.org Tested-by: Mark Cave-Ayland Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/excp_helper.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 492b777de9..5ba739fbed 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -94,15 +94,6 @@ static int mmu_translate(CPUState *cs, hwaddr addr, MMUT= ranslateFunc get_hphys_f bool la57 =3D pg_mode & PG_MODE_LA57; uint64_t pml5e_addr, pml5e; uint64_t pml4e_addr, pml4e; - int32_t sext; - - /* test virtual address sign extension */ - sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; - if (get_hphys_func && sext !=3D 0 && sext !=3D -1) { - env->error_code =3D 0; - cs->exception_index =3D EXCP0D_GPF; - return 1; - } =20 if (la57) { pml5e_addr =3D ((cr3 & ~0xfff) + @@ -423,6 +414,18 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, = int size, page_size =3D 4096; } else { pg_mode =3D get_pg_mode(env); + if (pg_mode & PG_MODE_LMA) { + int32_t sext; + + /* test virtual address sign extension */ + sext =3D (int64_t)addr >> (pg_mode & PG_MODE_LA57 ? 56 : 47); + if (sext !=3D 0 && sext !=3D -1) { + env->error_code =3D 0; + cs->exception_index =3D EXCP0D_GPF; + return 1; + } + } + error_code =3D mmu_translate(cs, addr, get_hphys, env->cr[3], is_w= rite1, mmu_idx, pg_mode, &paddr, &page_size, &prot); --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382402960782.2055631473359; Mon, 8 Nov 2021 06:40:02 -0800 (PST) Received: from localhost ([::1]:36828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5oX-0006EE-Ne for importer@patchew.org; Mon, 08 Nov 2021 09:40:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lB-0008Cj-KD for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:35 -0500 Received: from [2a00:1450:4864:20::530] (port=35465 helo=mail-ed1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075V-Tc for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:33 -0500 Received: by mail-ed1-x530.google.com with SMTP id g14so62715793edz.2; Mon, 08 Nov 2021 06:36:23 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IMrzXvnIk1qR4eTEctQSvN46IKqNzDDs2FkRHvk4hDE=; b=fdS6/5x6ivDFv6cxFvBXnHm5qqcSGjHWSzIFfGIZU+/KXgshSdR/ChqSvNgnCnIVlH QxIL8dNiaekF74qRPxAYrXUeJgzjMIgklA7EFO2Ag/05x0DZq6+9NWyeahK8Z0FT8tWe +EgfN8yiXBIYxLh8wJVKbZIMt19H9/WRGlwGnVnlZz+9x99ckWy02HWA/V8m2glHin7I wsnwy6Tun37t3ehMiHeY3wyzr/TWPE3pQeyL7Z5uSwQ2uiaTDbhlu1DwSaAR3nD9S2F0 sjvzyea3OLg7QOHzeQUamaS3hCn33rl8yaKeiLQWn/VdY2FLMDkkjeb85cSB4v0czg+m ZYlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IMrzXvnIk1qR4eTEctQSvN46IKqNzDDs2FkRHvk4hDE=; b=M8LYlWeFx0PdktK045vpKU7rzEDn1fkKY/E/PoTAWKkiL/rT5a6KUJipvrlOuy09QN rplWg46dkjEP52IFtm8YyOAitsHrkIm+PhAMuFTjWJ8SKTZ+OrvkVeXAVW/trSn1P7Ug +WEWAtpiUxmS5OOg7abI2aid7C/n+ttvfT/9R3LDNFmEbYIsSz2hXszIeo47GXb5nV+v glnIosyEvc9OhvUsKZIuuCwcwXBolaRag7BMn6C3TTUXqA88wCsTxHLdz2XYfhfZpWuo 1mNQ8zgMQ+SRZJCvpSmFplr1dseVi3GYj9kTnwJhLySn21TI2LM8SIKstfnT/uvrei/f Rk/w== X-Gm-Message-State: AOAM532WRAwgbVWR1wwFAvr4Q3VagFvWDC4STfGn46an0i7vc3cr+onf h5OBQttfzY1HWT6/84PzNwXFbMIxgUg= X-Google-Smtp-Source: ABdhPJy5+dqop0e+hGFQzKmu/ag6wPftxmd/6haBb1JFeL7P3IFUkNzVWIPfczYXcPHiGYqguYDcGg== X-Received: by 2002:a05:6402:424a:: with SMTP id g10mr104128edb.386.1636382180957; Mon, 08 Nov 2021 06:36:20 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/10] hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands Date: Mon, 8 Nov 2021 15:36:09 +0100 Message-Id: <20211108143616.660340-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::530 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Alexander Bulekov , Mauro Matteo Cascella , qemu-stable@nongnu.org, Qiuhao Li Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382404169100001 Content-Type: text/plain; charset="utf-8" From: Mauro Matteo Cascella This avoids an off-by-one read of 'mode_sense_valid' buffer in hw/scsi/scsi-disk.c:mode_sense_page(). Fixes: CVE-2021-3930 Cc: qemu-stable@nongnu.org Reported-by: Alexander Bulekov Fixes: a8f4bbe2900 ("scsi-disk: store valid mode pages in a table") Fixes: #546 Reported-by: Qiuhao Li Signed-off-by: Mauro Matteo Cascella Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e8a547dbb7..d4914178ea 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1087,6 +1087,7 @@ static int mode_sense_page(SCSIDiskState *s, int page= , uint8_t **p_outbuf, uint8_t *p =3D *p_outbuf + 2; int length; =20 + assert(page < ARRAY_SIZE(mode_sense_valid)); if ((mode_sense_valid[page] & (1 << s->qdev.type)) =3D=3D 0) { return -1; } @@ -1428,6 +1429,11 @@ static int scsi_disk_check_mode_select(SCSIDiskState= *s, int page, return -1; } =20 + /* MODE_PAGE_ALLS is only valid for MODE SENSE commands */ + if (page =3D=3D MODE_PAGE_ALLS) { + return -1; + } + p =3D mode_current; memset(mode_current, 0, inlen + 2); len =3D mode_sense_page(s, page, &p, 0); --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382582544662.3901060856385; Mon, 8 Nov 2021 06:43:02 -0800 (PST) Received: from localhost ([::1]:45146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5rR-0003S3-Df for importer@patchew.org; Mon, 08 Nov 2021 09:43:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5l9-0008Bp-RZ for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:32 -0500 Received: from [2a00:1450:4864:20::52d] (port=41743 helo=mail-ed1-x52d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075K-DA for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:31 -0500 Received: by mail-ed1-x52d.google.com with SMTP id ee33so63596319edb.8 for ; Mon, 08 Nov 2021 06:36:22 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0imeq6XwpJU8H3v5+Ve4y8cLcm+ED+v+MPUZI233d9w=; b=QaZt+YAmBUW5a6MctBpHgI+tY2auSOap1a4K6O5Xgp6F1P8Dt4hJizjtM59eU4hGgM 13QR7ejtjIH3PCesywXLOE41fidOtYTCGnxNuuFu007moCbdrKXaoNomtR2CfIITk240 V2zWMrha+/Bv8Q5HpYtPwLJiZlgBSF/VlpPcU3pMQd64v8CElsmgC+VXD0G0NkxRfS9/ +zuUhHxrJXkSnKaf16LXNjo8Ng6NvNTkTlDt2NBgXW9uGItkVCRdh73cIdGos+XLUbC9 ypWzOHwjO+FQy5pZAMvfeYeO5JJcCqST8br4VQLJR1g8kN97KMwsGuhB5jQXu96X1yhz N3xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0imeq6XwpJU8H3v5+Ve4y8cLcm+ED+v+MPUZI233d9w=; b=dqClLsJhaMFDDH/c7ZlaXyuBwJGeuu7RMysKMKxqM9UgCqNn4MKjqgIwqLE9TMISnK vMnagso0ILXpU/pcp3Yuv40GIxn1dLsWKfpsquae/2CrRW+mQf4XV23xfial31z36T+N uZ8xVz/mFIv2BWdluePIIo25E8Sj7TSAVWqYvr3eM4KD10sgz393l8ssZbV+UQmvECSO f8WfgdOJdU/lBtm7h1GA7i7ZZ2IHf42nfv2CjMc1qflbyVKsU6wGXeVxz0cVSdK0F7Wk 7No53aW1gowAnQtin50MNUepXHmk4Qd/RS5r9jJeS8CzcFb2OV4F74TnIZ3Ld8c7NaqN bKXA== X-Gm-Message-State: AOAM53316dLM4f3shn0rSDN5VyzxlVp6EwOvwNojuCJCghzS+K2zphKI 4ffoXNCY+bGsKzo6cXxXOXJcyinohR8= X-Google-Smtp-Source: ABdhPJzeaGPyaF9QimNp3gyd+1HP+4cT9F5KMP3bTg8bVOVNok4Yw/xoFC6NKWqkZB2JbzsBDW23mg== X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr65088edd.213.1636382181513; Mon, 08 Nov 2021 06:36:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/10] meson: perform snappy test with the C++ compiler if used Date: Mon, 8 Nov 2021 15:36:10 +0100 Message-Id: <20211108143616.660340-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52d (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382584504100001 Content-Type: text/plain; charset="utf-8" Snappy is written in C++ and as such needs to link against libstdc++. When linking statically, this means that the compile test cannot succeed unless performed with a C++ compiler. Do so if link_language is set to C++; if it is C, the test will usually fail and snappy will be disabled. Signed-off-by: Paolo Bonzini --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 47df10afc2..6bfed294d0 100644 --- a/meson.build +++ b/meson.build @@ -197,6 +197,10 @@ add_project_arguments('-iquote', '.', link_language =3D meson.get_external_property('link_language', 'cpp') if link_language =3D=3D 'cpp' add_languages('cpp', required: true, native: false) + cxx =3D meson.get_compiler('cpp') + linker =3D cxx +else + linker =3D cc endif if host_machine.system() =3D=3D 'darwin' add_languages('objc', required: false, native: false) @@ -1109,7 +1113,7 @@ if not get_option('snappy').auto() or have_system required: get_option('snappy'), kwargs: static_kwargs) endif -if snappy.found() and not cc.links(''' +if snappy.found() and not linker.links(''' #include int main(void) { snappy_max_compressed_length(4096); return 0; }''', de= pendencies: snappy) snappy =3D not_found --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382884057209.3824747264066; Mon, 8 Nov 2021 06:48:04 -0800 (PST) Received: from localhost ([::1]:55980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5wJ-0002UA-4O for importer@patchew.org; Mon, 08 Nov 2021 09:48:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lD-0008D9-Kd for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:35 -0500 Received: from [2a00:1450:4864:20::52e] (port=45618 helo=mail-ed1-x52e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075N-Qq for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:35 -0500 Received: by mail-ed1-x52e.google.com with SMTP id f4so63061136edx.12 for ; Mon, 08 Nov 2021 06:36:22 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1YCRO1A9pLbA5hIjXk2sgTpZ9XAfwgfFzZhqTlaxT9Q=; b=N/1XRq5KQdKKKbQfajSeP3Ob8ToQtby10d9b+gMQZC4+AkNlmKOWF/HCjow4/Nm3aI Z4p9sgdilkO2IeZN9fgutSSamAU4AHy1rsSPphZN4kOV/NqWTZpu8zDMsn32b6kbdmgB DxDqHs2dSOCc9RWdne2G3pTTvzZgtWBn66QQC//BSXKtaLrzmS+sbKn4JBl2NjlZpzxu Y2dJnojjLIyaOccXFWL5UdUE1AfQ/gBQTUYh4+GcRODizch461U+l8P9XZ8Bf+mHUyYt fTScgbWrps69meaLIexhDJ+AMK3fpiHBS8uuoOVFEK1iJdlg2t9WUan4OykjqfBKPqLd 6xOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1YCRO1A9pLbA5hIjXk2sgTpZ9XAfwgfFzZhqTlaxT9Q=; b=dgDWkuK6azM3qP/qb/S1xC989y6ybs7vlsC6pl/HgsleZ+NoV3a1oQYwBiKUfUJYBe L08XuvBPU6qRZLl6RemNVm/5oz3Qs+dIpDAEY7sAWaGJBpLs2IM/nfLViVUg/IBu0/xb qqq4335YOfY7vLmwQ2o2jEm13CT+fJrX6+dAsYEpg+X0Da7CvxWEdzf/kp+ICvi2s5jL PvYihG2+2cYBJkmggoohRK90r2swHmyH2/Ip+bd+1DwFevwfqR4bE/eh9JtoJ+/GVUDg s2M68suoCuFGafDvFsA9HXbbZbv2jviC9YfhjepjobHOz2MdGnn03Gvwg3HY6tJOgRuE 0UzQ== X-Gm-Message-State: AOAM530wtIy+0zWeaUsZlWRcOLRL4ooQRij538+c7IyPe6+xsKNt6znx ZJ6WoS033wrLko3WyOcCv51m5/6w6UE= X-Google-Smtp-Source: ABdhPJyN/cx1gqEoOgfr9bEQr0/1CZ4Lrb7/sybqd07b1IeAVPeAusZFHh6f4LHc8JQJ7kXTAPL9pA== X-Received: by 2002:a50:e0cf:: with SMTP id j15mr99246edl.23.1636382182167; Mon, 08 Nov 2021 06:36:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/10] docs: adjust for demise of scripts/create_config Date: Mon, 8 Nov 2021 15:36:11 +0100 Message-Id: <20211108143616.660340-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382884638100001 Content-Type: text/plain; charset="utf-8" The config-host.h, $TARGET_NAME-config-target.h, $TARGET_NAME-config-devices.h files are now generated by configure_file() rather than scripts/create_config. Adjust he relevant paragraph in docs/devel/build-system.rst, and take the occasion to fix a preexisting confusion of *.h vs *.mak. Reported-by: Markus Armbruster Reviewed-by: Markus Armbruster Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 7f106d2f1c..3c05032438 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -464,11 +464,10 @@ Built by Meson: scripts/make_device_config.sh program, feeding it the default-configs/$TARGET-NAME file as input. =20 -``config-host.h``, ``$TARGET-NAME/config-target.h``, ``$TARGET-NAME/config= -devices.h`` - These files are used by source code to determine what features - are enabled. They are generated from the contents of the corresponding - ``*.h`` files using the scripts/create_config program. This extracts - relevant variables and formats them as C preprocessor macros. +``config-host.h``, ``$TARGET_NAME-config-target.h``, ``$TARGET_NAME-config= -devices.h`` + These files are used by source code to determine what features are + enabled. They are generated from the contents of the corresponding + ``*.mak`` files using Meson's ``configure_file()`` function. =20 ``build.ninja`` The build rules. --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382286790645.1248477471952; Mon, 8 Nov 2021 06:38:06 -0800 (PST) Received: from localhost ([::1]:58458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5mf-0001sr-Is for importer@patchew.org; Mon, 08 Nov 2021 09:38:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5l9-0008Bq-UB for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:32 -0500 Received: from [2a00:1450:4864:20::536] (port=46891 helo=mail-ed1-x536.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075j-RK for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:31 -0500 Received: by mail-ed1-x536.google.com with SMTP id c8so46591145ede.13 for ; Mon, 08 Nov 2021 06:36:25 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N5/RbeJzuOI+XKh6jbbQtrcH3k205uQ3u96kbz/WyQI=; b=gIST3+wUREiKTtPQtkHHi5BLWVXLd4sZEqyGDHEkFEvog6DOTjUQ/UmB5DjaL4iOG7 4NFgiEmY4PU+SOWE5zAz0gmC/hjy5YMIISmzVy05CgsCgV3Ezqlb1vNAdTaBJWSHThHY vK7NGF6TfM1uo0SdKlgoEQTZJ7UWxVgRHI2ET3DJwtuhn04Nem09NtIRruQ8UT9QZMQA /lLd8gb78dPjbK8jWvyRYbjtenJ+OvhprQm+LbUPlWl+huInS0D8lpba0+TgvcdgNOf7 yzAOn27I+T70yIHsUb/DIFDQtRnnpkYOr7ArNNVnuxexRcBbpB8my9FatHU63pqJJhqk wooA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N5/RbeJzuOI+XKh6jbbQtrcH3k205uQ3u96kbz/WyQI=; b=njmaXDkwy3zzWJaV/bhFgnZIbUdU5acNoZo9hjKwsR6rENhpSp1wyE3aEBUt+ov/R/ 2eGgw9b51NtqTpoMJs/y9Ms9uxhlnm7jT1gefK1nQVzx84TANvW9+dzUCFsCvhSbZJKx q8NwdpNXn1ROIhr5uA21oX3nGFcgaDJJ1glm2oRXrPMCaV+tiIMxy9UsjIxTjj2O8Zb5 siTk1KtECvH8He6e2MnkwVXNR68GDHO9qbeRinOhdizmXuc/iSO/tVt+IXgWqkN66Zvh vTvBPMFiVX4e/1lf8eCCeIBuixhBQV3Lp5gbUZXf2GKnPPsEKcmmabD3O6+OipyrtK1F hWHA== X-Gm-Message-State: AOAM530UFVCzGtZ1FRWH3nxjeNeqTDOKmL4beyOSrnL1r5O6/uci5L4P i+WapBo5DK4HdBfYuZuw8VEPNZutnOM= X-Google-Smtp-Source: ABdhPJxLN3Z5HuHYmX8QBjH3ESL0L/oKXq8HAdEFfaNvzzBZtZE0js8sO46u1A1skYtfiCBT5t3PcQ== X-Received: by 2002:a05:6402:221b:: with SMTP id cq27mr131430edb.232.1636382182972; Mon, 08 Nov 2021 06:36:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/10] configure: simplify calls to meson_quote Date: Mon, 8 Nov 2021 15:36:12 +0100 Message-Id: <20211108143616.660340-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::536 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382288170100001 Content-Type: text/plain; charset="utf-8" meson_quote assumes a non-empty argument list, and incorrectly returns a one-entry array if passed nothing. Move the check for an empty argument list from the invocations to the function itself. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 33682cb971..369b5455b6 100755 --- a/configure +++ b/configure @@ -3894,6 +3894,7 @@ echo "TOPSRC_DIR=3D$source_path" >> $config_mak if test "$skip_meson" =3D no; then cross=3D"config-meson.cross.new" meson_quote() { + test $# =3D 0 && return echo "'$(echo $* | sed "s/ /','/g")'" } =20 @@ -3908,10 +3909,10 @@ if test "$skip_meson" =3D no; then =20 test -z "$cxx" && echo "link_language =3D 'c'" >> $cross echo "[built-in options]" >> $cross - echo "c_args =3D [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross - echo "cpp_args =3D [${CXXFLAGS:+$(meson_quote $CXXFLAGS)}]" >> $cross - echo "c_link_args =3D [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross - echo "cpp_link_args =3D [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross + echo "c_args =3D [$(meson_quote $CFLAGS)]" >> $cross + echo "cpp_args =3D [$(meson_quote $CXXFLAGS)]" >> $cross + echo "c_link_args =3D [$(meson_quote $LDFLAGS)]" >> $cross + echo "cpp_link_args =3D [$(meson_quote $LDFLAGS)]" >> $cross echo "[binaries]" >> $cross echo "c =3D [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross test -n "$cxx" && echo "cpp =3D [$(meson_quote $cxx $CPU_CFLAGS)]" >> $c= ross --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382397272157.10082765640198; Mon, 8 Nov 2021 06:39:57 -0800 (PST) Received: from localhost ([::1]:36658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5oS-00067i-58 for importer@patchew.org; Mon, 08 Nov 2021 09:39:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lA-0008Br-AS for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:32 -0500 Received: from [2a00:1450:4864:20::533] (port=34665 helo=mail-ed1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075b-R7 for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:31 -0500 Received: by mail-ed1-x533.google.com with SMTP id x15so32097274edv.1 for ; Mon, 08 Nov 2021 06:36:24 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JWahwRqrrpEtyJD8Ih6TbRhDOSQH3TpZiE8QfsT8qT8=; b=qIXrpgOJEOYNz2bfX1GrgtjVQxC6JGg/FAlFs05FTA2x/93dxejiFHXsue2Z7RJcit GnGAhclvnzH5GcgBms57GPHzBDv2DwkKvpjIBiy7Q/EOgeNYzjYkvBDtQo7nSy4F3CCD uiNaKbUraARykiDZp8YrKseSxitMESdgP8PxZrp8fhGW60iEbtdXziB3gApRNfXljNdT coIb/hcBs2Dxq97nw5xlP69auY69LOSo/q04lOSmVCHgjmyRnA7NYgbaFHLDTIBXRC8C W6rIO98Bnmx5PQdZreUt3OYpUKlFaTMKZDZZThOJFbGzVgShZtCGyLzp/zFOx8SD7FK6 kmMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JWahwRqrrpEtyJD8Ih6TbRhDOSQH3TpZiE8QfsT8qT8=; b=zMIBGCWeLVs+0e2tQHyxVSuSqX5sG8KV33gfv3UETvVQDMjthDsv/hjBBJ47s3sZkf Yt5IWf79JxyDoVWX7+D9OwmTiWdUeEU8gA1YX6pkGrj7pScaDUvpD0cllRmf9x8Alkc6 0DnalariwViiJxD9ReOPgFjPQ2V1P911pBkbUSy+rAK9WiD0frBAEJMBplKL6u7BRV8s C4wxhNcXeAkQYBS/2ndXqtfuWzTtFPH6K3tmT+oAGlWnyCzb/viMJ3xwBPCmee1/n2ZC RnbOHv2YPLk9hkjHeeu+pKChBeaj1oyjGoBW6bqpeO65xp37H1uGGoIxIIbxC8n/U6HM wUiA== X-Gm-Message-State: AOAM530aA/sBL8ynmpDQKeWB5YCXFSfl+0OgAsM2KdTcUbDBdeXs5H3/ yxm8nx7UN3Sx9gFfGYpnf7I/PORQ2c4= X-Google-Smtp-Source: ABdhPJyOEuYfq89jHXrSAd4kACfsE346YH/vtEKyTRv2hpefZ43nYYiow0kgFtIesQLsL1UhOf64lA== X-Received: by 2002:a05:6402:26cb:: with SMTP id x11mr78929edd.127.1636382183627; Mon, 08 Nov 2021 06:36:23 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/10] configure: preserve CFLAGS, CXXFLAGS and LDFLAGS in config.status Date: Mon, 8 Nov 2021 15:36:13 +0100 Message-Id: <20211108143616.660340-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::533 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382398401100003 Content-Type: text/plain; charset="utf-8" CFLAGS, CXXFLAGS and LDFLAGS influence the tests (for example if they inclu= de -L or -I options), so they should be kept from the invocation of configure to the subsequent reinvocations via config.status. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index 369b5455b6..d268f59246 100755 --- a/configure +++ b/configure @@ -4057,9 +4057,12 @@ preserve_env AR preserve_env AS preserve_env CC preserve_env CPP +preserve_env CFLAGS preserve_env CXX +preserve_env CXXFLAGS preserve_env INSTALL preserve_env LD +preserve_env LDFLAGS preserve_env LD_LIBRARY_PATH preserve_env LIBTOOL preserve_env MAKE --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382674905612.127956542175; Mon, 8 Nov 2021 06:44:34 -0800 (PST) Received: from localhost ([::1]:49888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5sv-0006dF-JJ for importer@patchew.org; Mon, 08 Nov 2021 09:44:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lB-0008Ck-LP for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:35 -0500 Received: from [2a00:1450:4864:20::535] (port=35471 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-000760-Tm for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:33 -0500 Received: by mail-ed1-x535.google.com with SMTP id g14so62716485edz.2 for ; Mon, 08 Nov 2021 06:36:26 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8MjHHXQH5cShYn+34q2ZsnnB3JWsNf/9pzRJ8KPoVUM=; b=pnHyAqKG9fT7UTiMZdqOiYSo6EFJ0rDqMGcYRe4uFXex3XLJLMIrFqtIYKT3FvQOmD 45+e18Cj3kiStKDfmjGvSyZGTTDC9iODrIWl+MBvfVaex+veA2MH30HKLVvnd7q4yWbf u7fdKXB64D1Kgywl/6/QN46hpb1F90JEO4596m8wr36y3neKiWpa2ITd88StJxqsqyeu +H+7Crn8itc+TwwTTP3YE7lfiTN67iHJITSBvJYFOylnP2QCAmrW0Qp3s9YKczf0fmCy Obw/lIHeykPk74k8nP+Cx/mqhTsQ/To9IiCB2euPU5B6bq+tWsf7E5YkN719HZQY5Z6f H+xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8MjHHXQH5cShYn+34q2ZsnnB3JWsNf/9pzRJ8KPoVUM=; b=bKGxuUxw8HmFO391Vwd8UBwRGN1AHAf9PcQQ7bbUFqPB9x+mvLwPTrKI3IlArEVS48 a9/3ih3cn/EXLkz99d9PGalVtvg4Ofit5tesT6i8odqAfvJAZagMBkqGbvRm1y7IMVwZ dlyk6K/WHSbBt/uIreIYVZA0s3BkQtnBzoMHmn7oKaefZlF8bfpVPpgdElZMe/IE7/Ha KqyDwkBy9rVzm89XRwTXhWvTWufrh7mdaOcFGf3wrmdrfUFlKwU90I1eCqhm1aHKn8C2 gPjLU6KlIwxyq++ovnHjVKF9Z/UGdRm746ZVQhGjKzNvZ0XHCfrMocuIkd+4o1WT1QjV e60g== X-Gm-Message-State: AOAM533zaPDW1VXaFI7JX2PGfprNoxRL0E6ghWShofQcqSdtNXJkzq9E yDjYBGyTA4VK56aaQhgBviPfnzEJCmU= X-Google-Smtp-Source: ABdhPJz3NNjlwHCW6MaUSYHgihzIUDCbXJtaUsDGRJrO0f+YZY5xZtjauou/QIRACPsrUk96eSA7Cg== X-Received: by 2002:a17:906:388f:: with SMTP id q15mr344521ejd.145.1636382184240; Mon, 08 Nov 2021 06:36:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/10] configure: propagate --extra-cflags and --extra-ldflags to meson compile tests Date: Mon, 8 Nov 2021 15:36:14 +0100 Message-Id: <20211108143616.660340-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382676333100001 Content-Type: text/plain; charset="utf-8" Meson (intentionally) does not add QEMU_CFLAGS to cc.compiles/cc.links tests, as they are supposed to be independent of the specific sets of compilation flags used to build the programs. However, the user can still use CFLAGS or the toolchain file's LANG_args/LANG_link_args option to specify -I or -L options that apply to cc.compiles/cc.links as well. This is also the intended use of configure's --extra-cflags, --extra-cxxflags and --extra-ldflags options. For example, if one has netmap's header in a nonstandard directory, up to commit 837b84b1c078bf3e909 it used to work fine to do: .../configure --enable-netmap \ --extra-cflags=3D-I/path/to/netmap/sys but since the test was converted to meson, this does not work anymore. Pass these options to meson via the toolchain file instead of via config-host.mak, since both have the same purpose. Reported-by: Owen LaGarde Reported-by: Thomas Huth Fixes: 47b30835e4 ("configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to= meson", 2020-10-06) Signed-off-by: Paolo Bonzini --- configure | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/configure b/configure index d268f59246..9f1641e79c 100755 --- a/configure +++ b/configure @@ -174,14 +174,14 @@ update_cxxflags() { =20 compile_object() { local_cflags=3D"$1" - do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $= TMPC + do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags= -c -o $TMPO $TMPC } =20 compile_prog() { local_cflags=3D"$1" local_ldflags=3D"$2" - do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMP= C \ - $LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags + do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags= -o $TMPE $TMPC \ + $LDFLAGS $EXTRA_LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldfl= ags } =20 # symbolically link $1 to $2. Portable version of "ln -sf". @@ -286,6 +286,10 @@ for opt do esac done =20 +EXTRA_CFLAGS=3D"" +EXTRA_CXXFLAGS=3D"" +EXTRA_LDFLAGS=3D"" + xen_ctrl_version=3D"$default_feature" xfs=3D"$default_feature" membarrier=3D"$default_feature" @@ -394,13 +398,13 @@ for opt do ;; --cpu=3D*) cpu=3D"$optarg" ;; - --extra-cflags=3D*) QEMU_CFLAGS=3D"$QEMU_CFLAGS $optarg" - QEMU_LDFLAGS=3D"$QEMU_LDFLAGS $optarg" + --extra-cflags=3D*) + EXTRA_CFLAGS=3D"$EXTRA_CFLAGS $optarg" + EXTRA_CXXFLAGS=3D"$EXTRA_CXXFLAGS $optarg" + ;; + --extra-cxxflags=3D*) EXTRA_CXXFLAGS=3D"$EXTRA_CXXFLAGS $optarg" ;; - --extra-cxxflags=3D*) QEMU_CXXFLAGS=3D"$QEMU_CXXFLAGS $optarg" - ;; - --extra-ldflags=3D*) QEMU_LDFLAGS=3D"$QEMU_LDFLAGS $optarg" - EXTRA_LDFLAGS=3D"$optarg" + --extra-ldflags=3D*) EXTRA_LDFLAGS=3D"$EXTRA_LDFLAGS $optarg" ;; --enable-debug-info) debug_info=3D"yes" ;; @@ -1346,8 +1350,8 @@ Advanced options (experts only): build time --cxx=3DCXX use C++ compiler CXX [$cxx] --objcc=3DOBJCC use Objective-C compiler OBJCC [$objcc] - --extra-cflags=3DCFLAGS append extra C compiler flags QEMU_CFLAGS - --extra-cxxflags=3DCXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS + --extra-cflags=3DCFLAGS append extra C compiler flags CFLAGS + --extra-cxxflags=3DCXXFLAGS append extra C++ compiler flags CXXFLAGS --extra-ldflags=3DLDFLAGS append extra linker flags LDFLAGS --cross-cc-ARCH=3DCC use compiler when building ARCH guest test ca= ses --cross-cc-flags-ARCH=3D use compiler flags when building ARCH guest t= ests @@ -3402,7 +3406,7 @@ EOF =20 update_cxxflags =20 - if do_cxx $CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCX= X $TMPO $QEMU_LDFLAGS; then + if do_cxx $CXXFLAGS $EXTRA_CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS= -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then # C++ compiler $cxx works ok with C compiler $cc : else @@ -3909,10 +3913,10 @@ if test "$skip_meson" =3D no; then =20 test -z "$cxx" && echo "link_language =3D 'c'" >> $cross echo "[built-in options]" >> $cross - echo "c_args =3D [$(meson_quote $CFLAGS)]" >> $cross - echo "cpp_args =3D [$(meson_quote $CXXFLAGS)]" >> $cross - echo "c_link_args =3D [$(meson_quote $LDFLAGS)]" >> $cross - echo "cpp_link_args =3D [$(meson_quote $LDFLAGS)]" >> $cross + echo "c_args =3D [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross + echo "cpp_args =3D [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross + echo "c_link_args =3D [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXT= RA_LDFLAGS)]" >> $cross + echo "cpp_link_args =3D [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAG= S $EXTRA_LDFLAGS)]" >> $cross echo "[binaries]" >> $cross echo "c =3D [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross test -n "$cxx" && echo "cpp =3D [$(meson_quote $cxx $CPU_CFLAGS)]" >> $c= ross --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382539494519.8347943236664; Mon, 8 Nov 2021 06:42:19 -0800 (PST) Received: from localhost ([::1]:43214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5qk-0002B5-IY for importer@patchew.org; Mon, 08 Nov 2021 09:42:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lB-0008Ch-Dx for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:33 -0500 Received: from [2a00:1450:4864:20::52c] (port=41744 helo=mail-ed1-x52c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075h-Tf for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:33 -0500 Received: by mail-ed1-x52c.google.com with SMTP id ee33so63597143edb.8 for ; Mon, 08 Nov 2021 06:36:25 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K4e8aZwmBGkLPpGgvBHKgRPMlikqDCklpG1ZfbA/AsM=; b=OTm7jhxRc5hX00H7kxGUYELFDeyaOWXnl9oTem2YLimOlkzbF7fr/tArWdaAsaF3ya 3e1PVG46OI0Kyc1gbtbDRuLiMo1vOPoAxVRH2ycscsdOwkJWFE7UmRGeycoKMiIPKprj ByhmEZSI9qUvu/ZOu7AtrWd69T8fPmPctVoAi5eOacmgG78pnXOY1bDfAgzYTC7/HkPF UbcgUtCMuRESuUGvCDgbH++GzjH6+5zwGHwg1xTO2D7mdaBHurZgXKIeiZSIJ8N9Xa0A E2hzye6gBCnRYxKV+CpkreXkhORZ1d73qoK+H+PERdLkr3q/Zwc3MO/vSAF9TteCgZCG g9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K4e8aZwmBGkLPpGgvBHKgRPMlikqDCklpG1ZfbA/AsM=; b=NsenYNfHoC6yykcrC7HrQjXEzC5OuYs7MOydK/8d67KPVOsRTKfn788Eu0ctB+/1RW t7IGtgrt82n2a53Hw2Gl0jjyOpfOpDiB51XmHruPDQCzZSMp1SG9PvyGjszSLHUOfASa c6Ys0Lv8bGKwJvJqbxsUXQ/5p7qD+CpRsWaytOttGpnweqlMRZrEzQLaAEAomTTxk2LT r1Y/pJLK6GAhqcQdXaANMR7LvgioIObAdG8yVN9Fz4qfy6RXhDsAkXl9ml8W9sXBGvQp jGh9kCWLr8tVriR1Bsy8XVWOv7Rte78eFDqSBBPaOd7wAbbVj6Jc/paQBQLkMaclXwrw kLwg== X-Gm-Message-State: AOAM532VMqye9kSCDKqfrJRteqJVl+SJ7l/mQYRjmgbC6Szpkm/qPPPm dlYaWbH4d64PVWibQUgMsTjLeJ1trsE= X-Google-Smtp-Source: ABdhPJzD1IY56CFeOR1HgKcxBTCjNgbHN0ESXCo/0/QXgPhdLvriXoJaAeYp66UdMQh0eTS3+49pLQ== X-Received: by 2002:a50:fc85:: with SMTP id f5mr168592edq.8.1636382184821; Mon, 08 Nov 2021 06:36:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/10] configure: ignore preexisting QEMU_*FLAGS envvars Date: Mon, 8 Nov 2021 15:36:15 +0100 Message-Id: <20211108143616.660340-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52c (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382540476100001 Content-Type: text/plain; charset="utf-8" User flags should be passed via CFLAGS/CXXFLAGS/LDFLAGS, or --extra-cflags/extra-cxxflags/--extra-ldflags on the command line. QEMU_CFLAGS, QEMU_CXXFLAGS and QEMU_LDFLAGS are reserved for flags detected by configure, so do not add to them and clear them at the beginning of the script. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9f1641e79c..89c1872c3b 100755 --- a/configure +++ b/configure @@ -158,7 +158,7 @@ update_cxxflags() { # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those # options which some versions of GCC's C++ compiler complain about # because they only make sense for C programs. - QEMU_CXXFLAGS=3D"$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTAN= T_MACROS -D__STDC_FORMAT_MACROS" + QEMU_CXXFLAGS=3D"-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__ST= DC_FORMAT_MACROS" CONFIGURE_CXXFLAGS=3D$(echo "$CONFIGURE_CFLAGS" | sed s/-std=3Dgnu11/-= std=3Dgnu++11/) for arg in $QEMU_CFLAGS; do case $arg in @@ -465,11 +465,13 @@ sdl2_config=3D"${SDL2_CONFIG-${cross_prefix}sdl2-conf= ig}" # left shift of signed integers is well defined and has the expected # 2s-complement style results. (Both clang and gcc agree that it # provides these semantics.) -QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" +QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv" QEMU_CFLAGS=3D"-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS=3D"-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS=3D"-D_GNU_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE = $QEMU_CFLAGS" =20 +QEMU_LDFLAGS=3D + # Flags that are needed during configure but later taken care of by Meson CONFIGURE_CFLAGS=3D"-std=3Dgnu11 -Wall" CONFIGURE_LDFLAGS=3D --=20 2.33.1 From nobody Mon Feb 9 05:10:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636382534005709.3247043039495; Mon, 8 Nov 2021 06:42:14 -0800 (PST) Received: from localhost ([::1]:43074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk5qe-00024S-O9 for importer@patchew.org; Mon, 08 Nov 2021 09:42:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5lB-0008Ct-Qf for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:35 -0500 Received: from [2a00:1450:4864:20::532] (port=41750 helo=mail-ed1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5l6-00075v-Tp for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:36:33 -0500 Received: by mail-ed1-x532.google.com with SMTP id ee33so63597353edb.8 for ; Mon, 08 Nov 2021 06:36:26 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id hp3sm8366662ejc.61.2021.11.08.06.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kBbFzC2aKvFfUuOXw3oGZT6SMhzaT5V8dCwIlVesZxk=; b=gjbwb2o/088tCHGlGGqmdLKDBpIYmt76kNHbg30YGPpejp8xunPSxOWhAqUtKV5GTy 88Fo+pdHs8wskbXB6L0cCkAcdnqhE0XU8VSrtsmjlz2bnlXMm/Sccx8vmDUPFnlMCwyB el1Q5/czdj5VPH+rigS6EUeIFbvZA25p29ek8aXCMJ3iu9ioLkXIqKV2v3gJiwqa5Gqb 01Z36MVntfliaar2nbw5lzyCuEMFi19c2pDsXbblRe5QcliMaZyg5jWUhpT6nu4xYcWn s0dTOvGCBMs5NDLx+3zIdIkR1wBa0F5EXv1TSwWlLkzoSULAqyPIi+hh/XuxkAvrwPCK cCfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kBbFzC2aKvFfUuOXw3oGZT6SMhzaT5V8dCwIlVesZxk=; b=jRW+k7GBQVELl3qnWg8L8iC/9A5eAlQrS58pYR1WUYMoG2dT1mPITCsuKsmNXLZT8R AOZOHTdm3OlrCmg2h25snTBquhW5FL2qVfzLg5FwiV5uQu8+089/oPXM0m8UeeWnQ0R3 KhXZg8M8N7m0YsjZrCJY7ziONwCKyA2RHUSsYEO7JMpuVdy+FFsW7t0+J61GfFLQ9II4 bsglSTIupFrsMa0Wmy3zeSSM+YJ3UJqSKBQiYvswzFPlw+Ea3bJVvYmcH/4AIptJ8mDI hUNuve3cQEcUXE4mdsRJvFSiB9A0pYm2Jk/Lvsf/myp0ZHuvRukng3fG3tLsrT7/m1Nf Pqdg== X-Gm-Message-State: AOAM530DN9lXAk7+TUs3LLeDGkRd+LwUhI8DpLdHaEgaiO1pUPwX/h7y xsmqXw2l5bBb1F7M+sFX0Bfu16/wBPc= X-Google-Smtp-Source: ABdhPJzvJaRTpPN2Lvlf1fOgZYeCHXnJuZRpnXUeLKI3m0Dnbjnz4CjFotWp0TjnFGFJfDULlAZxFQ== X-Received: by 2002:a17:907:1deb:: with SMTP id og43mr331685ejc.189.1636382185513; Mon, 08 Nov 2021 06:36:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/10] ui/gtk-egl: Fix build failure when libgbm is not available Date: Mon, 8 Nov 2021 15:36:16 +0100 Message-Id: <20211108143616.660340-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108143616.660340-1-pbonzini@redhat.com> References: <20211108143616.660340-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::532 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Laurent Vivier , Mark Cave-Ayland , Vivek Kasireddy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Dongwon Kim Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636382535845100001 From: Philippe Mathieu-Daud=C3=A9 Since commit 4872a023a59 ("ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl") we get on Ubuntu 18.04.4 LTS and Debian Buster (oldstable): $ ../configure --enable-virglrenderer [...] ui/gtk-egl.c: In function 'gd_egl_refresh': ui/gtk-egl.c:159:13: error: implicit declaration of function 'egl_dmabuf_= release_texture' [-Werror=3Dimplicit-function-declaration] 159 | egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ui/gtk-egl.c:159:13: error: this function declaration is not a prototype = [-Werror,-Wstrict-prototypes] ui/gtk-egl.c:159:13: error: nested extern declaration of 'egl_dmabuf_rele= ase_texture' [-Werror=3Dnested-externs] Fix by restricting the egl_dmabuf_release_texture() call to the availability of the generic buffer management library (libgbm). Fixes: 4872a023a593e6519b272a Cc: Dongwon Kim Cc: Vivek Kasireddy Reported-by: Laurent Vivier Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Message-Id: <20211108083129.1262040-1-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- ui/gtk-egl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index f2026e4b5c..45cb67712d 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -155,10 +155,12 @@ void gd_egl_refresh(DisplayChangeListener *dcl) surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); surface_gl_create_texture(vc->gfx.gls, vc->gfx.ds); } +#ifdef CONFIG_GBM if (vc->gfx.guest_fb.dmabuf) { egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf); gd_egl_scanout_dmabuf(dcl, vc->gfx.guest_fb.dmabuf); } +#endif } =20 graphic_hw_update(dcl->con); --=20 2.33.1