From patchwork Fri May 3 12:25:23 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: 794372 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp707820wrr; Fri, 3 May 2024 05:27:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVL0fu3FRcCMMNDq5OvQUZI3WONLRPP6CyGGW/NPTGmQVk3As2R4SKK934Wf+0tmJKVfajkb4Al32UOvPJqoSh X-Google-Smtp-Source: AGHT+IHPR7G8T3FPM64qNy58h6rQH/y7R51PH5WVzEDGYg8snQYwNdziM+uqbs63t5uIhUtJ0L6H X-Received: by 2002:a05:6808:170e:b0:3c8:64d0:523f with SMTP id bc14-20020a056808170e00b003c864d0523fmr2822708oib.59.1714739220281; Fri, 03 May 2024 05:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714739220; cv=none; d=google.com; s=arc-20160816; b=WgKF0LdNourslYUDPeMHeBDvIUYXG/cSAzwvtgz6nwisEvNcUv7XOmqxoFxQ3Kz2va jzHXBToDec30PSmJaNs/xpz1tmLYnlaQeHLVGkm5dYdhcQ791LTDO2J1so96huKLjF+W nfJGV41HZEuJii9IezD6CHbgyDtYaCXkpyWqjJ2fkkjoNv9pkqDI/E1KdYNXSCom1OHq piNTgYYeliT2LFf39vyZeg/hhP5v824L6UeOEZ4cuC1KVESCH52VU0BlQDIoIr/Mk+3q Osz2aUoGsd8Tc0pVJxr9MdFja5u9xN2AP0ju8+HtfS57HAIm2zfzkLS3h9Yh8uRR+FSF RXbA== 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=CZ/5slWG25YGe7Sfq3Hc99Zz9GmHkCwksopYYuykw+4=; fh=SLdBWdVl4pOwq9we+/FCh5WeSKt0HqFXI7sxtbVu3fc=; b=gbUJqknky6Cvom3RTplAxJmGHZoXchI88xNTo8n/QfxKZ30K1B58G3lHNnrEcNWQqX vNrECSsbLurYwEYRPsj0QipWGEM+LJzyrQnJ+Rn/clQXcBNYkSEBRCddisUf9DKlnOEj 0R6ImUmLKJhWaDlAjYEgnFn+QTSYotMdteDP+MTI534Np5NEHJYJZBCOGwXC5duqv5mS I4ylJjge4g9c8Vp72RTEZzoLjkGyRtIrUavVR+fXyQUbrEmdMg+vUhqdMB3CKTCkoUZZ dfd9JFpRlBYrpGHmb1Ru430YOtXa3f0TowU46zHo+lh4S7ophEInB5lXHGp7V1NtX+bb FmYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=muHaCnIB; 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 o21-20020a05620a2a1500b0078edf1f4c40si3454461qkp.197.2024.05.03.05.27.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 05:27: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=muHaCnIB; 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 1s2rz6-0006kk-5w; Fri, 03 May 2024 08:25:52 -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 1s2ryx-0006j1-B0 for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:44 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2rys-0000o1-Vt for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:43 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a599332afcbso109464666b.2 for ; Fri, 03 May 2024 05:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739135; x=1715343935; darn=nongnu.org; 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=CZ/5slWG25YGe7Sfq3Hc99Zz9GmHkCwksopYYuykw+4=; b=muHaCnIBzvEkdsefcEZBJ9vldcxpEMJccATT6w+ug9kaG4a1UofrwandJhJeZbZ9S2 VxSJT3yFaOncAGxMT/sO8rx/GE3m5lnpzinalOVfxPLqxO8e5v+KB3mnUSHLgcIq7M2N DMtai937Itctu2SBfIqIzniETY+qr9iz82VR1J32r1NugqnrmCU8ChPnHIBV4Ff8bajM 2ImWG+rMIGk9kQ9Gap9ahhtKzpO3Q/WbdxXanXybq4YKLl6z/+6loQ1mX52ZjCnteQZH hsXzB61/0qidMY37oHEKmesX6r+ufgWQAt/LhQAXXvpEQ/HfjxjoAooiM7j01LHct5jP 7YZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739135; x=1715343935; 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=CZ/5slWG25YGe7Sfq3Hc99Zz9GmHkCwksopYYuykw+4=; b=QdUcZppxxnI1MVFIQT3ie/+DWIaJ/LVb0DAUgEm6L+y/1WeMQUMbVKV/z6upfyzzKr OUPLuHy6LLN1Gmt3JbOLL06mwhOJvYgr9S6aDTpM03mmp5s39Xq+Nniqn//SIVDyvow6 Un+f7foLHaerZttl2GcRMbGADZ9kBnSldUc0w24T7nEgrT4sKrITQLZYxLyvx6n4twv5 7sM50NKwVm2i7VtxWMrmKU1xvGx/WGsejiBPDr5UZlOGdEz8SAYejBLr+m3WQNZS3S77 snwB5D1Jj4xS3Gk8N39NRVNQ3VKIivkFGBMzdD1rtUO7lQyJxMlfkidcP4yiA7S1UDuB c7bg== X-Gm-Message-State: AOJu0YwhEORSdmtmzRunfq57c1wFnHcTL1b+5KJzRZi5lpIkEkguYxGp U3daoLGaxPJFfdHsTBNUxRZi9XCnYrgwdjyUokb1Si586ls2dFvILYkK/f4mIKL8vNvJf/axMEd N X-Received: by 2002:a17:906:cf83:b0:a52:6e3b:fcf1 with SMTP id um3-20020a170906cf8300b00a526e3bfcf1mr1561615ejb.17.1714739135466; Fri, 03 May 2024 05:25:35 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id z21-20020a170906715500b00a599c8b6531sm161905ejj.178.2024.05.03.05.25.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:25:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Warner Losh , Paolo Bonzini , Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/4] accel/tcg: Move system emulation files under sysemu/ subdirectory Date: Fri, 3 May 2024 14:25:23 +0200 Message-ID: <20240503122526.28312-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503122526.28312-1-philmd@linaro.org> References: <20240503122526.28312-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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 Some files are specific to system emulation. Move them under their own sysemu/ directory. This might help to notice what is affected (user, system or both) when doing global refactors. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/{ => sysemu}/tcg-accel-ops-icount.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-rr.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops.h | 0 accel/tcg/{ => sysemu}/icount-common.c | 0 accel/tcg/{ => sysemu}/monitor.c | 4 ++-- accel/tcg/{ => sysemu}/tcg-accel-ops-icount.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-rr.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops.c | 0 accel/tcg/meson.build | 14 ++------------ accel/tcg/sysemu/meson.build | 11 +++++++++++ 12 files changed, 15 insertions(+), 14 deletions(-) rename accel/tcg/{ => sysemu}/tcg-accel-ops-icount.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-rr.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops.h (100%) rename accel/tcg/{ => sysemu}/icount-common.c (100%) rename accel/tcg/{ => sysemu}/monitor.c (99%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-icount.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-rr.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops.c (100%) create mode 100644 accel/tcg/sysemu/meson.build diff --git a/accel/tcg/tcg-accel-ops-icount.h b/accel/tcg/sysemu/tcg-accel-ops-icount.h similarity index 100% rename from accel/tcg/tcg-accel-ops-icount.h rename to accel/tcg/sysemu/tcg-accel-ops-icount.h diff --git a/accel/tcg/tcg-accel-ops-mttcg.h b/accel/tcg/sysemu/tcg-accel-ops-mttcg.h similarity index 100% rename from accel/tcg/tcg-accel-ops-mttcg.h rename to accel/tcg/sysemu/tcg-accel-ops-mttcg.h diff --git a/accel/tcg/tcg-accel-ops-rr.h b/accel/tcg/sysemu/tcg-accel-ops-rr.h similarity index 100% rename from accel/tcg/tcg-accel-ops-rr.h rename to accel/tcg/sysemu/tcg-accel-ops-rr.h diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/sysemu/tcg-accel-ops.h similarity index 100% rename from accel/tcg/tcg-accel-ops.h rename to accel/tcg/sysemu/tcg-accel-ops.h diff --git a/accel/tcg/icount-common.c b/accel/tcg/sysemu/icount-common.c similarity index 100% rename from accel/tcg/icount-common.c rename to accel/tcg/sysemu/icount-common.c diff --git a/accel/tcg/monitor.c b/accel/tcg/sysemu/monitor.c similarity index 99% rename from accel/tcg/monitor.c rename to accel/tcg/sysemu/monitor.c index 093efe9714..620c18d267 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/sysemu/monitor.c @@ -17,8 +17,8 @@ #include "sysemu/cpu-timers.h" #include "sysemu/tcg.h" #include "tcg/tcg.h" -#include "internal-common.h" -#include "tb-context.h" +#include "../internal-common.h" +#include "../tb-context.h" static void dump_drift_info(GString *buf) diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/sysemu/tcg-accel-ops-icount.c similarity index 100% rename from accel/tcg/tcg-accel-ops-icount.c rename to accel/tcg/sysemu/tcg-accel-ops-icount.c diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/sysemu/tcg-accel-ops-mttcg.c similarity index 100% rename from accel/tcg/tcg-accel-ops-mttcg.c rename to accel/tcg/sysemu/tcg-accel-ops-mttcg.c diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/sysemu/tcg-accel-ops-rr.c similarity index 100% rename from accel/tcg/tcg-accel-ops-rr.c rename to accel/tcg/sysemu/tcg-accel-ops-rr.c diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c similarity index 100% rename from accel/tcg/tcg-accel-ops.c rename to accel/tcg/sysemu/tcg-accel-ops.c diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index aef80de967..1b91f26a7f 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -18,19 +18,9 @@ if get_option('plugins') endif specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) -specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( +specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( # SoftMMU 'cputlb.c', 'watchpoint.c', )) -system_ss.add(when: ['CONFIG_TCG'], if_true: files( - 'icount-common.c', - 'monitor.c', -)) - -tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( - 'tcg-accel-ops.c', - 'tcg-accel-ops-mttcg.c', - 'tcg-accel-ops-icount.c', - 'tcg-accel-ops-rr.c', -)) +subdir('sysemu') diff --git a/accel/tcg/sysemu/meson.build b/accel/tcg/sysemu/meson.build new file mode 100644 index 0000000000..d0b4939ba9 --- /dev/null +++ b/accel/tcg/sysemu/meson.build @@ -0,0 +1,11 @@ +system_ss.add(files( + 'icount-common.c', + 'monitor.c', +)) + +tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( + 'tcg-accel-ops.c', + 'tcg-accel-ops-mttcg.c', + 'tcg-accel-ops-icount.c', + 'tcg-accel-ops-rr.c', +)) From patchwork Fri May 3 12:25:24 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: 794369 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp707703wrr; Fri, 3 May 2024 05:26:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUrPtHWv24AHsiZd7uugMFMLFThKj6E3XqX20Vbc/O+NlEjxkCSivQtmOfi614uhi7+NPY7Jd7Woru6he6fHSOB X-Google-Smtp-Source: AGHT+IGHd4f+qwvTkIAR/8NBuVDUJv15W5KuAy9MM/AaVaNHhXpIvEYVjBl2gSXQSlSDcdMDfv3y X-Received: by 2002:a4a:182:0:b0:5af:24de:7f1 with SMTP id 124-20020a4a0182000000b005af24de07f1mr2411742oor.7.1714739201853; Fri, 03 May 2024 05:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714739201; cv=none; d=google.com; s=arc-20160816; b=TXtt3l+XY6bL8zWDa0ongxRnr/kILFYaCyYmFAv/OzmyPpgtR4VC5WXwW7zBOvehHq Or+eTrQZk5WA0NBwHLLtCq66HCPVpYc1E5m9HEYxtHI/rAa9ynCbzx1KVkmZ4gYNGErR OvA3cfKIOU+ByAipM6ZkgktTHlsoendqkKVO3aLflTDrDoyfo5hXHJNgVjPOEGcw2Xs8 SDOyV8jONCy2MtEQNAj9yw1n4My8Ct2UoEwRRdzW0SgA/uaXJAlpY+hXAELzQGMpNDjC YLmAFTFd5z+ca5i4V7W+PqSCG5777XRpVUvY4WJsrWY2UuE1xFmlyqkBhDT5klmP1Y4v kgbQ== 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=b8DwnhcqDdYLqJv6uh/ywG6qW/XlS7dFgSw/LzDaIEU=; fh=SLdBWdVl4pOwq9we+/FCh5WeSKt0HqFXI7sxtbVu3fc=; b=GRujtZIEG4k1i7HsfeOT/68ds89mnIa2sWhn6njBC1zcXD7QtZOjwAP+2F1iswdr1N evVjHSqgLexvN5BpHChHdUfAI1GnUXTTN5Vr/WUfkj80VZYnOvtwUnpPihtfCAFrota+ P0HP031BJXRUlunwtKm3L+kKgXoj/xlVl77e3mvyqoVqDfMQpk9tdpqBa6osOu6ES+T1 lcDJkQ6P5kBzyH9qve83nwki7wM5THQGjsiLLl9S8sBsF3LDZUCovveB+0c6Pg0qkRJ+ IAxkaz+CTQCCNla/RH9q8PT7n6S1mghaxiwO6dJ8bKlyiEEWj3K5Fh89UHiZbx4H/W5B pdeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoA8XkUt; 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 o12-20020a05622a044c00b0043ac88e5edfsi3257853qtx.450.2024.05.03.05.26.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 05:26:41 -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=RoA8XkUt; 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 1s2rz9-0006lb-Pk; Fri, 03 May 2024 08:25:55 -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 1s2rz0-0006jm-BA for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:48 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2ryx-0000sg-8i for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:45 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a597de5a715so288256566b.2 for ; Fri, 03 May 2024 05:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739141; x=1715343941; darn=nongnu.org; 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=b8DwnhcqDdYLqJv6uh/ywG6qW/XlS7dFgSw/LzDaIEU=; b=RoA8XkUtgiMvl0vjVJ6Ie2J3kaHzCpSuMVbA7WkMLVfpR06bzEFD/GbhKCdevqvYHR dXhmcnO2NGk03UZW9OmsFKha0xJ5b/oNXsYOeMMtTTHxDTSPhPLxDZ8yqZAswTclipYP hSL8VX0+LOS1+Nyh1tYe0rC8wmfRtk519GTDChWTtxHDNdDU0USuiY13sz1lwjLRpOIh pQZGxWJixc8HKYX6yyxAwO8oBbI0DQLQXtxKW3WPck5kc8xE+U1zOG+8Mc9W8M+nlBzJ 6CL5vXGblDzNmJxMnVqU7HN23POF0Pqk3NIAfXnTVM/1LiUAQgKsodFBFpZvx/+fyy4H tLmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739141; x=1715343941; 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=b8DwnhcqDdYLqJv6uh/ywG6qW/XlS7dFgSw/LzDaIEU=; b=ntvDhPwP5+vrr3i9iR0y2IUWd4/ab0JipUZZli3FdnQ5poC/tyz9b1rfruLCO3fqmT J5mhk0YELxqptzYorRNXDD+aF5p5jZA5Js9I3pJYQ4j+lrKUZRFtnt2p+Dg/sTNUyQhO UXaJ4lfh4nhxmEkHNzpOUeBSe+Cc7MsvCzHcoVrCZxNHXagH7TwpNYY+5fDKekcqvN13 ipQj9+/+/WJg2UIzPvy9yI0ibgf51Y7Xlfkw9Db99SlHmdkqHVjCmi65mGF1vummQnGm v0KE7dmrB6rCNFkiSC8G0fj0hIhTVac1WCRmclvWF/RY/IMToCKTPARkxrPCjhD4prck Gk7w== X-Gm-Message-State: AOJu0YxEUCdBw8BWyqBjCaxmuP2TaKxZEq7ye8bVqactHXTIeKjgOPdl VRPJREvyp4vu3c1aYnj+sKFNVz+2srDjU2c5Sgnm4EMudxTTtuQNcDQ4mkiby76d/hnfjvy54bE U X-Received: by 2002:a50:8711:0:b0:56b:ec47:a846 with SMTP id i17-20020a508711000000b0056bec47a846mr1516035edb.25.1714739141326; Fri, 03 May 2024 05:25:41 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id d25-20020aa7ce19000000b00572a7127cb0sm1637087edv.50.2024.05.03.05.25.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:25:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Warner Losh , Paolo Bonzini , Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/4] accel/tcg: Do not define cpu_exec_reset_hold() as stub Date: Fri, 3 May 2024 14:25:24 +0200 Message-ID: <20240503122526.28312-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503122526.28312-1-philmd@linaro.org> References: <20240503122526.28312-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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 In commit 1b5120d74b ("accel: Introduce cpu_exec_reset_hold()") we defined the user emulation backend cpu_exec_reset_hold() as a stub. This was a mistake, since common fields are set in CPU reset, and user emulation needs these fields to be resetted. Move cpu_exec_reset_hold() back. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/user-exec-stub.c | 4 ---- accel/tcg/user-exec.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c index 4fbe2dbdc8..2dc6fd9c4e 100644 --- a/accel/tcg/user-exec-stub.c +++ b/accel/tcg/user-exec-stub.c @@ -14,10 +14,6 @@ void qemu_init_vcpu(CPUState *cpu) { } -void cpu_exec_reset_hold(CPUState *cpu) -{ -} - /* User mode emulation does not support record/replay yet. */ bool replay_exception(void) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1c621477ad..6a108eb212 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -37,6 +37,10 @@ __thread uintptr_t helper_retaddr; //#define DEBUG_SIGNAL +void cpu_exec_reset_hold(CPUState *cpu) +{ +} + /* * Adjust the pc to pass to cpu_restore_state; return the memop type. */ From patchwork Fri May 3 12:25:25 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: 794370 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp707707wrr; Fri, 3 May 2024 05:26:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEMj6cu1HQP6dw6ZYKbRwsQ520Q4oBUADsn8oYiN4eEUcgk+9+d0Fn+Fo5BHy+8QFj7DXX91rtXBDfza3c8L/w X-Google-Smtp-Source: AGHT+IFqswBvZXoFpksFTcn1KtjA8datLRtjU32DTuMREJfz7oezq/GRMjy4poZp0aBSgJIdgIxY X-Received: by 2002:a05:620a:b51:b0:790:91ae:8e4e with SMTP id x17-20020a05620a0b5100b0079091ae8e4emr2301249qkg.24.1714739202143; Fri, 03 May 2024 05:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714739202; cv=none; d=google.com; s=arc-20160816; b=ALODslqi+LQZNHnkE7xTlD2Cx0CmTXZVOc7eng+cBHEL7oGT0FVVxRMSVCCxfifqbC 8xJiFfYLUKlPqc0coSE8Q66Ye1GcmJDmB9d7cp4bOpsBDFXB08BYgTJZhjdKLrNmkZpo oqfqVkFcg8kGmYdNdWXu/BTr3JEq9nYRpHqOhCNTn2WLduefrcLjP1A6ivShvNBYcBU/ syLo8ezRUS678I1OERmQZLMwvhfakW8f8aNQDkp6FkB0AKecsrb/beDMRBVBL0wVLATN KwfKyefsc8//aH1yhzZ3Qmdl2LEP78NuxyuejVagPA/D0sEijsBqh7H5XKSwLh76OHij rpxA== 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; fh=SLdBWdVl4pOwq9we+/FCh5WeSKt0HqFXI7sxtbVu3fc=; b=rr96Si7FoMcBa7jIL2ND1vMO5cpYHvZvKhlkxFQMdBa3QZvsAGPBoTs3l9z6HJvwqE thWN282dV/MdZISBzpZC/PX3PRl3Ecxs7BzQAaDny45nxyj3wrLm4yoRhW4CGLjsFhFA ozXC56A9+pa7e7X3U0RubiIAuRaWg94op5wowAdS8c5XMkkIEv2C/7Lq459jbed0JFdK vzSjBoWZQSaUmxf5vqNdSXHNaBH/ZZ2c5V3BR87Wg4TTtjJ+uYmoMOlIac+f2C8s3/Ah MQ1ImrTVQn2BMrHxG8Fza6FGCemvB+gZUsRMJqLle3KrfnMTab6veH66ermuN34YAEW6 BttQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hc46BKcy; 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 c22-20020a05620a269600b00790f59d6844si3318746qkp.660.2024.05.03.05.26.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 05:26:42 -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=hc46BKcy; 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 1s2rzJ-0006nR-36; Fri, 03 May 2024 08:26:08 -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 1s2rz5-0006kx-Kb for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:52 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2rz3-0000vZ-V6 for qemu-devel@nongnu.org; Fri, 03 May 2024 08:25:51 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a597de5a715so288284866b.2 for ; Fri, 03 May 2024 05:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739147; x=1715343947; darn=nongnu.org; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=hc46BKcyj2lyZR5KXgcyC1zSP/BjVJnP6VZcum018TBva4L3tjsHEAVlASGv1rqHL4 ITTLSuXN6f1Gf/a+/dyhUYCX/UMcE7sWES4URYN0s5FCgCt8Nedn3AFMov4WYu4bKhOh k+E8YthftzLmu1LGiqh6cec5k+9zfY/X4ZVO+09u4n+xW0VJpBPjxZYkA0VvM07kLaJZ 0X3ZYWvqmGko5KVHGa/vHNTxDTAiqH74Th5EcPDwQbA9lVNRd7GWByi3rGttakTwKfUz LSf5H7d1Q9bjQuirvKf1B8dy2zKudlYjZctReQaV06l0wubfmRpgRQU4nI+0yFqEfhWo Gfcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739147; x=1715343947; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=cJxzs1ffp9h/fYsNjIJshvAGfOyOqc237wDwugt2tlQYqGqNZ4IxIb5AKje6/le+bm ziOwIusL6UFHStjnRhpYoo04qb7q28df0fUnHvQ2mVGHteVAS/fAOkT2PJdpE16yBwvf 2ISYi5JSrYND35+Lo/5nM/4HHq9wjvfbTnj6aIbBYT7h4Oc7A0om9wWlc44t6S/n4/Dy p90BATgHEt9LBgsDe+sM4XvZVeETk8RyxNgNbZH1KfDcFYCo+Pp1dZS4/atku0/XBQ5K JjVpoSZ7DGnp6MnJltZzj51bSnDuaEb0hE551mluhvBLcOPgJQjEMGK0fD7LW6T8bmwS fdGw== X-Gm-Message-State: AOJu0YwADLyVdFCDNG7OfvKUr8ZKIm9Cib/2Xd5HwgefrpcEzbPILCo/ 5M/kJtnh04XWJjyl9xdIoZgn6+EhQqd85GeXE86VzP0R9aRJBk69MLSuHZgyq0m7d2CUasNOFgX a X-Received: by 2002:a17:906:d8c9:b0:a55:64bd:2544 with SMTP id re9-20020a170906d8c900b00a5564bd2544mr1607692ejb.60.1714739147248; Fri, 03 May 2024 05:25:47 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id kw15-20020a170907770f00b00a597bd5e672sm1160025ejc.88.2024.05.03.05.25.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:25:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Warner Losh , Paolo Bonzini , Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/4] accel/tcg: Introduce common tcg_exec_cpu_reset_hold() method Date: Fri, 3 May 2024 14:25:25 +0200 Message-ID: <20240503122526.28312-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503122526.28312-1-philmd@linaro.org> References: <20240503122526.28312-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-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.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 Introduce a method called by cpu_reset(), common to both system and user emulation. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 ++ accel/tcg/cpu-exec.c | 4 ++++ accel/tcg/sysemu/tcg-accel-ops.c | 3 ++- accel/tcg/user-exec.c | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index edefd0dcb7..b85285e2ff 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -23,4 +23,6 @@ static inline bool cpu_in_serial_context(CPUState *cs) return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs); } +void tcg_exec_cpu_reset_hold(CPUState *cpu); + #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..1bf85c324d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1096,3 +1096,7 @@ void tcg_exec_unrealizefn(CPUState *cpu) tlb_destroy(cpu); g_free_rcu(cpu->tb_jmp_cache, rcu); } + +void tcg_exec_cpu_reset_hold(CPUState *cpu) +{ +} diff --git a/accel/tcg/sysemu/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c index 2c7b0cc09e..82c8368f87 100644 --- a/accel/tcg/sysemu/tcg-accel-ops.c +++ b/accel/tcg/sysemu/tcg-accel-ops.c @@ -36,7 +36,7 @@ #include "exec/hwaddr.h" #include "exec/tb-flush.h" #include "exec/gdbstub.h" - +#include "../internal-common.h" #include "hw/core/cpu.h" #include "tcg-accel-ops.h" @@ -82,6 +82,7 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); tcg_flush_jmp_cache(cpu); tlb_flush(cpu); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6a108eb212..85e92ec8f2 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -39,6 +39,7 @@ __thread uintptr_t helper_retaddr; void cpu_exec_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); } /* From patchwork Fri May 3 12:25: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: 794373 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp707935wrr; Fri, 3 May 2024 05:27:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXNT7otNJfSGEm60tP4IxlNLMYzbiCKNhqt7c8VhNnuyNmzixFSzoo8489rTZXnVAedPzQV4/5ZYF+Pmch0dvBd X-Google-Smtp-Source: AGHT+IFDaGPfH5yG/au4ONj+J48A2MaiiLbnFPiqd4N3t5bSNTHJa5jhUBR+4on6W6RLbSxh81jF X-Received: by 2002:a05:6808:a82:b0:3c7:2a72:34bd with SMTP id q2-20020a0568080a8200b003c72a7234bdmr2496456oij.30.1714739234294; Fri, 03 May 2024 05:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714739234; cv=none; d=google.com; s=arc-20160816; b=v7bNsZBgK7igh/uWC+La7muyLsnNn09AMmOA6yV/fQKvi295fbLY5opCCxDvHbrGJE SMlVe+GwwLhc7AVXRSo0DyP3649UVWQ7e1QuAa+7BMZ5CAHQTq6DAkhXKCehxVP5l7CZ 5RBZ9mLpA/jsbVtxK1690XcWrScal3tvky6FVSwXuotF/vkmDtxNlGpYJgQQftnemdBs dZdtN7YilzMs5Z0//xb9Vzc7q/Cm2DaLk0uET9lyVQwfjjwIbSX6XKTFkE95j/FpaDRZ LBYmp55KEdDr8Asjix9cDs8Gry5AWUzAOjRytthsSffjBXTNhDpUX7ylsiT7cOFymHVa KYyw== 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=4Tb/CgMjRwAYjJGSlcjkSqdpYLQYMSWtat67VigpwVw=; fh=nrkBkiN8WZ5+HQe/e6EeDs2gbISzg1FpRa40rn6k5hU=; b=xNNDKIyneF6s3y3FqJCjjqxhiigwWDJBW6FU4ATKA3TaPffxZczJ8dKkKXZgKApRAp t9wKO3MXzbyqWGXnsd7oPYqXaArEEGoz8NqG+ksHUrNp1sQt08Zn6Lbf8mAVcwV2aFS5 Y5pU/4kUwqBDn4RqjCV2vLcOf7165X3zpkJSVF3iPZpfHwbRDJYh3KPK3PiXmyZKs/YH ycFKeo9AxPfAAr/xj+kfyLkcqOlJKqghDdFl9H+DLUsisMLH/yB35g5gzRbHNL8gukHl ko7s2Y4YWR4Z6RDmFHZn4ZSh3schsehMVbPnOH4r4fkL+V+J22tfba1BprCkaflnwjdl +F3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=apzg+Pqj; 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 ge5-20020a05621427c500b006a0cc143370si3089925qvb.206.2024.05.03.05.27.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 05:27:14 -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=apzg+Pqj; 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 1s2rzl-0006zM-2U; Fri, 03 May 2024 08:26:33 -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 1s2rzQ-0006tx-OL for qemu-devel@nongnu.org; Fri, 03 May 2024 08:26:18 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2rzA-0000wD-8r for qemu-devel@nongnu.org; Fri, 03 May 2024 08:26:11 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2dd6a7ae2dcso148188881fa.1 for ; Fri, 03 May 2024 05:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739153; x=1715343953; darn=nongnu.org; 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=4Tb/CgMjRwAYjJGSlcjkSqdpYLQYMSWtat67VigpwVw=; b=apzg+PqjaAAA7qA6p9IQhI49w2ZEQDUJN2v64U7+dxmAq7gujjyYsq9dzmHRKuViaD 8QLKdMta9gXGNNkfpNxxX1sNo2Li8SGKUthI3mTf/QtOeN+TLNj0oPDBYkPAF9ReWB54 XjHB6ZEBWHxHeXeY6pqqNg48eDkax4Fx5kItRKOIzg3Pdtc70/R8hA7/CR+d98lyy9au Tc9uxTi6ReuhAJWTpGW7zQrC31OqXB4rSLd1GeT7cixH+tut8TbfZctK2JHTgmiQulHR 6y49M+3jNkTPW58pYLV+8MKXT3cHNxuH4cbc2oQA2nGzzcNX9TdbZmkS2K4ZHyOYdeON iFhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739153; x=1715343953; 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=4Tb/CgMjRwAYjJGSlcjkSqdpYLQYMSWtat67VigpwVw=; b=KvQqgY6yvaYdgFQOt2u3r7pnH3XZYFXQNqNt2WQC745zs1efaJTBeyoHjuVu/8ODZm oCTdVgL84HRFAuSXRGQtZgVqrDz/oLApacJBXf4AUIoKeenvIzx+CcZ1a5dyoXNvBlq/ Ku85Mop/6P6s4h6wQf8Y5RumKAENlA57XK78MLICfg6Etjk3ERXWCum3fyZSKYl0Ffbn rheXeMo3UVxZP0ZZH4ig0GihUq7wqAOkv0Up+u93GGTP6jSqBNMUakdTZXJ1bQ8FfSkP 57dyiDJZYOP+WZTq9yJsPUCU5092cg+3q6CxSm6jTDBXLX3V2I4SZQGjf8wQJmrppOf9 op1Q== X-Gm-Message-State: AOJu0YydxXmSBluCC8xtMoJ94/DWme8FJREDp//PcNbRC8v3Or9jQA49 ss0pCSB+L1m+S2NusDHXJMThO/918K2fmqboX0QzFKR3mpEtHp0vJyH6pDS2zl0jpJiAS/AL8lG u X-Received: by 2002:a19:c214:0:b0:512:e02f:9fa7 with SMTP id l20-20020a19c214000000b00512e02f9fa7mr2127751lfc.1.1714739153128; Fri, 03 May 2024 05:25:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id ay20-20020a170906d29400b00a58aff25d77sm1639278ejb.193.2024.05.03.05.25.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:25:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Warner Losh , Paolo Bonzini , Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH v2 4/4] accel/tcg: Always call tcg_flush_jmp_cache() on reset Date: Fri, 3 May 2024 14:25:26 +0200 Message-ID: <20240503122526.28312-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503122526.28312-1-philmd@linaro.org> References: <20240503122526.28312-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 In commit bb6cf6f016 ("accel/tcg: Factor tcg_cpu_reset_hold() out") we unfortunately restricted the tcg_flush_jmp_cache() to system emulation. Move it to the common tcg_exec_cpu_reset_hold() handler so user emulation gets the jmp_cache initialized when threads are created. Remove the NULL check in tcg_flush_jmp_cache() from commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration") which was a band-aid fix for incorrect commit bb6cf6f016. Cc: qemu-stable@nongnu.org Fixes: bb6cf6f016 ("accel/tcg: Factor tcg_cpu_reset_hold() out") Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 2 ++ accel/tcg/sysemu/tcg-accel-ops.c | 2 -- accel/tcg/translate-all.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 1bf85c324d..7e04df2902 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -36,6 +36,7 @@ #include "exec/replay-core.h" #include "sysemu/tcg.h" #include "exec/helper-proto-common.h" +#include "exec/tb-flush.h" #include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" @@ -1099,4 +1100,5 @@ void tcg_exec_unrealizefn(CPUState *cpu) void tcg_exec_cpu_reset_hold(CPUState *cpu) { + tcg_flush_jmp_cache(cpu); } diff --git a/accel/tcg/sysemu/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c index 82c8368f87..13e450c088 100644 --- a/accel/tcg/sysemu/tcg-accel-ops.c +++ b/accel/tcg/sysemu/tcg-accel-ops.c @@ -34,7 +34,6 @@ #include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" -#include "exec/tb-flush.h" #include "exec/gdbstub.h" #include "../internal-common.h" #include "hw/core/cpu.h" @@ -83,7 +82,6 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { tcg_exec_cpu_reset_hold(cpu); - tcg_flush_jmp_cache(cpu); tlb_flush(cpu); } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 83cc14fbde..93202fa3c1 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -663,11 +663,6 @@ void tcg_flush_jmp_cache(CPUState *cpu) { CPUJumpCache *jc = cpu->tb_jmp_cache; - /* During early initialization, the cache may not yet be allocated. */ - if (unlikely(jc == NULL)) { - return; - } - for (int i = 0; i < TB_JMP_CACHE_SIZE; i++) { qatomic_set(&jc->array[i].tb, NULL); }