From patchwork Fri Sep 13 17:26:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 828204 Delivered-To: patch@linaro.org Received: by 2002:adf:a2d0:0:b0:367:895a:4699 with SMTP id t16csp362168wra; Fri, 13 Sep 2024 10:28:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYsS1qfMV5LNchOPjz0fbBCQ2XYmbTupW/mNKaDvSWcjB839KtFQHjJObZTS1ntTHHSx5+zQ==@linaro.org X-Google-Smtp-Source: AGHT+IFpwWp0aQvckHAT+lulIaM3e5/Ke4tpdOSSfYU9OxqRtjaq4dkRuefDqckfEmR4JFzAhVKD X-Received: by 2002:a05:6214:1749:b0:6c5:891b:15d1 with SMTP id 6a1803df08f44-6c5891b1625mr7061216d6.25.1726248531377; Fri, 13 Sep 2024 10:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726248531; cv=none; d=google.com; s=arc-20240605; b=M+9kZyuYUL2oqGaXE+JxcomIKXrf8bCbjoRbYXUx00tJu9DgQvI1GplkJxCe5FlKHs EtYLmGF/M5iTXo+95zS/BuCWrP24ht+BSTJG0YrOSlGamNqET8Zrmb35gYqM/u+ZawbR QrFHS3uHEVRGdVZWS8IaPROXj0xvZ17lDJEKT8LhI53EnRZaHqe3vkPZK52L11e+9Dts W/4sGOmPlVgoE1dIyQeiNEt8dq9ApbbFsd3u8TVPOj+Qju88iPolP58aw15b60eU9YY+ ZZocIuuEyURsRAqxzLQhdY85OrdyuMdiAPMm2x9yVHu3gcTWaQEbvvZjzwM5xta9N4U6 ISWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NUatFApg2Cs5Vc3/hwC8i7ZiRClvTT8CyVvcfUZaS0U=; fh=Yn9Rr5YRWo7nHBEBYPErLs0SzN9tKEIm+tjOgOQtjBE=; b=DVlbIqzGUTPogQiOWY692jcwN2sQComPDZ86QLcf5M8U3uMXRdnCAo/UiNU6rLPT73 +qFvPJGWuaZKySgTb70ym4ZtAyaBE6e1U80KJt8miKN9VhsZzE9BebmQqiXsoQirizlx FHMl8TqVgAaH3YMG7SIB0RFVI+59r4aWSI2rDrK0OsLGCV6ej8CCXYHRZxa109WDpUiH bkw3Z43FyRVNJ3+68o8ZoLQwILZcqy86OS7qLNwkbbvRAr3/X32mCS7LTnqTxc+DipcP UmO286FKKCTF67vUkv6JHYU+xWwD5OPRrbIedhOYxY1Xfo/8Q+wG1XavEgzmaJNPj6Ao UOIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SfV/SHA/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c5343302desi152063916d6.52.2024.09.13.10.28.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Sep 2024 10:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SfV/SHA/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spA4f-00063C-Mo; Fri, 13 Sep 2024 13:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spA4Z-0005ia-4R for qemu-devel@nongnu.org; Fri, 13 Sep 2024 13:27:07 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spA4V-0005tJ-4z for qemu-devel@nongnu.org; Fri, 13 Sep 2024 13:27:06 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42cae102702so10876105e9.0 for ; Fri, 13 Sep 2024 10:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726248421; x=1726853221; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NUatFApg2Cs5Vc3/hwC8i7ZiRClvTT8CyVvcfUZaS0U=; b=SfV/SHA/A0qZKSWMRg0XKzti8Rm2VxvFPzywVgOTHzQPaDL+Or95UrfFUP+2888rrK vGOR8Indmq9N7+tC9rmmas0/pB2uHBXdwdhrsPgH7A9sEGGAtNmwC8SL6xhd3+gm5LBv WZQHnoyS6fVnAHilV6d+jhbSkU9Epb8tOPjsIb/ArnDF4IgGldoZde1AMh6LUN1nasX3 zznNG7Lchfmt6iz8j77PREuV1TidVNGULdiGwBVN+G5sS0XDaXAU+caMEjIeeAZYogk0 MKC8yQPMNRow26lSpd7qmVHv9WecdgrOrFmiR9ZK8vxU4dPSqw/A6kCkEr2uxtjoMHip 8+5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726248421; x=1726853221; 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=NUatFApg2Cs5Vc3/hwC8i7ZiRClvTT8CyVvcfUZaS0U=; b=qsHK3dgbIc5IWLulWvpys6LgvK2rDTHCsYEZhaqxwOccAaptNT5Lxkwagb3D7YbAc3 XKJKM3yt7UjHZ031buzxHjwwY+IcKLW10whSX7+0I3lTiyEj3mjtWZKJgzPCBJ+8MljL BC1KoCmoeSwX3vCixWOceW/YfR4yBh0Xkdhoav6B/L4bBWDrnQulkUoym/HES8BkpO8/ 87AdSOWkzN3vCFPS3Vsv+W3CF5Z8QJ7Rf79IuYM224q5HxtIhrk2UdqgAKUmWH4AUQ+d L134gjpumYqCgFFvW1nW8oxnMmFudm2MoXmqQJgwMp2qi+prWErIWb/+1FbhPgluQpjs H26g== X-Gm-Message-State: AOJu0YwVv9kmq+nIDICyjTtIc6NG2tdUV+6xOzMcuV81ID0ecOgnz/2W 8siZ/j3sJkrFGpxg7nDjrmNsWb7c41tTVEsDpzhan8ek2m0zr68VUl0IXd7YHvw= X-Received: by 2002:adf:cd8b:0:b0:374:b5fc:68df with SMTP id ffacd0b85a97d-378d61d4f96mr2116520f8f.4.1726248420508; Fri, 13 Sep 2024 10:27:00 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd5212asm7864030a12.57.2024.09.13.10.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 10:26:57 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 317965F8C3; Fri, 13 Sep 2024 18:26:56 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , devel@lists.libvirt.org, Thomas Huth , Mahmoud Mandour , Paolo Bonzini , David Hildenbrand , Ilya Leoshkevich , qemu-ppc@nongnu.org, Zhao Liu , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Yanan Wang , Eduardo Habkost , qemu-s390x@nongnu.org, Alexandre Iooss , Pierrick Bouvier , Nicholas Piggin , Daniel Henrique Barboza , Marcel Apfelbaum Subject: [PATCH 01/17] deprecation: don't enable TCG plugins by default on 32 bit hosts Date: Fri, 13 Sep 2024 18:26:39 +0100 Message-Id: <20240913172655.173873-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240913172655.173873-1-alex.bennee@linaro.org> References: <20240913172655.173873-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The existing plugins already liberally use host pointer stuffing for passing user data which will fail when doing 64 bit guests on 32 bit hosts. We should discourage this by officially deprecating support and adding another nail to the 32 bit host coffin. Message-Id: <20240910140733.4007719-12-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée --- v2 - don't manually set based on CPU type, use __SIZEOF_POINTER__ --- docs/about/deprecated.rst | 11 +++++++++++ configure | 21 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 88f0f03786..f7c7c33d39 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -184,6 +184,17 @@ be an effective use of its limited resources, and thus intends to discontinue it. Since all recent x86 hardware from the past >10 years is capable of the 64-bit x86 extensions, a corresponding 64-bit OS should be used instead. +TCG Plugin support not enabled by default on 32-bit hosts (since 9.2) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +While it is still possible to enable TCG plugin support for 32-bit +hosts there are a number of potential pitfalls when instrumenting +64-bit guests. The plugin APIs typically pass most addresses as +uint64_t but practices like encoding that address in a host pointer +for passing as user-data will lose data. As most software analysis +benefits from having plenty of host memory it seems reasonable to +encourage users to use 64 bit builds of QEMU for analysis work +whatever targets they are instrumenting. System emulator CPUs -------------------- diff --git a/configure b/configure index 7f6eb6b331..f376fa24b3 100755 --- a/configure +++ b/configure @@ -516,6 +516,25 @@ case "$cpu" in ;; esac +# Now we have our CPU_CFLAGS we can check if we are targeting a 32 or +# 64 bit host. + +check_64bit_host() { +cat > $TMPC <