From patchwork Sat Jan 23 18:50:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369450 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2592176jam; Sat, 23 Jan 2021 10:54:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0AY4saI+C6O4hZ1t1Hm1KjA1cgY+8MpBYYBu2ILauust2ce8eibFXR9wbOiDDCDse4aot X-Received: by 2002:a25:f02:: with SMTP id 2mr14383782ybp.190.1611428083227; Sat, 23 Jan 2021 10:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428083; cv=none; d=google.com; s=arc-20160816; b=zIs4/RujiFxm81y6yq5COk0+llCAWLgcajgGWFWXdeVh8vwEGON61rynC5nXbBLIR/ ZP1p2KZJqcQ5FG/Ud3M2tZ1DLc6se3qS3kVTVLiQMPVIM+rjtJ9xIx05i4shuAFNQ7WH EZ6X56P0Qluld1LIHIOpJEm3e2I0isrzrYrG8fLvp6plGQU30bH17FvK6PGyiGWlUNsO IH2mYa/USWW6SAB9ScyRPgXsTPL169aIpNE/8f7Msve//m4G2dgdXAUMBmDeHrxP4vQi VWJR0t0Q+qja93iARr/TmRGnp5BYWsyNcVI5PSy7Q0bv1Qwp56ezvbeavmmVVYovk0MY t5ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=wdBJyG9pvdbY/tWrWdbknFMnMMlRkyr0IIdSlApvTpw=; b=elz/P+i0I6bN/io0R66yRwiYo7+FlvY7TcUE2XolPAIhokkQRb4Dn0UdkYxihDaVJ5 2+wl0k/X70tYLyjEWPohY9gaswK2NUl2GxStnG5A9HWjiYxsEqnxPEQ7hL9BukLB2hNA fBy0OygJMYdJjDTyank5OvFZ6GUFJ3qyW0Ef4sQtuk/ZlJUiKACLK7pFrNKkoerWCdS5 6oksN1a4mUrcWpWyJdqMeUaSFuxB2NSrIcbR+1lyIEPtMPUdyF2V2YF9JuhIHyf4z32i defaVws3yoQqovp7KRtpYIFIocx3ggNb8XCqKG0DzkHuy2B+elNe6Iwh7uy139ISgkF/ C4kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ymwZOQfH; 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 e8si13728077ybp.331.2021.01.23.10.54.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:54:43 -0800 (PST) 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=ymwZOQfH; 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]:36368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O3W-0001w3-NQ for patch@linaro.org; Sat, 23 Jan 2021 13:54:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3NzT-0005Ag-BL for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:31 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:40827) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzP-0008E3-7F for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:31 -0500 Received: by mail-pl1-x633.google.com with SMTP id j21so547445pls.7 for ; Sat, 23 Jan 2021 10:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wdBJyG9pvdbY/tWrWdbknFMnMMlRkyr0IIdSlApvTpw=; b=ymwZOQfHld7DCBVukldRcdmdz9p7bX9JMNNYxbCglSEhb+BcI4dgf10ud6SrBA5StU 8zfvAMcuY9UTz0ieOm0vBRxwlak282Om6Aa25XizmeEqmlRY7c/115qmJoPUv4DlJAOD CvzamhDgJOl/o1XK2/Qe5mnDa28zFiAi8U34d3CSXl+Ru1E+FNIWW2Ko8DC8FBdOb+Ye P/+7dRfpcpkI6EQPkDsFWgYeH3WS5QhpDoLBcTfwSfN5RSRCRor9qOv3t0RyGY8kMoY/ T3oLzNW5C5nEOb9/OOwvXNuyWSHvTfe7CkgXPOR0Z73Own5DPfjzfbrO6c1vvRpFcS76 XjMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wdBJyG9pvdbY/tWrWdbknFMnMMlRkyr0IIdSlApvTpw=; b=FfWe71XCZuKOrZCUFH4m43+SW+L8C+ldnJArAyTviibMsd+AwF12yd3F0+EfUpiapj 3xFGbENesJbHtydUJ4vQfqxKdVFt4k5zj33U0U48PhjUZMQCDQB/mx50vbbYqa/79Jfs pLXHGaVUwB9EHQKicPdqt+5AWHlWx7XZaVKKMrfd+wB0//PeRcDDi7ygs7XLEgpK9LiZ AHeNk26mJibpQpaWKw6x1lFtcb+lPUVDy/q6NrJpVVc4v5OqC7xdAObgiGSps2CFAH7E K1e8ZmKm1YbekJvHjfnhfdaG9tXuuXMbv44evtLjVx43TFAVp3OqklSgxxmS0kt+b1D5 wSlg== X-Gm-Message-State: AOAM530wP5JgHeqZp9FiWhfTll5340oNrYJAgz4X2ZfXvwRNYqDAgv0e yJ6+x7WvBpFMn/JxMl2bX8DhpOkPFYwQDg== X-Received: by 2002:a17:90a:db50:: with SMTP id u16mr12958389pjx.39.1611427825225; Sat, 23 Jan 2021 10:50:25 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/10] tcg: update the cpu running flag in cpu_exec_step_atomic Date: Sat, 23 Jan 2021 08:50:11 -1000 Message-Id: <20210123185020.1766324-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Douglas Crosher Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Douglas Crosher The cpu_exec_step_atomic() function is called with the cpu->running clear and proceeds to run target code without setting this flag. If this target code generates an exception then handle_cpu_signal() will unnecessarily abort. For example if atomic code generates a memory protection fault. This patch at least sets and clears this running flag, and adds some assertions to help detect other cases. Signed-off-by: Douglas Crosher Message-Id: Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.25.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e0df9b6a1d..8053aa3f11 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -285,6 +285,9 @@ void cpu_exec_step_atomic(CPUState *cpu) if (sigsetjmp(cpu->jmp_env, 0) == 0) { start_exclusive(); + g_assert(cpu == current_cpu); + g_assert(!cpu->running); + cpu->running = true; tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, cf_mask); if (tb == NULL) { @@ -323,6 +326,7 @@ void cpu_exec_step_atomic(CPUState *cpu) */ g_assert(cpu_in_exclusive_context(cpu)); parallel_cpus = true; + cpu->running = false; end_exclusive(); } From patchwork Sat Jan 23 18:50:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369452 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2592406jam; Sat, 23 Jan 2021 10:55:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyErVvWn1L5WyRp5cjDV5BvK3z17vzoVShsUWy/ENsCZFm50kE2U3vqaAoAXL4xq8pBGyL5 X-Received: by 2002:a25:7c05:: with SMTP id x5mr14823367ybc.487.1611428111126; Sat, 23 Jan 2021 10:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428111; cv=none; d=google.com; s=arc-20160816; b=Cg+Wg/xtM7mmRNBALOn8H6Fcnn6gTLB1kAn0n9f4byudZMRmf8VwqUbSxlg/qadHZ7 Kaok0D2fQuYw+h0TOxPe34F0uZv184RRDWp1SCK2YjEGaWq7DTaNuZQg+JRBVfBAiL2z uZW1ncG2x+ICQsiWFcym7DOXCnuXdir96k9zegLFI4KKnh7PFcCU3wF2Huv2ulWbfig7 eEFgVHx5XV/evJ+qcjnmV4MRxpvJo8UiegRUvda8h/jqloDLw+gRqG6Uj7gsoP5zOez7 /19vMhjlAl9qRy/IIJWNyjQ7m/AvqpWnWojMZPDlfg76YVPXJoZsXMSESUqk1Ff6gs3/ 8ymg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=+XTAgpbLP+ZIDnz+giRotvFVeNq2GJ4eMelxbBgp91w=; b=LJqjx8hQXStKXOeh7cJ61cHJ1zv6Cw0StF5L/m+h1LBGRa9ackK/rHZ3WZ//cD/er7 6OV6o2SBal3ufa2kDoDX+zfHrh/i07ELQMVrPWcIY+uW8Hj4URSI4ezGNbdyGqppG7b+ uWKGKKgZ1pME32rplVThsI0ICf6+dbm90SmFsJKLu1eBPXrg+DR5C5ly6GwknKdcGx/C nq8XaxegsFyk1DPwtirzVDmkK6wc7YIwyygzrWSaP/EAMipE48tm/Erv6VEJTB25W53h uODtlao8oa1zBYk0m9ltglAzkZuti0NQ0K95Vh4reAiGyDGjZcyHV+ZR/muNDS+Y9vFR R1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZpL8O6jK; 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 s3si13601111ybc.211.2021.01.23.10.55.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:55:11 -0800 (PST) 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=ZpL8O6jK; 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]:36766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O3y-00026H-LS for patch@linaro.org; Sat, 23 Jan 2021 13:55:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3NzU-0005C3-Uk for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:32 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:40828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzQ-0008Eg-LL for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:32 -0500 Received: by mail-pl1-x634.google.com with SMTP id j21so547470pls.7 for ; Sat, 23 Jan 2021 10:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+XTAgpbLP+ZIDnz+giRotvFVeNq2GJ4eMelxbBgp91w=; b=ZpL8O6jKFBCXsgdOQeuNAMYhkiFqPT107HSoYPvbU2HgWcY+uZg5BHHMh7EhTCAUCc HWRh34E7kkcHkaoJCYAWGNONVXUN44lFOPOp3SBw5eb2isE8JNdM9DU8K0BNQhgGG5h3 f6G391lyQB8sNjpzw1BG8UJ97Sy1JhiYeWRo8ltdK96ixSRRMjQ4Ejxq5t6A4JPxNiuK EZ9Ccpi+aV4XTdIOt/eonudFgNLwCYPNnHutd3olZ33UN3nPlI3li1fNyi0AGdepO82D 9bnjJzJwW/qdx1V3RJT8fW6htbQ9+67RmiMz1yU5UyBOD5kIlwtSC0Euxbf0+O5HhduB Lsfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+XTAgpbLP+ZIDnz+giRotvFVeNq2GJ4eMelxbBgp91w=; b=PF1fsxXzD0Gp5sAsacv3CIXqEHbA83z0LlvUzIj3x5KDlkQE3HDG68wQmqS4IVDG/S P8le2GtDLJFFnSViV6BkywsuDbJhaTa/XvYHAZkWyf3NbMStth5UOsMItWCVuYVNT89X DGqp5Gb/hvmUFbw/7YH1koV0wU61RAgBlGQrNdx8fNFrbo5HPyF8zKwqrnZT28lgEGA6 2pY68lgetJiPZVljAaIPQT+jlHUpZK3C44kigzAepYPyP+oUVGcJiIOPyre7DKgVKw3h bIZaZXwudLuzcyQGBmxcwHpW4RjtYKoX9xfsuOFkqKvdg7pQMEOeuyCgGgTdI0ANJ/il eLeA== X-Gm-Message-State: AOAM53069qWs63f4mdLSR8ZWWgkCxCvIrPW/6aaGzvHgzUypVDGAzPj4 qpyheBpIGeOhxqJ42SyXhiCCE9f657K7Bg== X-Received: by 2002:a17:90b:3786:: with SMTP id mz6mr12925603pjb.19.1611427826983; Sat, 23 Jan 2021 10:50:26 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/10] qemu/compiler: Split out qemu_build_not_reached_always Date: Sat, 23 Jan 2021 08:50:12 -1000 Message-Id: <20210123185020.1766324-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Provide a symbol that can always be used to signal an error, regardless of optimization. Usage of this should be protected by e.g. __builtin_constant_p, which guards for optimization. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/qemu/compiler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index d620a841e4..cf28bb2bcd 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -215,9 +215,10 @@ * supports QEMU_ERROR, this will be reported at compile time; otherwise * this will be reported at link time due to the missing symbol. */ -#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__) extern void QEMU_NORETURN QEMU_ERROR("code path is reachable") - qemu_build_not_reached(void); + qemu_build_not_reached_always(void); +#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__) +#define qemu_build_not_reached() qemu_build_not_reached_always() #else #define qemu_build_not_reached() g_assert_not_reached() #endif From patchwork Sat Jan 23 18:50:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369448 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2590411jam; Sat, 23 Jan 2021 10:50:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJydf4QQfZeI0Cj8GEqw7lxFPGS0tbbg3UYzmAk/OH2eB8omaPo596pPZpA9c+dvsa45pPYL X-Received: by 2002:a25:6dc5:: with SMTP id i188mr13933756ybc.396.1611427859247; Sat, 23 Jan 2021 10:50:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611427859; cv=none; d=google.com; s=arc-20160816; b=p/ZqnHQvBoavwPP3fxt5zHcbjrGAXTJz6iHijJAvuEIGsCyGUxV48HeCqOTUrraZbN fxec7+FLOndabyQRIXbtQGprQZ441/xnG3HKWDO27D9Q6G/0D1tx4YBm1nVzDP5hsRrp znKOR91iv+3wqnGsm4MTX6vjOnTgABE2F6LZsydg1a0GFgmd6xcc1izIFGid/uSolqhD 4nXALMdOZvzPpwXee3F+N57KjL7xZ8gpubq8IT17J5e8lTA0zyrfeYbAF2xnMH/hDPIw uZhlfuVTJjxvubf8Z5FYY2HLx06znqKnd4MGZoppBc9kDN6cwEQSg30h2BImoc8ntyx/ SH/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=AwbeW203h18CH5C6eZxAsKhYtBKVyHAGifKiBt07tZk=; b=fugq5pH9dbc+I8tlKBrADqgUzTv51M81tsFs/NEnnvAoLIBBm7X4NN0LzqmPXLtU0X LGkdChRQsOL1KHOkGcrXeTajr7GKPDPnYviWVh3vYbLlNY+Us/qk2IG4u+gwZqYZGMNn yBDNc0pjIC/1BHuHJ5rthANSAab/fZNV9FIO61cvyA4C5F2oB8hcDnLdDnanKfECJJOq uvPQxV6VDo7tFuVb/aRU/fneGcklidlxs5Go8Tf1SI27MEaRDsvAHzf+qC32/JDqFRqK z8U3wnKvBE+ukgg+gVJzFhnDkVP3dJPncH3yB4Pf/IZoyHaUepDIZgvbE7J0gmTGCnfi GUKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j+Mfltym; 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 x63si12074732ybh.326.2021.01.23.10.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:50:59 -0800 (PST) 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=j+Mfltym; 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]:52582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Nzu-0005Er-Nh for patch@linaro.org; Sat, 23 Jan 2021 13:50:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3NzW-0005Cv-Rx for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:34 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:53662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzS-0008Es-JN for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:34 -0500 Received: by mail-pj1-x102f.google.com with SMTP id p15so5850431pjv.3 for ; Sat, 23 Jan 2021 10:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AwbeW203h18CH5C6eZxAsKhYtBKVyHAGifKiBt07tZk=; b=j+MfltymXxIYJDGwPCOntg78SHZw+sPd48mplNPzEBRExGB6tj9y6Vk0kg5v8bjCyP ItsikzL7Wd9P9hyu1pt41eblF/lqybkYgvWGENMwMBSt9CAGYU9auHB0wesXFkbiyPSg Ag47PlP598g/SvcVrvmxQDbWzmS565WG9zC2BwS81NpItOKMbP8zmmq+CItpDZCBwL0x /JiAXb7dWD5qOj4RwNIVcKVsjfbveaWcc7+TiCpZO/oErf5/Ey2E4DkD9W2NE8tkBjfT yowWusLAl4LIFEMg55vEtcBDAZ0fhVIrtCPFzpfXyKzsyf9G8EbJbfTBr0rghvITHloF /URQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AwbeW203h18CH5C6eZxAsKhYtBKVyHAGifKiBt07tZk=; b=Nf3epzmrvMa7yrnTAEa0zDfjJRhR9JbcF5vF1QcxT3MvZ1q1VY35P9gsiQID8if4OT XZusxbJNgOhUtvFxg6SRGNov2S/fcwsjC0KSWfM/3OVhH5OhZq2ARu27gemZ7v/vPZfi 7vtrLWbPHP5uCzVMkTP5/UBVCr5roxBipYGoippZhFoeiCO2YKthplFltfYEsLx9zexJ fH9aabDV9cdhM1T3/QZibBkdEV/Ji9uNkiIcpbBLmV/ndwNCeekoDWQQrYldFNVR6+bl FkwG7RkXb/GoeOSHHxhEjWeTBsdgfMIBvrSK8LPE+jCSh0kBGwSomlM1VDBQJHBQ9pJB NJbA== X-Gm-Message-State: AOAM53013wSjbI73B7m7ULqFIZnUgcZnDvBJzDc0eZr6xyPBVRsJFRvl xqEv5uJ1tRRnp3LAofrLZjjIL4mwd77dHQ== X-Received: by 2002:a17:90a:f2cf:: with SMTP id gt15mr12328096pjb.166.1611427828754; Sat, 23 Jan 2021 10:50:28 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/10] tcg: Optimize inline dup_const for MO_64 Date: Sat, 23 Jan 2021 08:50:13 -1000 Message-Id: <20210123185020.1766324-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Avoid the out-of-line function call for immediate MO_64. In addition, diagnose all invalid constants at compile-time. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 504c5e9bb0..c5a9d65d5f 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1325,7 +1325,8 @@ uint64_t dup_const(unsigned vece, uint64_t c); ? ( (VECE) == MO_8 ? 0x0101010101010101ull * (uint8_t)(C) \ : (VECE) == MO_16 ? 0x0001000100010001ull * (uint16_t)(C) \ : (VECE) == MO_32 ? 0x0000000100000001ull * (uint32_t)(C) \ - : dup_const(VECE, C)) \ + : (VECE) == MO_64 ? (uint64_t)(C) \ + : (qemu_build_not_reached_always(), 0)) \ : dup_const(VECE, C)) From patchwork Sat Jan 23 18:50:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369451 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2592199jam; Sat, 23 Jan 2021 10:54:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9p4Da8n0SyFcN29gOelOtysvrvMkIQtd0Ev3yPJaMMjl/F2aR5HLuxrlEhAXUhwB5oeTa X-Received: by 2002:a25:9bc8:: with SMTP id w8mr14631333ybo.354.1611428086500; Sat, 23 Jan 2021 10:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428086; cv=none; d=google.com; s=arc-20160816; b=M4FBgdLZ2DCwsrABQrJroA/BG9TyrjbNNaKVc4ZIddZhGOkc6iqDilZnpEWowpCAyl KtdSkKUwNmHh2NyHdE1+lUCZMf17nerKDnafTDGd8BeGwtDh4m9N2YXG2lI37XvktkBj qPNSvI8JuZnV0EZh39WLUaxR1l2bU9CY61Rpzae68V4cp0+ROq9/mYsA3NiUAUQ9e5vX 3+bC8brxKIB1KuivFG8FNdtbg6zAdOR/4YmvCRk0rqHeBMP0KsleabYKhXRha6fkWf9+ lQnN62etLPS9kwJ8DFpc2lDNxJ6gI7j/Dy3ncP4Lzd7hju5Vm1hTjf4jplrRbXTZWjaY CqIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=W7GA19BzjsaVlb4cNdmGQMkPm1CutshKMo07MTWHTyQ=; b=m2C7vqOSTZq9jjZaC0j6gVKbRCAIKc28dnwzub1AQ5BYE/QZ1Xs5lCUvVZK5cAz8Xg kCKN1qMEtLKsPhnLv1D6kMGcAOM+oezLQ/hcEftHmmWUpAmf7wDFXslyBsUhmwO9Yx2t lRuDhC/8zekB0uKoAjilxSCSu61QnVE7l5lRuSoZVGw4M6t5xwUIr6wP6W0HZDMwjfRZ owzGcw8tan9J+0jeD0zFFpEaohS9CocL1f7FdzDB+gGvQSCk4RBpU7NMww9yDE0xyRJQ HHNgAEFUvK10sFffVUmFTmudOA8PtXvafrZnP4SS69nULlXiRkrYm9NiUYe/zpuQ9pfs 0l8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wy4HJVZ8; 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 p6si11278446ybo.36.2021.01.23.10.54.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:54:46 -0800 (PST) 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=Wy4HJVZ8; 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]:36630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O3a-00022p-0P for patch@linaro.org; Sat, 23 Jan 2021 13:54:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nzc-0005FE-15 for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:40 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:52524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzU-0008FZ-1T for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:39 -0500 Received: by mail-pj1-x102b.google.com with SMTP id kx7so5856091pjb.2 for ; Sat, 23 Jan 2021 10:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W7GA19BzjsaVlb4cNdmGQMkPm1CutshKMo07MTWHTyQ=; b=Wy4HJVZ8A5QabipftgesTjaJoNOAdfuD7fGQdPqKg0pSu9Y75W6mtFQ+984z3DXHlA CN0gidKTNwVn/5zxgtrzEbueZgWEnJwHke0WCRjhfmpW1H+xM0zK1OywsLw6IZKxv9zA Hj1bhca/EsXYR4BZg8NxATlq4bZss6ecv9dP4BPxl0mCVQRmeocFUGm1BD6O2alcD2WG zr1pWKjWji67fkCH4kk4Y238O1hu4hwMmFLFQB7w5U5t9PiatV9ykL67BsumWJXn6eAM PHAqTceOCoQAyjjeK/NOrMz/pbeIfN8yXaoNSHwYxSR6q1i/bpn15eeC3lq7pn24Ifbw axuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W7GA19BzjsaVlb4cNdmGQMkPm1CutshKMo07MTWHTyQ=; b=SY6gODMERAlnTlz7uL56plj8oSdK+W73NiDYzG4PPFTAlSY0hAgfZWfqQXjM3tmuuf cKdNOTweryJxnbyq66fpqyeywwtL8N60O0ax5YT2y0j/hkjDvo4soXbOuUhr0EOT4g7Q foCZON16bYLtU7sseQT+y4DWXpCZMX4Xt+J94ME1H/6E1s4AGlSbHLjBoDqUcP3CSXQn GAomQD5451Y2ZBteVRqOGKvPmrWA81hUaCSHaUecdRvtACt0Q+l1zbw+AYIwVzQnnzGC bNn9NtLBid06bC773w66Qhjgk/IFLK9AFC+l5zecNb3LAxklL50Qi3HNXM4yWt8zx3IT Al9Q== X-Gm-Message-State: AOAM533AQACCVKYDrlsW7tJBvwCL2RsgXX9oLDZPtMWSJxnsi0jDQiu7 ZQjvEpyQ7yaNLlnOKy0t94N7Oxs2f8j5Rw== X-Received: by 2002:a17:90a:17a5:: with SMTP id q34mr6039866pja.47.1611427830567; Sat, 23 Jan 2021 10:50:30 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/10] tcg: Increase the static number of temporaries Date: Sat, 23 Jan 2021 08:50:14 -1000 Message-Id: <20210123185020.1766324-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This isn't a total or permanent solution to the problem of running out of temporaries, but it puts off the issue for a bit. Make the assert in tcg_temp_alloc unconditional. If we do run out of temps, this can fail much later as a weird SIGSEGV, due to the buffer overrun of the temp array. Remove the inlines from tcg_temp_alloc and tcg_global_alloc. Buglink: https://bugs.launchpad.net/bugs/1912065 Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index c5a9d65d5f..0187de1352 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -275,7 +275,7 @@ typedef struct TCGPool { #define TCG_POOL_CHUNK_SIZE 32768 -#define TCG_MAX_TEMPS 512 +#define TCG_MAX_TEMPS 1024 #define TCG_MAX_INSNS 512 /* when the size of the arguments of a called function is smaller than diff --git a/tcg/tcg.c b/tcg/tcg.c index 8f8badb61c..5110f6f39c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1204,14 +1204,14 @@ void tcg_func_start(TCGContext *s) QSIMPLEQ_INIT(&s->labels); } -static inline TCGTemp *tcg_temp_alloc(TCGContext *s) +static TCGTemp *tcg_temp_alloc(TCGContext *s) { int n = s->nb_temps++; - tcg_debug_assert(n < TCG_MAX_TEMPS); + g_assert(n < TCG_MAX_TEMPS); return memset(&s->temps[n], 0, sizeof(TCGTemp)); } -static inline TCGTemp *tcg_global_alloc(TCGContext *s) +static TCGTemp *tcg_global_alloc(TCGContext *s) { TCGTemp *ts; From patchwork Sat Jan 23 18:50:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369454 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2593162jam; Sat, 23 Jan 2021 10:57:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUIA0s3qeE8Tub5HBfFufAGDsZd5lFcgI5SMB30mpXlMKuhXofAd0m7Q6JNm0SSYkvvoRX X-Received: by 2002:a25:3bc4:: with SMTP id i187mr14202965yba.146.1611428225154; Sat, 23 Jan 2021 10:57:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428225; cv=none; d=google.com; s=arc-20160816; b=EvcS9PlmNLID2Y1Naab0/Sl+LyBE1/Br4UdeaUduiHe+biLk6MAvgO48SyeLm2PfJG 2T5j4sBPhlCrNWrZtrHoHdTfPDj1+HxSLHcjArBvYhpixZTIivm/hJ07kzFV65ssTdsd hWZLgqbQvIEoFVVIoFHF2O5dvt2WRsLoTLfxl3nNHsQ7RP7KRvaqaXlqTpmCun7OM46G xPbl0A9vZVy3AO4C7Gg70Oz4oVKzIHNBnvmrFO8Jc/6CP7IeN4lZGsOFkQ9oCI17cWdI hhItiIy6z5PD5ijh5dZfC9sM23nE9TN9DB7tfesAAj+QT7wl5KSyKlppgvNVxlFL1Rri jGRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=xbLvVOyBGJCgR+9BKQ86TGBEl8Sy1NrA6kmq+fGB0H4=; b=WtTOIu4tXMFTYEcILxinM0i1uXzD8jUklquDxxXy16vJCc7kjvuC4NKEvl88Rjy+i4 FZLBFHcyZfU+4BXgFZdwST7prvzdz4oyJyippTz3wt4YHT/A7MZng+Y8nNSH4a9Njbr/ LxDVvzsFWrPB1d3CN2oJkNw8pbnjse061px7CxKLVNE7ciBrqh4qFmhmx1t2P30/iisu GQeNjBV2wJkENZEMpa1u7+aRCyBvUbwddsZEsP8UlpDEfHqYVon7vkgGk6fXo+/TYxuk 94iHSuyZTZ4fP3kpR70g4haszoDgDLYelgWjo477zHAGG1chbea8aPidZX/aT8y1fn+d 9idw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yT9zLh3g; 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 f6si11351757ybo.149.2021.01.23.10.57.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:57:05 -0800 (PST) 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=yT9zLh3g; 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]:41890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O5o-0004L2-In for patch@linaro.org; Sat, 23 Jan 2021 13:57:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nzb-0005EM-Hl for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:39 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:36588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzW-0008Gu-3K for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:39 -0500 Received: by mail-pg1-x52e.google.com with SMTP id c132so6149643pga.3 for ; Sat, 23 Jan 2021 10:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xbLvVOyBGJCgR+9BKQ86TGBEl8Sy1NrA6kmq+fGB0H4=; b=yT9zLh3gAuz/1TdGh9RkLWHr2FhmHzPGbzYEsVT49Ls/CkcksNhWt4Dj2mF2aA5pVa +jRaTI3FRPSQ9jW39WclGDpRh7zgv2f5EJSv0TYtMxmcRTcjcqOWeSn3Oi/TWLAP6w1K 9S1Dv00bQMku/4X2HBzfi80oOhRJIUeAhoNX8sWkzU04EzoDmsIrLQuLpPOU0lzVKRaS O9q7YY27JiModOI5XpJmjDE9UasIXUN1EBoK+VTAOfP2Xx0s4EJX+RHfLMp8U94htgey NyaVAQBeVSU2FfoUuA8M4wK7n3u+Ta5IdBY027BUBG1AXlODIF/iLNqxacaVNndg1fqs TaxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xbLvVOyBGJCgR+9BKQ86TGBEl8Sy1NrA6kmq+fGB0H4=; b=Nr63nnZyCMwCKrr5I52xncesboEgvk5zYwOa7E5yZ6hC7tsWailPS/MfsLHHNkTzkS Cib0D27vJQGzsRLsdQpuwi9UYCJ8OqcrIh2z9T2YtGZK95/DoDq8LcCJzyE28tFekQMo 2StKoiKh3eWts/5KJGJx5DgMmlI3eZ+WjGLotMWC0ANebKMGZa5/w+HDN8ssFzRMMpnn 5LR/eazvg4qcN4mTyseJtAI/OADYom8PwsXaV2lwNBqICnAwEKJv4+7pkztwcgvKuIg9 LpVQEu2RZjLtsT4aGZZC2WPf56vysg5usEXuub3lXPdm6actyT3YmpkAebi9YT2j0SjF uyHQ== X-Gm-Message-State: AOAM531hutzuG7hkxsaNjiYAgq8cC00YTleUam51JxKr01B3Qm9zbTeN LX7SdwL+oUS1K1M4aDyyWLzn2Sigv22zQw== X-Received: by 2002:a63:b4a:: with SMTP id a10mr10398524pgl.112.1611427832336; Sat, 23 Jan 2021 10:50:32 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/10] accel/tcg: Make cpu_gen_init() static Date: Sat, 23 Jan 2021 08:50:15 -1000 Message-Id: <20210123185020.1766324-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé cpu_gen_init() is TCG specific, only used in tcg/translate-all.c. No need to export it to other accelerators, declare it statically. Reviewed-by: Claudio Fontana Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210117164813.4101761-2-f4bug@amsat.org> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 2 -- accel/tcg/translate-all.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 2e5b4bba48..516013e735 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -47,8 +47,6 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns); void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb, target_ulong *data); -void cpu_gen_init(void); - /** * cpu_restore_state: * @cpu: the vCPU state is to be restore to diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index e9de6ff9dd..ca7ef6aa17 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -243,7 +243,7 @@ static void page_table_config_init(void) assert(v_l2_levels >= 0); } -void cpu_gen_init(void) +static void cpu_gen_init(void) { tcg_context_init(&tcg_init_ctx); } From patchwork Sat Jan 23 18:50:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369449 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2591202jam; Sat, 23 Jan 2021 10:52:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWkEnLwdlOEPBXqpd7a5s9fkW0/oTgBWorn6pghLNpx2t9LzladH/J/t6o+r83uybzLzMa X-Received: by 2002:a25:bfc4:: with SMTP id q4mr14906516ybm.248.1611427955831; Sat, 23 Jan 2021 10:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611427955; cv=none; d=google.com; s=arc-20160816; b=wuFM/afPXFpPFSFWwZpEw1VzR4ZIlc+wXcEBof/wleZAxmN8eAtthaNWPhdNoFH+qN zc7C1j0KLLB7qJLC7cO/kJgWe9dSQAYK66s+wTu+sNBTC1pPXOwWlm/dsKK6hVukkqmR xzQOCRS71m1/SpR93k/TkoBYohDKxgweagIKqHt9eC3+ErukBnSiXOm9byKHjMD+9O4P +jXM3dvFkobsUgy6rXS1BjiLsr94OXF6dfsvg02/yOAmQPA2WMgvqjSILIOfFgYt9hRV pAZDSD0r+FefpESU6pqOI2Ez+wjETzC6sHQlBkNcR+pvEF4B8ODg9QDlrSnr7I0F4PU/ YvEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=UqHrCB4kNK0rhQOAfSyXF5GRntYhHhyAfqhZg0V8bdY=; b=twcTEHiuZzCShujdNmBdPN8TFnz2yUzmBie0xrr0eh+TPD2KI5FXqWZ+mSd8JWJSHf bK0i2b8e+sEh748TW0fhUnI9+pDhKVhlbZGWrhrAaHQF1+4ax9/XyXihZ7sKi8x762Mj LkRkAK0I1urN7ycYXslsedqd1TkYdyi0OQN1WigNdfCxfJaAsVHNDBOtJGJdPA9oOn+K k0sWTt5wg+C4iYq131XWmesu/L16GXIjq3KCSJUbNUQO8Nu/HfRBRY/GXzMRd7DkI34T H8O19PfdTmoUSuRY9SsO1Y7B//JEtkHpgeDBJRMA9pc/CkV1Cw25nQUJPstWNAZX4wH3 wPVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jMNXWj6T; 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 i17si11573866ybk.188.2021.01.23.10.52.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:52:35 -0800 (PST) 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=jMNXWj6T; 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]:57826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O1T-0007VD-BC for patch@linaro.org; Sat, 23 Jan 2021 13:52:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nze-0005Kq-B4 for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:42 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:35946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3NzX-0008H1-LX for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:42 -0500 Received: by mail-pf1-x42a.google.com with SMTP id u67so5963317pfb.3 for ; Sat, 23 Jan 2021 10:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UqHrCB4kNK0rhQOAfSyXF5GRntYhHhyAfqhZg0V8bdY=; b=jMNXWj6T7cZseMzBnOPaEaltvnEvQwRlYI6uoqAqmjMEmJ7SLx4I+QiHcDB3fVO47N 8JioZzw/phU31w0owSLSPUtppOXLeiQ+qJ6yuMoKTsLoyTBPxzvyEtMFVVNuK8x0efTp S3tMyM9XWnjy3xrLjlnIB1QiiZn5D8sbDSM86RjCt2gHsxuoh4DjlcCu9o02AesnVmSe MQ+6KJztbBRJIFVk5KicYTLqcDV/yctx+yPwOHqkjzShVvJjkZOTvy1oX4fk4DvSZ+ip CUFTDt4fQjrvVVg65p6oKfHqIvaOFnD4Samr7pGOU1ys0BQuR3hf7oqamDRcDDfoQqaY pLjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UqHrCB4kNK0rhQOAfSyXF5GRntYhHhyAfqhZg0V8bdY=; b=sUvMe3Tx4WaUCQpoyeQBaaudOhT+zuadc1kuCE9LV0l2W2Pvcgyn3rM02WribuJFDL 4P5GRgDJ8i3W23L1tlqRROi+F6KewqOiybYKFztRJ42aq5CLf3o0phlYMBTgmHaNZegv yM4qxyGv41epk4N6ZzvOPf2KKJIZ3CQ53kE7EzjkvcODNsa61Ncy7CKPToKCenTsZjel N7XBF8kwq7e4ATC8kPjRGER31iYo4M9xrnVtdunUpODr/hchHwYI04Olo24j/r3foiRh DrK8D2U1RFWpuNV4sI5x6J6SFw3Ruyu3JmVMZh/k0YD+xZzOwaXxe9m7Szw2/w+5qZWF Z5iA== X-Gm-Message-State: AOAM531LItkzdP48jlAu7uxO3aFu6yoCKal44tHCruu4dv7o3V9P7Z2r uwV/gdIG5puvehXs68z3nSmsm+w27vR7zQ== X-Received: by 2002:a63:1602:: with SMTP id w2mr11035870pgl.128.1611427834009; Sat, 23 Jan 2021 10:50:34 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/10] accel/tcg: Move tb_flush_jmp_cache() to cputlb.c Date: Sat, 23 Jan 2021 08:50:16 -1000 Message-Id: <20210123185020.1766324-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Move and make the function static, as the only users are here in cputlb.c. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 3 --- accel/tcg/cputlb.c | 18 ++++++++++++++++++ accel/tcg/translate-all.c | 17 ----------------- 3 files changed, 18 insertions(+), 20 deletions(-) -- 2.25.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 516013e735..1e3e7cf8e7 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -663,9 +663,6 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr, void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); -/* exec.c */ -void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr); - MemoryRegionSection * address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, hwaddr *xlat, hwaddr *plen, diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index ced3dc077e..0fa1643ed3 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -25,6 +25,7 @@ #include "exec/address-spaces.h" #include "exec/cpu_ldst.h" #include "exec/cputlb.h" +#include "exec/tb-hash.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" #include "tcg/tcg.h" @@ -97,6 +98,23 @@ static void tlb_window_reset(CPUTLBDesc *desc, int64_t ns, desc->window_max_entries = max_entries; } +static void tb_jmp_cache_clear_page(CPUState *cpu, target_ulong page_addr) +{ + unsigned int i, i0 = tb_jmp_cache_hash_page(page_addr); + + for (i = 0; i < TB_JMP_PAGE_SIZE; i++) { + qatomic_set(&cpu->tb_jmp_cache[i0 + i], NULL); + } +} + +static void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr) +{ + /* Discard jump cache entries for any tb which might potentially + overlap the flushed page. */ + tb_jmp_cache_clear_page(cpu, addr - TARGET_PAGE_SIZE); + tb_jmp_cache_clear_page(cpu, addr); +} + /** * tlb_mmu_resize_locked() - perform TLB resize bookkeeping; resize if necessary * @desc: The CPUTLBDesc portion of the TLB diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ca7ef6aa17..5bd0e267c8 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2461,23 +2461,6 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) cpu_loop_exit_noexc(cpu); } -static void tb_jmp_cache_clear_page(CPUState *cpu, target_ulong page_addr) -{ - unsigned int i, i0 = tb_jmp_cache_hash_page(page_addr); - - for (i = 0; i < TB_JMP_PAGE_SIZE; i++) { - qatomic_set(&cpu->tb_jmp_cache[i0 + i], NULL); - } -} - -void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr) -{ - /* Discard jump cache entries for any tb which might potentially - overlap the flushed page. */ - tb_jmp_cache_clear_page(cpu, addr - TARGET_PAGE_SIZE); - tb_jmp_cache_clear_page(cpu, addr); -} - static void print_qht_statistics(struct qht_stats hst) { uint32_t hgram_opts; From patchwork Sat Jan 23 18:50:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369456 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2594807jam; Sat, 23 Jan 2021 11:00:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAskpPtFqTshXnM27i9eE9SD1pnRgRPT8axj8jhZgFJcrahKvDrXVlZ55fZxO52IS+aXLg X-Received: by 2002:a25:c6d3:: with SMTP id k202mr14568704ybf.284.1611428439173; Sat, 23 Jan 2021 11:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428438; cv=none; d=google.com; s=arc-20160816; b=Acdsu1fJUn7LrFDLhbMJvXbBOVub4T5K3Qwx33NSY/nvjHzGAtvN9WJUOFPsYWCHjC syK1dm0zu/BOffHCqBfo2rKFfTlJaABBTKfldu4jYo1gzdyalFtnvZmGxyu7PKjvdpnS Bynav3JPunMqbVbEuvL/Eu1lPu8Zw9LKnGHoUbRG3kpaNNSN2SHCEO02p5gTL/kMcMYG 3TbWTUjmJpHSQhd+vg8gxpB2i8uan168s413C4JptLfSWaWnVRBJ4Y+0rJ88qHq6PbkO FIIFL0TifWPXkp8bMrfkCefpRwVZEhXFAJ57dC19SOTbgu12GwWL7r781pH3r+LnB40n yCog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=w2ogJZM2za2je2RMQYG7Dr+ReH/Y4veEnOKOQS9UGe4=; b=xkFxhgAtpNejon1GM7QxyMSwOExZcJ36Dqvb3iBZa79cCYQAi+UlVy5+/vyu8GDvul 9F6lhpZz9LMGAhso2ux63tChFVYmsmiyHajZS/Td39sy92FNFxYaT9yETfb6ozKKQ3JV hztiqcoG0aLEPp3xwPHh6ybnlJSeEcDRheUhaYuwGwr5Tw7dyptXL/1jXEPfx4WSt7f1 lZgpZQ+Dwg/HK5wsBzAbxJQQVRyvrPAW242xGQf4dCOyveUKC3Nh0akKvQzGT0zxhkdF JUOIHa8znpT8NOabB5NsKrj0TZ982Not6E4xkcGeOLsSS5fEXmIfth0LdA6V11D8CeZn gQsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+EOdmZo; 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 n13si11465040ybd.59.2021.01.23.11.00.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 11:00:38 -0800 (PST) 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=m+EOdmZo; 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]:49650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O9G-0007jA-7M for patch@linaro.org; Sat, 23 Jan 2021 14:00:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nzd-0005IW-9i for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:41 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:34576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Nzb-0008HK-9k for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:41 -0500 Received: by mail-pl1-x62b.google.com with SMTP id t6so5178814plq.1 for ; Sat, 23 Jan 2021 10:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w2ogJZM2za2je2RMQYG7Dr+ReH/Y4veEnOKOQS9UGe4=; b=m+EOdmZoPA3eICWYfZm1TMpZm/KfhM6x5cUIsxv82lNzKtam6uy405M1rWo6Ts82mb 1zmdG43W+DB/H8tlp5xUL8JQxeuSv+u91HsE2mf5aFJ1jic8xd0adusRHYpa8TJNetUD IjL6KpDsKajMG8LwcK3wrqfK0MjlPtPk9y9HILnpKPGDuVMRnm8dNihn8tC2ZY1Su8w1 NMNnIOHtYJhgGDk9EaALnDpk0XptFgfXB0IVFXWtwPgtCYpGO4cG4xjfYlQzOeV5NjfN VuCTlOVN9TX3kEERHosmv899S7eakF6CmMeGqHoWfm/qGV/Z9kImmN6PN/Y/yNRSG9GK gQJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w2ogJZM2za2je2RMQYG7Dr+ReH/Y4veEnOKOQS9UGe4=; b=sx0jIUIlb6of6tCicF0mu5NabNSfOmoFSaBS3sMymXezlnCWdFQt/xA8WBf3fFfcjV KJrTab+d7eBwDVIEbuWsVDBPR/ikZs38+9+WMOtzpGr2jx+IBoC5wNphkRg/vBJ3oFfT P9cYg+lPF0dyHPyvkrDou+EkTww9Cmd/WLZbC7krmcJnKWXThH2MrByX0RsGRMJWKJvc MpZHtVwcKjafjoXdxFdsZ7G/0UvSgbrHlYI798Fk3yZGwDHXc6lvkw1t1rHq6IB2hEE0 CoFX0z2aN7HALl6guuDM2QuCIiimlVGAbtDjsJ4SGV+WKT89Yd/geYEHCchd7HApOkWS 2xiA== X-Gm-Message-State: AOAM531oE/midlPmHXQj9MrxXsGtF8X9Kfau5/TloZap0NOIAEhvql8/ MbyRAbgswId/m1VX+kzPqj/jzSLID5TIyg== X-Received: by 2002:a17:902:8503:b029:dc:44f:62d8 with SMTP id bj3-20020a1709028503b02900dc044f62d8mr987366plb.34.1611427835769; Sat, 23 Jan 2021 10:50:35 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/10] accel/tcg: Restrict tb_gen_code() from other accelerators Date: Sat, 23 Jan 2021 08:50:17 -1000 Message-Id: <20210123185020.1766324-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé tb_gen_code() is only called within TCG accelerator, declare it locally. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210117164813.4101761-4-f4bug@amsat.org> [rth: Adjust vs changed tb_flush_jmp_cache patch.] Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 18 ++++++++++++++++++ include/exec/exec-all.h | 5 ----- accel/tcg/cpu-exec.c | 1 + accel/tcg/translate-all.c | 1 + 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 accel/tcg/internal.h -- 2.25.1 diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h new file mode 100644 index 0000000000..06b341fceb --- /dev/null +++ b/accel/tcg/internal.h @@ -0,0 +1,18 @@ +/* + * Internal execution defines for qemu + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ACCEL_TCG_INTERNAL_H +#define ACCEL_TCG_INTERNAL_H + +#include "exec/exec-all.h" + +TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc, + target_ulong cs_base, uint32_t flags, + int cflags); + +#endif /* ACCEL_TCG_INTERNAL_H */ diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 1e3e7cf8e7..3acc7c2943 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -64,11 +64,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit); void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); -TranslationBlock *tb_gen_code(CPUState *cpu, - target_ulong pc, target_ulong cs_base, - uint32_t flags, - int cflags); - void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8053aa3f11..37d17c8e88 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -41,6 +41,7 @@ #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" #include "sysemu/replay.h" +#include "internal.h" /* -icount align implementation. */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 5bd0e267c8..73fef47148 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -60,6 +60,7 @@ #include "sysemu/cpu-timers.h" #include "sysemu/tcg.h" #include "qapi/error.h" +#include "internal.h" /* #define DEBUG_TB_INVALIDATE */ /* #define DEBUG_TB_FLUSH */ From patchwork Sat Jan 23 18:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369453 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2593095jam; Sat, 23 Jan 2021 10:56:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDrjFXp9LWOKNbWQpZK2XFZNq1pNefUQlCkukxN/NRCEjljvJtkNtG/8t/fAuLJq5zm6XJ X-Received: by 2002:a25:c50a:: with SMTP id v10mr14587562ybe.276.1611428215656; Sat, 23 Jan 2021 10:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428215; cv=none; d=google.com; s=arc-20160816; b=n5mFBX5bMtb+T/L6s4TnZTkXs5bs6EMx98Ye1DEVUDCXb59MXKSoIXO+Kiou5qln8p 00Me3L08rbXv9u0aZPEsn4IClt50Doa7Z8/nRSPq6Q1MgdaBA6bpkZglXt79YXigUhHG 4nmzYXIuxSmcO6LyWcyLozQWP5iqLIhkjrz7FVLuOlZDrAlFNDW2eY0KcEE6GiKZP4rh 6IUKmpULon+zlO7t22eTLu7xbg9TsB5Ixg4UY1ERkB+FoB8QUyxVs5Kh456CWaPv88cM jAYHTZe0yYqsEt4Ig6zJqmJNMxvtY30UMxWaMy/gIdNLExbKizo2uziUsjfk0c5k1qMz MYzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=JMOpMnB2EIi71uPv++zJqhVu0CRBzaOh+TyvyTqEpP4=; b=vW4XQH5guhdS4mRF+volYLmi5+kgrOztaZ5P8hnD3FRcYOqxZ1b37G2oSBnvdd8BYR Ap/kZ+Ul0sJq79BLh/ndQJmOBXgr5UE41FCDtJ8jRoHI5Wr281ZUp5+23gY79Ot49yMf QK+hRVqtog9LRUAcXuU2my0W3NqkiLOgpKWCXby0tHT3T1PGML1i190rr6rIuAPl2+fV gErdh31N9l3nmE2Ks7uKwQ1PCTegLR/82sltbbKqdN05Diltw9w9aQ8WpowyUQadqUo8 WGAyhIKKnJyEvjvStvI0AcBXXwsGBVdasWYMClvuH2KuuB9Wq3HPY0S6qV5038AvC0Du uHzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qpe+hYsD; 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 j18si10554219ybt.68.2021.01.23.10.56.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:56:55 -0800 (PST) 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=Qpe+hYsD; 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]:41766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O5f-0004Hd-5K for patch@linaro.org; Sat, 23 Jan 2021 13:56:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nzd-0005Hn-2e for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:41 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:32960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Nzb-0008Hx-9H for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:40 -0500 Received: by mail-pl1-x631.google.com with SMTP id b8so5180547plx.0 for ; Sat, 23 Jan 2021 10:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JMOpMnB2EIi71uPv++zJqhVu0CRBzaOh+TyvyTqEpP4=; b=Qpe+hYsDUnN7hD8gUuwcBxbSZmd3H8KlL6lX5WxrSee1LohaeWZzuXCyzhomdzHBYG n+3XO4XpFh61DWI0rwNuf3W3STTt5jGhHT0cWGa/jMsXSHfvNXu7BxXF6Q9jOWT/sd/2 Ks8weu1RGsejYnQoCfuDweVlRugS17TgdIQmBipPLgrYFHn2Zcyz3gGKbisphrIYd5ce B7yzm6b593oYc8NSdI8p+NkJUW2y1FgBVYz6fRe5LXbkk3vy/4AGZEFszf6lcont4Rwf qltt+dB9e7eeQYizHbKllVIWKIZ7KtLPt0bphrItweqHHDU0O0IyhPrYNj4caFuLtdO6 S5dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JMOpMnB2EIi71uPv++zJqhVu0CRBzaOh+TyvyTqEpP4=; b=eTHNKYaJEPKcRfmMFHWuubiUba/U/zq+C0wb53gZeFPAT5efiASiKZLgsQrdIvz65G hGaM9zlYEYAxXvs820gaoif0dD287C78W1UUsOCk1GvlfF2ytleqM88vYUQqHevvrEd8 cAL9wTUdlJI7gjBe3tS+AVNSqh9RNTTjRvez3XG5l6+AJgqOJASJlJ22B2lNyPBaRZ+G vd+XePGdXqAj5vSdzNmdD0UPa6KWvmKlRQfQN0adgSIOsnsynVgWAz2xAo1lq1TC6+VQ shu7ee8qL8BMNi5WPKMLuYWj1sgXpwLUFZVQt62WBfKuT2d1Wa4YN4YUoEiXkUZ5QEsx 2dbQ== X-Gm-Message-State: AOAM530n6j0WX0J5oXONCziO/e7NfziYpCoPEb6Fc8Jzp/vFZ7JobH5i aQxa8K4gSx256y2nVtiQDHbYWuEwJ7/oWg== X-Received: by 2002:a17:902:bd03:b029:df:cfe6:3444 with SMTP id p3-20020a170902bd03b02900dfcfe63444mr1677681pls.24.1611427837456; Sat, 23 Jan 2021 10:50:37 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/10] accel/tcg: Declare missing cpu_loop_exit*() stubs Date: Sat, 23 Jan 2021 08:50:18 -1000 Message-Id: <20210123185020.1766324-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé cpu_loop_exit*() functions are declared in accel/tcg/cpu-exec-common.c, and are not available when TCG accelerator is not built. Add stubs so linking without TCG succeed. Problematic files: - hw/semihosting/console.c in qemu_semihosting_console_inc() - hw/ppc/spapr_hcall.c in h_confer() - hw/s390x/ipl.c in s390_ipl_reset_request() - hw/misc/mips_itu.c Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210117164813.4101761-5-f4bug@amsat.org> Signed-off-by: Richard Henderson --- accel/stubs/tcg-stub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.25.1 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 8c18d3eabd..2304606f8e 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -28,3 +28,13 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size, /* Handled by hardware accelerator. */ g_assert_not_reached(); } + +void QEMU_NORETURN cpu_loop_exit(CPUState *cpu) +{ + g_assert_not_reached(); +} + +void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) +{ + g_assert_not_reached(); +} From patchwork Sat Jan 23 18:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369457 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2596501jam; Sat, 23 Jan 2021 11:03:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCj+IqcVhUofeoWKaPeBZb64Yy//XjI7f/ne5w9fP2NNSLYyZ/ooNqsRsmSBSK64JpMGV1 X-Received: by 2002:a25:4984:: with SMTP id w126mr14620697yba.391.1611428600295; Sat, 23 Jan 2021 11:03:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428600; cv=none; d=google.com; s=arc-20160816; b=Y07YCMMTQ2YdwnMTJ0i0g+r30R3R7gCPHEKnwCi7vv8opYa2bQrJVZpRKzR9l6rpNc p1X1XL3QF4bkBb9uDLGP1Sq4AAypeMv7ldycRSTsD22w4VEt21SI5QZMlNb4J1nur3gz yyCbca6CmNPAIAETXyuTXwJbA2UgS78Ktq5CrDwGHpKXb0tPC8z79S5gjH0yUAMXhixq BUpRQd3Row5Cz/KE6wA4KipMt6nR8Kv5hamEOnRbOe4usefax7S8RV42aK9+4RRY9i1u sIjB6MojCd6pZk3kp2ZNsaBDs0TULoKKrbFNg4F9NcWlg2NdOPre8d5u30gaVXPlljri uMqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=1GmBs5ay9uV9kxOX2oWB2tt33ICLoNCCnlqJiSZlo34=; b=xcnHjKhTRT8APDUlg6ZClwyRGNYsSrgfCttUBL/GtyfIwB9LB0hcLFznpZT7HPYzUK k3UJTDv4b79kng8UwJTWV+TTkFBbz3cQAuhBVrMR0WMvN+xwEynUESUCZ8LTpjKcOIf1 SAP9yS+fwXTBtH+rs8FzNfGun8mEnCcZj5RZVY1x9SdmcxduwxLSA+14bVZ5iRf2NfoB Aztzl8+XJRgqr1UOnDtIdtPyMojyetMelqd04yqEPHHXjNOzuPlHobYbvjv+TD0ZpVjp eSfeFR/NDpqcHROTUAJwaEH4F7Dnnw+EFgCbGIszz7C17YNrEkH5M+e2/p9INqQ1ORfu ORIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mAKrbA0s; 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 w140si14507106ybe.123.2021.01.23.11.03.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 11:03:20 -0800 (PST) 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=mAKrbA0s; 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]:52586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3OBr-0000mW-Pj for patch@linaro.org; Sat, 23 Jan 2021 14:03:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nze-0005KA-3g for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:42 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:51249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Nzc-0008IA-8i for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:41 -0500 Received: by mail-pj1-x102e.google.com with SMTP id a20so2881401pjs.1 for ; Sat, 23 Jan 2021 10:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1GmBs5ay9uV9kxOX2oWB2tt33ICLoNCCnlqJiSZlo34=; b=mAKrbA0sM/NSZqoO9kIpDgE1DeEX0VdikjFGeHu0Q5vu7IGU1UUvMNm3bPf3K96t/2 d3Y+1VZpiupRtOJBWkLplblP1PbSGDq5QX8iLcjACF2+NQi5kxYqKOQ/ZIuE9uvnog0/ lwurlEne4wOZrtJK3KqHqQJ0L42y05lghOvDDRCAbUFEIGJDwfCo0FlD1VjMRRBk2ays 22wOcBT2qx4dKBPT+JwnWYz890GLz3Qsv2J4Qw32cRBi/LyqxteUP6LOLAabitEQGaeX 2cV0DxOAXwi5V7nxP8OW/myuKPTPMO7+S1eBgoCc2gq4YZZM8oPl249YN/dqUN4lbwn6 voRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1GmBs5ay9uV9kxOX2oWB2tt33ICLoNCCnlqJiSZlo34=; b=hgaGgx7LC9M8Y7gs2g3guKNWPN8LQ9mqFT8lXQT5UP2ElZAtqf1ucPJp+prhpSZyj0 hMY4gUjsQCujGh9f/ZL7SgPBhLezdw2Dh/FgkM7eiUWKcveGfLiufcVWzDkPAhe9gAO+ RnadhMl5t6MDU6k/KDU9CFXa68mYEsb515eoOWv72yV+mlX7y7vqYuVqD90I6ucr5dhX oVotbwEXGn8RTocp54Y6syGHv7gVOQQQj/JTHCpP8BIEj8Nkln/f8PfERSQyA3fVElXu uYV2CC7cxd1Yv9LGRfT5Y27DO8kKRxQfuXeVXaMiJWiAKEh9uTwLJ1kaiVcTe4YwV/zD nLvw== X-Gm-Message-State: AOAM533ZkmdvlgFGqdJDrLiy01IV1CZaRymjOdTwG489+fr0ZfWk3ElY IFj4bGyii2co8NpgwITFdCsEcUsfFnLNKA== X-Received: by 2002:a17:90a:8b8a:: with SMTP id z10mr12690085pjn.67.1611427839006; Sat, 23 Jan 2021 10:50:39 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/10] accel/tcg: Restrict cpu_io_recompile() from other accelerators Date: Sat, 23 Jan 2021 08:50:19 -1000 Message-Id: <20210123185020.1766324-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé As cpu_io_recompile() is only called within TCG accelerator in cputlb.c, declare it locally. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210117164813.4101761-6-f4bug@amsat.org> [rth: Adjust vs changed tb_flush_jmp_cache patch.] Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 2 ++ include/exec/exec-all.h | 1 - accel/tcg/cputlb.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 06b341fceb..e9c145e0fb 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -15,4 +15,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags, int cflags); +void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); + #endif /* ACCEL_TCG_INTERNAL_H */ diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 3acc7c2943..125000bcf7 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -63,7 +63,6 @@ void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb, bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit); void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); -void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 0fa1643ed3..7a69726ba4 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -37,6 +37,7 @@ #include "exec/translate-all.h" #include "trace/trace-root.h" #include "trace/mem.h" +#include "internal.h" #ifdef CONFIG_PLUGIN #include "qemu/plugin-memory.h" #endif From patchwork Sat Jan 23 18:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 369455 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2593401jam; Sat, 23 Jan 2021 10:57:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFCLL8WQYd94iCbZRgoyOsAhd+LA+JIf0zXdjKNnowDJKiufNvk67TaiJRzT8zO4F33uOL X-Received: by 2002:a25:d2d4:: with SMTP id j203mr5499711ybg.132.1611428261701; Sat, 23 Jan 2021 10:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611428261; cv=none; d=google.com; s=arc-20160816; b=Vz42vkGjuFaUamKUepMdWeEOBCjVHXTGXBtJx2tAEYdlTzlv8dP/OPAjMugIBBzD2t TQrHEvsrwvWvLAXKeHSaJ2oxJ7gAaWAiixPysfEScPrAp9WugDEataRAT2SGvpflummF 9dDRUiy5AsJkdRSMFGnpoR8DLZi2kGG3BOYtcl27xQjGfQWOWrW5k7679uIBWlAIMTCM 8rv5IUGsii4iH1WvNc1eXGTjvxGzYFOdW9qtgI3Lg/61czy9ocuSnjXcHWju40b+Repv DjcwMK/wqA2Hdag8meN61SOiOZY4mDCXKqhKs/1/4JQCXJxXD6xB2BMXHV0RhOQ3WLxT c9rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=BKBpY0AI8UiujeeaSOJWvVpTSr3Ee4SaVnbe/ePIKI4=; b=RApmJ2FTjYswQolZRpS8Nu0bd164Db7Sm7hHf8h0vamcjcB5AC1z2Poy4QWlirgcce QulhZzkxI107uuMD0hIidEy413PG01/8lRJAPD6htIvm1HRcPCE2dVNk7wT75g8lNeMA R4Erp0PCHSK/8BvJ+2FOPYHsKdfU6kDwxrcYj26/7mkmMlYjEg9Tj0Sf1q/EauSTH8l2 4SWnupAPKnARpGWbbKbAPyWdUhOgj7nsbDJFmgNWEZ+ONkzIYSJ084gbkP4jsihBwvOR WeIR37qnOUjJYGvFIeUCj5DFhGYopKFD5caGXWH62d2SVO/A5ivJl17tZQXPPPlYG7XP qBjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GHOeh8UV; 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 v76si12039501ybb.485.2021.01.23.10.57.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jan 2021 10:57:41 -0800 (PST) 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=GHOeh8UV; 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]:43578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3O6P-00053W-3d for patch@linaro.org; Sat, 23 Jan 2021 13:57:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Nzg-0005Oa-2X for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:44 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:32809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Nze-0008Jg-1s for qemu-devel@nongnu.org; Sat, 23 Jan 2021 13:50:43 -0500 Received: by mail-pg1-x52c.google.com with SMTP id n25so6170319pgb.0 for ; Sat, 23 Jan 2021 10:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BKBpY0AI8UiujeeaSOJWvVpTSr3Ee4SaVnbe/ePIKI4=; b=GHOeh8UVkzyqaLwaYnEgPQUPmK+G5UwNzESewekrloWP5CraMnmixRR1LQP6QqPWAy tN3YdPySUb1iamstfQGvBRgp7lrgB6ED2hm6FUCx14uAT2zuuYrWFuvRynEsdhOL5h04 tKt5iqgzitHWpbIiBso4uUHwd2a4Xk9NfZix3Ub2JZJW2guWEEM7dZ3mbae8qoqqu/Kn M4LkNGspNta6tcH4dqV1dhm/3Y81yGC4JNJs0jER1nMlMvz09W/GoUp0pjCuATBg/ucQ ZPxTRwOPMZEPmTTEBO8vRznCviH12jfAJ+aoymuetf6rC1sYK5+4EWZ4LOtSKR4IHYaf MIRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BKBpY0AI8UiujeeaSOJWvVpTSr3Ee4SaVnbe/ePIKI4=; b=o3oTg+W2G9tHsTWKW59XN75lByuR401vKLP1gkDiIox07OZR9CSj5nj/SCA70qfuv/ 3TpQPslcuwA56jPN4PL+3iEOwQF670IQKAv89OvDHoFbybAO6SLC+MXklgGKkwm+i3fa Kx6F8f6FLAnbbLicc6BLm2Obd094mrnijoAB35fiUTL6YUKr9LWapLwMYzxIkZs8OCbA dFZRTSWijXEF5z9zDukbYVfhrwCrJsYlAf97nlFYdLvZ13qtL83QAEwX4SpdQBroHiar UPFt3C6y0FVXX30/d8uOrSwY/wBn41HxaokpVV18Zf4uy1yBhUByw6EPj407q44J//S8 skzg== X-Gm-Message-State: AOAM532HojyTvnfwam+w4vGw7VynT5JpAD4AQWsXq+yn1Nd+1UXH+MDT 35ZBb6kqXAJi2Nf+28SarRzmEoeGbozCMg== X-Received: by 2002:a63:3549:: with SMTP id c70mr10655403pga.361.1611427840722; Sat, 23 Jan 2021 10:50:40 -0800 (PST) Received: from localhost.localdomain (cpe-66-75-72-126.hawaii.res.rr.com. [66.75.72.126]) by smtp.gmail.com with ESMTPSA id j19sm5018614pfn.14.2021.01.23.10.50.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 10:50:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/10] tcg: Toggle page execution for Apple Silicon Date: Sat, 23 Jan 2021 08:50:20 -1000 Message-Id: <20210123185020.1766324-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210123185020.1766324-1-richard.henderson@linaro.org> References: <20210123185020.1766324-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Roman Bolshakov , Alexander Graf Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Roman Bolshakov Pages can't be both write and executable at the same time on Apple Silicon. macOS provides public API to switch write protection [1] for JIT applications, like TCG. 1. https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon Tested-by: Alexander Graf Signed-off-by: Roman Bolshakov Message-Id: <20210113032806.18220-1-r.bolshakov@yadro.com> [rth: Inline the qemu_thread_jit_* functions; drop the MAP_JIT change for a follow-on patch.] Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 28 ++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 2 ++ accel/tcg/translate-all.c | 3 +++ tcg/tcg.c | 1 + 4 files changed, 34 insertions(+) -- 2.25.1 diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a434382c58..b6ffdc15bf 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -119,6 +119,10 @@ extern int daemon(int, int); #include "sysemu/os-posix.h" #endif +#ifdef __APPLE__ +#include +#endif + #include "glib-compat.h" #include "qemu/typedefs.h" @@ -682,4 +686,28 @@ char *qemu_get_host_name(Error **errp); */ size_t qemu_get_host_physmem(void); +/* + * Toggle write/execute on the pages marked MAP_JIT + * for the current thread. + */ +#if defined(MAC_OS_VERSION_11_0) && \ + MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 +static inline void qemu_thread_jit_execute(void) +{ + if (__builtin_available(macOS 11.0, *)) { + pthread_jit_write_protect_np(true); + } +} + +static inline void qemu_thread_jit_write(void) +{ + if (__builtin_available(macOS 11.0, *)) { + pthread_jit_write_protect_np(false); + } +} +#else +static inline void qemu_thread_jit_write(void) {} +static inline void qemu_thread_jit_execute(void) {} +#endif + #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 37d17c8e88..6d017e46dd 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -186,6 +186,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) } #endif /* DEBUG_DISAS */ + qemu_thread_jit_execute(); ret = tcg_qemu_tb_exec(env, tb_ptr); cpu->can_do_io = 1; /* @@ -410,6 +411,7 @@ static inline void tb_add_jump(TranslationBlock *tb, int n, { uintptr_t old; + qemu_thread_jit_write(); assert(n < ARRAY_SIZE(tb->jmp_list_next)); qemu_spin_lock(&tb_next->jmp_lock); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 73fef47148..d09c187e0f 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1670,7 +1670,9 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list) static void tb_phys_invalidate__locked(TranslationBlock *tb) { + qemu_thread_jit_write(); do_tb_phys_invalidate(tb, true); + qemu_thread_jit_execute(); } /* invalidate one TB @@ -1872,6 +1874,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, #endif assert_memory_lock(); + qemu_thread_jit_write(); phys_pc = get_page_addr_code(env, pc); diff --git a/tcg/tcg.c b/tcg/tcg.c index 5110f6f39c..4d734130df 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1112,6 +1112,7 @@ void tcg_prologue_init(TCGContext *s) s->pool_labels = NULL; #endif + qemu_thread_jit_write(); /* Generate the prologue. */ tcg_target_qemu_prologue(s);