From patchwork Sun Apr 28 22:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792918 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1423321wrh; Sun, 28 Apr 2024 15:15:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFYPDVCLZiG+C5iySw4yXX2QcRAyHWeJ459v7+2hG4OVb8a0rDz5h2IiN7i8+baiqWIdsnXa6r7838CK1vvVaj X-Google-Smtp-Source: AGHT+IEnT0bN2PyYj9GQZcKiXaX322AvbaeZGq6B2ibQixSfNo4qLK6bXbk1lOVcaQG3QZ8QQAaL X-Received: by 2002:a05:622a:1116:b0:43a:f577:ea0e with SMTP id e22-20020a05622a111600b0043af577ea0emr619306qty.47.1714342524207; Sun, 28 Apr 2024 15:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714342524; cv=none; d=google.com; s=arc-20160816; b=rgOVK2OLdDauQWCrYCLrqL8q5hBIRq9ON2g7g72iTU3Umaai5JVSUntXh3V7XzmZPS L2hqFY4Kj0T3FkYNqyJxwD8J/bUknQMjRYqNifdw3Ld3SfaIYr6ZF23Tb/GztrW0qEPr 622d3L3mGu/q9suB7C8NkMjN5uDeAsWjm4Mt22A/+4wV2cSt3nDSAMdM10qgYNyKFCct z/dy1gzKVOPNOXG+iOXAA47Fa+t2ovBVgdSBCwri+wA3J6/3Eh8jctB/F2w5/cNaaQMv jzXvApxed5Wl21YnsWakbcXo4RcX5m5+wIifeaMjS+vMj09pnVvIHBp5D2vMMTm8PefN Lyng== 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=NkmGbudnrJtNwyNN6UVpWTp8hpDxi5DDSc2WDzHrtzE=; fh=rCJt2biyg8Ol+qofSuGUQ42fI66TGBm6TQT3TMtAatM=; b=a0iK3J77Yn6z+vXOJFFxyPkp/KFOIs5TecOQhHLtmbkLP3U0MAQaRrnKlZO8925F8I psCqIzxO3zcQtK8I+zjDIjFY+f2HmZlUTlTU30T80eiZlUR9bSApiG6bruRVyhOmum8p DeFgHU8Mpxp54CcPTf5ZYH3EaL+UlhWJ1b66VeS5CdDqlVOwLjqiEe1Y0e4hP4d99rCV fFgZDd6y590w6zFHXD8NhRUIuGOjB0z/dLLZ63hLMCVaDJzmoJ5iWySe5mXRaiRvkzNO g3zsSGIIZ5zcJfKwWu6P6dzsG2ywp/svN7pazcQ4RVrsMSo9RxSlyN/wRsbIiWOAk4c2 xBww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Of6c8GvI; 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 f28-20020a05622a1a1c00b0043acde0bd39si2237629qtb.206.2024.04.28.15.15.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 15:15:24 -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=Of6c8GvI; 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 1s1CnT-0005rL-Kc; Sun, 28 Apr 2024 18:14:59 -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 1s1CnR-0005qZ-5h for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:14:57 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CnP-0005Iy-Bg for qemu-devel@nongnu.org; Sun, 28 Apr 2024 18:14:56 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2db13ca0363so60046191fa.3 for ; Sun, 28 Apr 2024 15:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714342493; x=1714947293; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NkmGbudnrJtNwyNN6UVpWTp8hpDxi5DDSc2WDzHrtzE=; b=Of6c8GvIb1+MTcfSyKgpNr4mwdOzKFuynKp88ShhMZu4ggATSRY1nW7/AlaDd6SBHE ZVWmSK0GsvOW6oa4avVeGJaIS0pO7m+trSCrBWztKXX0f1Bau4KYBwfRO9T+khObzqxQ 9Ec5hsAMNkY6ojmsTwbONmqFnYB9inqEJXQFM6YZK/4KIDzKt8DwJfHal9NUpYPAL6fL yWfzOcaYqW2VKEWGYFAv+ZI1beznKuT30B29w/RR2LJLeLdKJ1AXrmO9OsAmignQl8fV rCryTFao4D3FLfeA+jRTgG4DZ2FFB1t1gcKxJStQJQHw1BymgoznESHdZAdfgGWmikcr r/nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714342493; x=1714947293; 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=NkmGbudnrJtNwyNN6UVpWTp8hpDxi5DDSc2WDzHrtzE=; b=HhQatGolMH0UUnviqlgcTxeekWQVkcFkb4g0+b+J/00MhookLn2y3RJeyxLg2ugOGJ dKeCU8hlFtPjzu6nybe+q3hXGALnRmiuBx8LTxVsK8Pfe/UU+y2RAC6NGnoWihtYYkL8 1ekyk3Avj7Ga8FnB4UPNsqJ2k+iavxxIMrq5sTllPM8VkUkAKfepfovAR2pUjW/Mx9wT y8Mou3n1dDoN1J1qLsTCX1KKkk1UQOdUq1Uw29wwK0yijWZdYPmk5Cs3kbiCE5f9e3/9 uumt0lp5bTG0Io9MV2o3XR8QBxB5NUFX5c2GHScd2Y0/H05TPx07FTalaNuDeYk5OfzA 6umQ== X-Gm-Message-State: AOJu0YyjDp643y6356AbKkfFrY6b6YXE+uxjci5TIHu8sq0kM1YoNTLi tfr1vdqPwmsHuQNLzLFsz4JYKPEw476BJkEsR/C/yj4b+RyQkV/ySahxfz2xsl5XrUbq+nwoAoN m X-Received: by 2002:a2e:b162:0:b0:2e0:69b4:d65c with SMTP id a2-20020a2eb162000000b002e069b4d65cmr843565ljm.7.1714342493111; Sun, 28 Apr 2024 15:14:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id hg7-20020a170906f34700b00a4e5a6b57a2sm13116213ejb.163.2024.04.28.15.14.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 15:14:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Richard Henderson , Philippe =?unknown-8bit?q?Mathieu-Daud=C3=A9?= Subject: [PATCH 00/24] exec: Rework around CPUState user fields (part 2) Date: Mon, 29 Apr 2024 00:14:26 +0200 Message-ID: <20240428221450.26460-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=philmd@linaro.org; helo=mail-lj1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Finish extracting TCG fields from CPUState: - Extract tcg_cpu_exit() from cpu_exit() - Introduce AccelOpsClass::exit_vcpu_thread() - cpu_exit() calls exit_vcpu_thread=tcg_cpu_exit for TCG - Forward declare TaskState and more uses of get_task_state() - Introduce TCG AccelCPUState - Move TCG specific fields from CPUState to AccelCPUState - Restrict "exec/tlb-common.h" to TCG - Restrict iommu_notifiers, icount to system emulation Based-on: <20240428214915.10339-1-philmd@linaro.org> Philippe Mathieu-Daudé (24): exec/user: Move 'thunk.h' from 'exec/user' to 'user' coverity: Update user emulation regexp accel/tcg: Move user definition of cpu_interrupt() to user-exec.c accel/tcg: Duplicate cpu_exit() for user / system accel/tcg: Extract tcg_cpu_exit() from cpu_exit() accel: Introduce AccelOpsClass::exit_vcpu_thread() handler accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler user: Forward declare TaskState type definition user: Declare get_task_state() once in 'accel/tcg/vcpu-state.h' user: Use get_task_state() helper accel/tcg: Allocate per-vCPU accel state in create_vcpu_thread() accel/tcg: Move TaskState from CPUState to TCG AccelCPUState accel/tcg: Update CPUNegativeOffsetState::can_do_io field documentation accel/tcg: Move plugin fields to CPUNegativeOffsetState accel/tcg: Restrict IcountDecr and CPUTLB to TCG accel/tcg: Move @jmp_env from CPUState to TCG AccelCPUState accel/tcg: Move @mem_io_pc from CPUState to TCG AccelCPUState accel/tcg: Move @cflags_next_tb from CPUState to TCG AccelCPUState accel/tcg: Move @iommu_notifiers from CPUState to TCG AccelCPUState accel/tcg: Move @tb_jmp_cache from CPUState to TCG AccelCPUState accel/tcg: Remove NULL check in tcg_flush_jmp_cache() accel/tcg: Move @tcg_cflags from CPUState to TCG AccelCPUState accel/tcg: Restrict icount to system emulation accel/tcg: Move icount fields from CPUState to TCG AccelCPUState accel/tcg/internal-common.h | 3 ++ accel/tcg/tb-jmp-cache.h | 4 +- accel/tcg/tcg-accel-ops.h | 1 + accel/tcg/vcpu-state.h | 45 +++++++++++++++++++++++ bsd-user/qemu.h | 12 ++---- include/exec/tlb-common.h | 4 ++ include/hw/core/cpu.h | 57 +++++++++++------------------ include/qemu/plugin.h | 2 +- include/qemu/typedefs.h | 2 +- include/sysemu/accel-ops.h | 1 + include/{exec => }/user/thunk.h | 8 +++- linux-user/qemu.h | 10 ++--- linux-user/user-internals.h | 2 +- accel/tcg/cpu-exec-common.c | 2 +- accel/tcg/cpu-exec.c | 51 ++++++++++++++------------ accel/tcg/cputlb.c | 4 +- accel/tcg/icount-common.c | 7 ++-- accel/tcg/plugin-gen.c | 8 ++-- accel/tcg/tb-maint.c | 6 +-- accel/tcg/tcg-accel-ops-icount.c | 14 +++---- accel/tcg/tcg-accel-ops-mttcg.c | 2 + accel/tcg/tcg-accel-ops-rr.c | 2 + accel/tcg/tcg-accel-ops.c | 5 +++ accel/tcg/translate-all.c | 25 +++++-------- accel/tcg/user-exec.c | 14 +++++++ accel/tcg/watchpoint.c | 5 ++- bsd-user/main.c | 2 +- gdbstub/gdbstub.c | 3 +- gdbstub/user-target.c | 4 +- hw/core/cpu-common.c | 13 +------ hw/misc/mips_itu.c | 3 +- linux-user/main.c | 4 +- linux-user/syscall.c | 6 +-- linux-user/thunk.c | 2 +- plugins/core.c | 8 ++-- system/cpus.c | 8 ++++ system/physmem.c | 37 ++++++++++++++----- target/i386/helper.c | 3 +- scripts/coverity-scan/COMPONENTS.md | 2 +- 39 files changed, 235 insertions(+), 156 deletions(-) create mode 100644 accel/tcg/vcpu-state.h rename include/{exec => }/user/thunk.h (97%)