From patchwork Tue Apr 30 12:27:54 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: 793307 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:54f:b0:34d:5089:5a9e with SMTP id b15csp230861wrf; Tue, 30 Apr 2024 05:29:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUo3PZPplCvPSCQk5C8Plx206y2cyJsJLDnTiBiQP5I9J/IansYHV4BCmp7VDQNYGB60gewOYWbZZhxxBEeVJjg X-Google-Smtp-Source: AGHT+IFzPeE3bMlAFr762StgYhbpKZI+Vba/F2to5RcTnH4cYMFkIuVCgK1oox1oy7OV0mh7L3jJ X-Received: by 2002:a05:620a:5d92:b0:790:f5a4:4416 with SMTP id xx18-20020a05620a5d9200b00790f5a44416mr2476259qkn.64.1714480171131; Tue, 30 Apr 2024 05:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714480171; cv=none; d=google.com; s=arc-20160816; b=P15cCSNRLYzbc9XXm5eBWBRYupGPsPQuSqiCog7QuVND1xoMHBDZwAbknU2MxoSpjX zrxKYIFSP3kA5KHD9rgoMG16nJvemwBR6ziPcEa9V9rffdF8TJLtv6vG5FCBO1XNEqca SI2kPt2F6UAZ9rcvHo4XfHKibcu0JanFoBwuu731VFRH2nEd4axKtMv17Vv1Kxg2bIU3 t57b1eaSS7jKKPWuugI3fgJAl2IZZ+Hzb2jZRhPi/VZTcpiDBp8WW2TmS3My/TN1R1hN R2nvVwz59QX5hnETWTFkoVKSHM5KdpXrPdD0rPkwGB1wUNtH4Tnyf1FsixJKh9rN4tBs tXaA== 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=2tBp0mlEikyBoUziZaOlwZMYYgeW174NsUEHbMeFk28=; fh=dninna3WeNJOqNIKeA8rTPp+Po68LkrZGXJuFQ7a3cQ=; b=rCXXNx32yV3gltPZu9R3NduUXQ59wj0STRKZ8ZSb1qxSd127hVzPD+A+uc/Mqn+qVY +M6kgyQd03TjRTHLkueKxk5nJUnCuKJV3ohRYvnZWIjXnwHfpSmWxZa94ey/gkiNuLTE BLC9umb1ZVjQ2AZDSqkYnxjKhgVTUibB09EeoypDyYMveXkh9z1YKhKeQjU40X3qj8VI t8XsFk3xY9ho9z+05fH92GRM64OYpc6BSzcArfIFcUCVIt4krS6UFuw7UoiUwv3Yr8hn AvD1X+k+YG9nAtrqHmBqjk1vRPko/MiwJbk/6a8wKXy16RdSJVyqcxgaOeWn7YR2Feuu 1DLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D1djEO06; 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 h27-20020a05620a21db00b00790601982cdsi24358160qka.355.2024.04.30.05.29.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2024 05:29:31 -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=D1djEO06; 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 1s1mas-0006BM-Gv; Tue, 30 Apr 2024 08:28:22 -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 1s1mam-00068B-6W for qemu-devel@nongnu.org; Tue, 30 Apr 2024 08:28:16 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1maj-0001ki-C3 for qemu-devel@nongnu.org; Tue, 30 Apr 2024 08:28:14 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5708d8beec6so7040658a12.0 for ; Tue, 30 Apr 2024 05:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714480091; x=1715084891; 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=2tBp0mlEikyBoUziZaOlwZMYYgeW174NsUEHbMeFk28=; b=D1djEO06bELmaz26JAtU0ogkMJqqlRPLXSEkK2RHk/AmQIwJMIELk3v3y/uxUSqpIy DdR9uVYm4QsjmW71MI1VS+j/uIHBTZR714usAHqrRX1Y/P9gOCUJK99w1Pb9gyPUHyWk fMFhUNuT/GDpoVUwvcTzd05OULBjK3hhP37czRmRIg/yv/nYhaGtEqm8V9JrP1Y7/2hQ JuokZn7xRBMOo2Ht8reYMJsHgJUxDhFB888TUE2MkPxSjggYCcayMa3DPSp1m1F9Ozwl 2w3ws8LfZteWDmmfUvkx4xb54hRV4tznLl32/2W3uv1CA+HOGu6/YgBm5H+wtrHiLcVG yqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714480091; x=1715084891; 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=2tBp0mlEikyBoUziZaOlwZMYYgeW174NsUEHbMeFk28=; b=cdzZYR88o5pwGSl/9TlFRh7TcQTb3q2ZYav6ykeW2uJy8qQwoFig36Qk/1zUTzDvE8 2IPUTSd+QN7pkr1sp/zmwSX4KnkSTAQLwm+IYUg0TYg+954/k/bA910h0hV0eUIIWLUZ BKfplbyKYAX2KS93Q8TXh+ffmtgSy4swZ6lKdN9sD+TqIjczFHQGH+84m61y7WqMfJ6J dhpL/VwwDGHA5saUpo019ohLd+zfUUBQ+64RJrepbVT9PBA3H8Y6BpYFcwTHt2IUC0Zj eXf/FbXXUDj2TjERWq2UMp1uTb6CxFWvwIfFERfsdQUGDUyw65YZuiKZaSDLQWVT+I2K VU2g== X-Gm-Message-State: AOJu0YwbJA+T4DUADu/36qduVdbz0+V2qeNEynqrchTKrERSgoyoXHaD 2mVzi/2u3fL8Lk7RUFcruKIrucwFr5okCoUffcXyjS69aSjXWK2sUsuIDIGZqEkCPaARGY8l3qa w X-Received: by 2002:a50:baed:0:b0:56e:7722:553 with SMTP id x100-20020a50baed000000b0056e77220553mr11669296ede.24.1714480091173; Tue, 30 Apr 2024 05:28:11 -0700 (PDT) Received: from m1x-phil.lan (mab78-h01-176-184-55-179.dsl.sta.abo.bbox.fr. [176.184.55.179]) by smtp.gmail.com with ESMTPSA id b10-20020aa7dc0a000000b0056fe755f1e6sm14005139edu.91.2024.04.30.05.28.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Apr 2024 05:28:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Ilya Leoshkevich , Richard Henderson , Philippe =?unknown-8bit?q?Mathieu-Daud=C3=A9?= Subject: [PATCH v3 00/13] exec: Rework around CPUState user fields (part 2) Date: Tue, 30 Apr 2024 14:27:54 +0200 Message-ID: <20240430122808.72025-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::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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 Missing WASM testing by Ilya (branch available at https://gitlab.com/philmd/qemu/-/commits/tcg_flush_jmp_cache) Since v2: - Move cpu_loop_exit_requested() to "exec/cpu-loop.h" - Added R-b tags Since v1: - First 13 patches queued - Restrict qemu_plugin_vcpu_exit_hook() to (TCG) plugins - Restrict cpu_plugin_mem_cbs_enabled() to TCG (plugins) - Addressed Richard review comments on the others: - Move cpu_plugin_mem_cbs_enabled() - Do not move mem_io_pc, waiting for [*] - Mention can_do_io restricted 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 [*] https://lore.kernel.org/qemu-devel/20240416040609.1313605-3-richard.henderson@linaro.org/ Based-on: https://gitlab.com/philmd/qemu/-/commits/accel-next Philippe Mathieu-Daudé (13): accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState accel/tcg: Move @plugin_state from CPUState to TCG AccelCPUState accel/tcg: Restrict cpu_loop_exit_requested() to TCG accel/tcg: Restrict IcountDecr / can_do_io / CPUTLB to TCG accel/tcg: Move @jmp_env 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 @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: Move @tb_jmp_cache from CPUState to TCG AccelCPUState accel/tcg/internal-common.h | 18 ++++++++++ accel/tcg/tb-jmp-cache.h | 4 +-- accel/tcg/tcg-accel-ops.h | 1 + accel/tcg/vcpu-state.h | 20 +++++++++++ include/exec/cpu-loop.h | 35 +++++++++++++++++++ include/exec/exec-all.h | 17 ---------- include/exec/tlb-common.h | 4 +++ include/hw/core/cpu.h | 58 ++++++++------------------------ include/qemu/plugin.h | 2 +- include/qemu/typedefs.h | 1 - accel/tcg/cpu-exec-common.c | 2 +- accel/tcg/cpu-exec.c | 52 +++++++++++++++------------- accel/tcg/cputlb.c | 2 +- accel/tcg/icount-common.c | 7 ++-- accel/tcg/plugin-gen.c | 9 +++-- accel/tcg/tb-maint.c | 6 ++-- accel/tcg/tcg-accel-ops-icount.c | 14 ++++---- accel/tcg/tcg-accel-ops.c | 2 ++ accel/tcg/translate-all.c | 9 ++--- accel/tcg/watchpoint.c | 5 +-- hw/core/cpu-common.c | 9 +++-- linux-user/main.c | 2 +- plugins/core.c | 9 ++--- system/physmem.c | 37 +++++++++++++++----- target/arm/tcg/helper-a64.c | 1 + target/s390x/tcg/mem_helper.c | 1 + 26 files changed, 195 insertions(+), 132 deletions(-) create mode 100644 include/exec/cpu-loop.h