From patchwork Fri Jul 7 10:36:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700019 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3795877wrs; Fri, 7 Jul 2023 03:36:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlGXatSLypk5ClY/cgzIjBGDvE9HuAuJxyScAUrcYyjbhLWbt9XdqTdsVgcWXo9xInluJwY8 X-Received: by 2002:a0c:f48a:0:b0:636:5788:7722 with SMTP id i10-20020a0cf48a000000b0063657887722mr4056314qvm.42.1688726206453; Fri, 07 Jul 2023 03:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688726206; cv=none; d=google.com; s=arc-20160816; b=LWl947LbdPrAiTmI1LzphTDBBJSL2oFSiYlorw9jU0j1/7E2JKe+FOT9dlDQv9utAb RrwZE6yd3xpSZi3qE2gYimD7BZr32GbJQmpJKj7VS0Qw3vzPbdfqEo+hLPI6Wz+pz9Xk 8pACQFG5UJF4s73wMZsHQ6GB9GN9bRoFo3uFeLJIficomm6AXlNmlLxIqus8YlAPz5SX uKhMuATWQFoPCtacxwx6D+7wsF7PykEo0wNwv8LiBFa2u6dznxtWcKns4pgNP3KvOxNk U3+ZaYIWeQAEbEOBJSQvdhGgSE+xenrntEVLZ3v7jUJ9ZzuZ2OoGPuaMkINgyzCwASAX qLWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=UyAYOyHT5U4sX8M2MRGyOMGKkNeDmSPha7//ljkmPUE=; fh=9wXstK6oSvfva++lTQqnpRkmqL13Y09XkpZFc0O4MJM=; b=pJuLYS555cb+B+iY2pVnqUxl6+EciTQoM+Zgltg+rskWT47y77WW1gDqxofHWQ80Vd Xst8CXen4hNYuP31wF9nmMf9VdFGdadL0wvNSC1weZJ0iWCXlvaBkh6ytNl/DBhmeo7S i2SXdnpJ1ZT/Vxrs247YtTQTk9NRLmlrT5IZqXsC2k/IFzlYY6COlIhGbP2bPEZO1qwz 6w8PvfDEs11pMqLhAELCUOvOcmuPsKG4/B82fBfMKu03M8uM3wslJ83c6uwCJ8y2Md/N 1zrkifBJhqFhgQLXz4b0OEqmKDRfsn8oVXCIIaohi+RCkiGJN7sC9idp+1R1N+0XueYY fDvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mdz9UDGy; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c13-20020a0cf2cd000000b00635d9b0913fsi2434672qvm.158.2023.07.07.03.36.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 03:36:46 -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=mdz9UDGy; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHip9-0001iU-LS; Fri, 07 Jul 2023 06:36:27 -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 1qHip3-0001bb-5Q for qemu-devel@nongnu.org; Fri, 07 Jul 2023 06:36:21 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHioz-0005IN-Fh for qemu-devel@nongnu.org; Fri, 07 Jul 2023 06:36:20 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fb73ba3b5dso2743823e87.1 for ; Fri, 07 Jul 2023 03:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688726174; x=1691318174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UyAYOyHT5U4sX8M2MRGyOMGKkNeDmSPha7//ljkmPUE=; b=mdz9UDGyae2kxQw/TBW32brGAA/qnC6Mbvy7SF91TSllR8ZJrnVgbV0PAumiFBzYjj 7J5u/D8pYC5/afqkOG/3nNbaOO3zQjcPNrS9lFAMbKk5BXVtPNCRyY2a5Vvu6fnrDP0w CPqq8J01cwk7eol8stc8kKoo1WJHvHQZ44JtALdQvlymCROIHHzc7DV3CYdkORz1MLPd 4ICDhDAHsOzOvq61X5yD/2riPpbxElTMx3nFqAz9nGLNRFihOWUf8JYIHQdeR2bdpm8z G2h7de0rccOfRiQTr/z/TYR3ZFj7CNGlTsSuq+q5dVGcSct+uBwtCzXxVTF/ljw1JPq+ KwFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688726174; x=1691318174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UyAYOyHT5U4sX8M2MRGyOMGKkNeDmSPha7//ljkmPUE=; b=Cx7XyzIMtolc7j/240D/2d9HxMqhRFs245iWseiCTtLfBYfuCVmoxfpgdWTVlOsaoV VuBy1TwMm0iEWzI2Dd2cgnKwnJx8XI2H/nXXHw0QBafRkTjrNThaJBBSw5oy8snHmYEH E/F4Y5LaYyloB2aSRYa6n0kZauc2H7+wM01crW5XDCINkbGWF22WOA2sTsI3C4XyMKq4 YAyBLeap8+sIf2rR8je1dy2N8aKGp+ivaXSSZl6AQfoj0Xi6934BmjdstuyYGcGU8uAv iB1ev3cem2Sd8TuebpSeduNRHVJKWkjGZSeeevhSYJSDFdP2DZFBrU7edfSN0KPFEhjS csxQ== X-Gm-Message-State: ABy/qLa3AyzanMefOsuaWXOFlyze4zgGBTZUhpZnA99JixZoX4MReZ7N QIuQ8yonX5B5v5KYFx71SnKpJnJ35DRrsRxLQUg= X-Received: by 2002:ac2:4e07:0:b0:4f9:5a0c:85b8 with SMTP id e7-20020ac24e07000000b004f95a0c85b8mr4198024lfr.36.1688726173982; Fri, 07 Jul 2023 03:36:13 -0700 (PDT) Received: from stoup.. ([91.223.100.9]) by smtp.gmail.com with ESMTPSA id q14-20020ac25a0e000000b004fb953f74d3sm626966lfn.264.2023.07.07.03.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 03:36:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: rjones@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 0/2] accel/tcg: Fix race condition in tb create/invalidate Date: Fri, 7 Jul 2023 11:36:09 +0100 Message-Id: <20230707103611.5906-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x12e.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Changes for v2: Adjust the change to cpu_exec_longjmp_cleanup, which should now survive user-only testing. I'm not really happy with it. I suggested two alternatives in the block comment, but neither of them are trivial. Please re-review, if you gave it a glance before. And if you have any bright suggestions short of "use real exceptions", I'm all ears. r~ Richard Henderson (2): accel/tcg: Split out cpu_exec_longjmp_cleanup accel/tcg: Always lock pages before translation accel/tcg/internal.h | 30 ++++- accel/tcg/cpu-exec.c | 63 ++++++---- accel/tcg/tb-maint.c | 242 ++++++++++++++++++++------------------ accel/tcg/translate-all.c | 43 ++++++- accel/tcg/translator.c | 34 ++++-- 5 files changed, 255 insertions(+), 157 deletions(-)