From patchwork Tue Jun 20 08:26:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 694434 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp186310wrm; Tue, 20 Jun 2023 01:28:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40gH3DnkOlW6R5RO8eTZBSMiX3iUlHXDhU4/hX7QmdM79D4u7whtWbGmjQZ3zfYVejJ5+0 X-Received: by 2002:a05:6214:234e:b0:5ef:512d:2d47 with SMTP id hu14-20020a056214234e00b005ef512d2d47mr13070493qvb.19.1687249680583; Tue, 20 Jun 2023 01:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687249680; cv=none; d=google.com; s=arc-20160816; b=lXeBtSQedsuI5tEqSRT1wLatI/LaFoE1Tx6y0d0VJBR7B+0SIu6c6PABwN9mKS2aO6 9phmDRdEg5JOB0tKx6QSRA5xG5tWP/OpNPiunD+9r35ig0Ue60ft5AyFQwiAyPXzmtJl YUuw/HJYahoMaVLQ+W0w3OKorYEkBaYG3BN5IFhqKuxK8xp7Q3X1ulnpJYSs+78Z0577 4OuxCZDTrGNuh280I81zL4JuTVA1gmbejbQjgNNh3zzya4NAPXjsJBvLSR3Zs8bi5R1K av5E/cMI+EXFGFdANVNIhMjY9UHe+exGWBV97xtN59BNwz3rIDIyvXtDH0JqyutJ9OEj 1VYw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ogodEHMvGs+jdKhtwTqfSiSIlFeubpJ1YnGuLMjQdzc=; b=aVPrANrHoZL50/mDQf/z0glSLS9+zYelYJfFAAwdAO0xiz+NK3uMA6O5wiwSwgmE/Z K/7d+So2X9bu+GNLnJqh3nCDbc6MHaWDwgFIy72qXHWSPdOEkUaI1Dx7k0bI2K+3quBO cs86i4+Gd0ZYRZNrIz7XGYNEYSj1YjNQR6zbk5cDgM8zwKdGhLQUkFhxhrXN02vSMftc 0kPoQyL2pzJuOijU1/KCPxdSHRMdJnDtiJlToGc3PiA2pGLBvUkI4DPEHWaMZi583NdL wPy14y8LIeTxPhdXtSoa3215yQRm4hRaPmD+GW7cxdO5RptS0bbbhvIyHSsSeuU+olZR nQ8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=npToVQfj; 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 f8-20020a056214076800b00628821e9505si633652qvz.228.2023.06.20.01.28.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jun 2023 01:28:00 -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=npToVQfj; 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 1qBWh5-0003pO-GD; Tue, 20 Jun 2023 04:26:31 -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 1qBWh2-0003oI-CM for qemu-devel@nongnu.org; Tue, 20 Jun 2023 04:26:28 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBWgy-00067a-Fd for qemu-devel@nongnu.org; Tue, 20 Jun 2023 04:26:27 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-51a3e6a952aso5254855a12.3 for ; Tue, 20 Jun 2023 01:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687249582; x=1689841582; 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=ogodEHMvGs+jdKhtwTqfSiSIlFeubpJ1YnGuLMjQdzc=; b=npToVQfjywIhrYyeZ9m2JXHCn+m8B7dP/wv+/6Icg2enmbO9GDs0U2wzhEe7ACDs6o CiQw7dkLzBId8ZvN0b1oIZa2pEv4+fOp/hMDuY2j5mI75cYwj/AXr+Y1/Pw3wYrR05nA xnlkVyMkmcrLGkmy22Wj2JuFvft9TnNJDYukMrGYvgg7DFwie0Nm8U62WIRVJBF6apAC qEiWbstWJysABBD4h7saTF5HT6R0I48GnN1eMFR61r4j7ngB0LNdNURzYsss63Q5Fg9M I8PECQ5Hx3pseEfTn6bIVTL4p6T3wa6xTwaFvdywGTyfn1vW2ivh57kG/YkWHUPezUWd VIbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687249582; x=1689841582; 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=ogodEHMvGs+jdKhtwTqfSiSIlFeubpJ1YnGuLMjQdzc=; b=ZJb2kWU7JNbasXTpEhzagAUw4gUsRzZUA2Z/Ig3WzruSlDhdHtfLul/U7dSvm/Lfcd XSuif4D8VGSjFskog4ubSzVfASb1f9wvaAIGWBRFMPUyijNYhjoUaUzBe6OURqfjADSi xVIaQohajlU7FqIz8FIq/H9gNN+lWM6Jzn+ojW9oL5+xOFE00KGmiQnCXlTASPo0zlys 59bkE5lK6H9AdNdvzgyOFnrTv4470ND5rLEWcUwLnBvuUNn0l0GYagyBqv3MrjasMJLB COgmfhCy/h/AalXWU/kKTGCHvBZMPTVABhzWpyWy3jgPZDYHN5Yvr6TShi51h9KUZJbW dlcg== X-Gm-Message-State: AC+VfDx02UGv73/kFgy50SZMZ2WJsCtMorOkYGcaZuYNJvxrZ/JjOznO Ds3HS5K+qfzJJ1Oi2BJhlz56AG/F6P5lb+CCoqihBv0L X-Received: by 2002:a17:907:16a1:b0:988:d1d5:cd5b with SMTP id hc33-20020a17090716a100b00988d1d5cd5bmr3703353ejc.75.1687249582599; Tue, 20 Jun 2023 01:26:22 -0700 (PDT) Received: from stoup.lan ([176.176.183.29]) by smtp.gmail.com with ESMTPSA id z19-20020a170906669300b00977c7566ccbsm935901ejo.164.2023.06.20.01.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 01:26:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/16] accel/tcg: Check for USER_ONLY definition instead of SOFTMMU one Date: Tue, 20 Jun 2023 10:26:04 +0200 Message-Id: <20230620082611.770620-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620082611.770620-1-richard.henderson@linaro.org> References: <20230620082611.770620-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-ed1-x529.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 From: Philippe Mathieu-Daudé Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Invert some if() ladders for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230613133347.82210-7-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 6 +++--- accel/tcg/cpu-exec.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 24f225cac7..65380ccb42 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -17,10 +17,10 @@ * memory related structures are protected with mmap_lock. * In !user-mode we use per-page locks. */ -#ifdef CONFIG_SOFTMMU -#define assert_memory_lock() -#else +#ifdef CONFIG_USER_ONLY #define assert_memory_lock() tcg_debug_assert(have_mmap_lock()) +#else +#define assert_memory_lock() #endif #if defined(CONFIG_SOFTMMU) && defined(CONFIG_DEBUG_TCG) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index ebc1db03d7..c0ab00385f 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -566,7 +566,7 @@ void cpu_exec_step_atomic(CPUState *cpu) cpu_tb_exec(cpu, tb, &tb_exit); cpu_exec_exit(cpu); } else { -#ifndef CONFIG_SOFTMMU +#ifdef CONFIG_USER_ONLY clear_helper_retaddr(); if (have_mmap_lock()) { mmap_unlock(); @@ -1023,7 +1023,7 @@ static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc) /* Non-buggy compilers preserve this; assert the correct value. */ g_assert(cpu == current_cpu); -#ifndef CONFIG_SOFTMMU +#ifdef CONFIG_USER_ONLY clear_helper_retaddr(); if (have_mmap_lock()) { mmap_unlock();