From patchwork Wed Mar 13 21:33:34 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: 780047 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ed0:b0:33e:7753:30bd with SMTP id ea16csp136473wrb; Wed, 13 Mar 2024 14:35:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVbwRQhopYpxSshOtXz/j6gotMqSeNrtnSj2lsTy38OZWbXEBNE9Ok3oWvjP4qAcSOdzxgewzWlXaJgEKy5RaDX X-Google-Smtp-Source: AGHT+IHlbCfewuV54gL1iDvAg4W+//T+QJsxAB7znjnHf9eW4DFMvFY9OPB4SOxzzKnTMjUnVZub X-Received: by 2002:ad4:57cd:0:b0:690:8260:953e with SMTP id y13-20020ad457cd000000b006908260953emr1008117qvx.17.1710365700418; Wed, 13 Mar 2024 14:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710365700; cv=none; d=google.com; s=arc-20160816; b=va1PYCtGlspM8vq6py4dBbSs3EtRaiGtwZzxW5vr1o/J83tTpp975Z5A/VCsL00BrA bbyTDE6TPxcrL5SnkZxXcpziIOd7KNoKSZCKuLcN97idT2p9cwK3MVdhQLt0LKyhg17t sOhc4gxHI8XmDcnzOzW78fmHsDWC6hk96WCHuTAeonjusXZq9b50vwNL4hEW56sIw86c VT4SrO1yzDEcR3jKaGdTn+G6Kw0ADc9/AB9bpZHAThZ1mYEIZSAGo38FXBYZjAiJBpP5 2AhJYc9/cM5q4mYK9gEdqs9Tmt3tOUk/GwWCB1e8CsfEPUjkgXcV0G1T9iRGXGfGJfMX 2YGA== 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=JMlHJDMRIAHpHLqTr2iQoA8Xh8BaIO4Idzn+WvdthY0=; fh=3xhJ8LSKOz1Q0iRHqHv1RVvfROEagH4RGbL6NacRqSY=; b=yGoyB+p4hFp/woY1v+pT+pmUgAZZzxflAbvahpN1QeBUauI7hTNbfz5Wk5U89v2jiX 6eVRk4zdIzry0w+n5rQq+QwyD8VgWJmyXrl+vDuDqRXhHJ5I2GyW22abNMuZ71YmHwBa vsWMcZSwO37bDilJHfJCY/PQn3BboJmpxy2vQUBHxLgDtN4b8pWdrpbJAx0950JLEP83 L+sBSJWALb4p+AjT/t/QxuN9JUqWqfW6dGQ1KFJ7GqDcHp+54EpjoPLFApc99IwYi47o NvqSQpkqJ9E554peIQDiF4fp4OKz2vJg7MmEfmRkl5vrJj/azZXR9c/R9cqBe7YZjL/v PNxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UOZLtLlM; 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 5-20020ad45ba5000000b006903065874csi79035qvq.199.2024.03.13.14.35.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2024 14:35: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=UOZLtLlM; 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 1rkWFC-0001g9-PZ; Wed, 13 Mar 2024 17:34:38 -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 1rkWF8-0001X3-5p for qemu-devel@nongnu.org; Wed, 13 Mar 2024 17:34:36 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rkWF6-0007qS-KK for qemu-devel@nongnu.org; Wed, 13 Mar 2024 17:34:33 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33e99b639e0so175680f8f.0 for ; Wed, 13 Mar 2024 14:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710365669; x=1710970469; 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=JMlHJDMRIAHpHLqTr2iQoA8Xh8BaIO4Idzn+WvdthY0=; b=UOZLtLlM8K1O0iwuXrxMRLJoEOld5PAD7vaQigr/873cQ5Fjrk8NVcL1B1Rda2Q7gT t7VVUDaX6aWX4v8HMvqCewkp7fz2CPGi1bhikt2L6h7Jqb2dQr+wwWvGRq2zTOqpPg62 xKy8iVsTDC+G3KUOu9NQhtdwBRFJILCKq8v7wDAnxhce4KqXrKgfGoe7x2VojGCEf5nl GTc4/SahZ4vOSbLJUv7frGdOBy8iEkSlcWSLu19V1amuvvKcLzURVQ/UQL0G6mHgI3Mz xc5c2QsMs0Oh2wNIj1ePWieDwG5GqJfd0cbd8+XDq/ngdkSQhfikUZHp3GBUIHEp5+oE eBLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710365669; x=1710970469; 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=JMlHJDMRIAHpHLqTr2iQoA8Xh8BaIO4Idzn+WvdthY0=; b=duc/6gIjDp+ih4iUqs7HcMYCpOBuzAFcK2BYThcyOWYPOdTFShGQkCYtcESDztaI4V vi4qjpIdx0R5opCH4r2KakG/EJ9wxVnpqKF5sJKVzN4ER07inRSNaJvmnglesr0+A4Up Y+HJDL4tD6pod6WmWgfNPFxAN/Qe/vJ2ydCVB1aQ9rVgv5iSfJ9PQnRcKslu/uwFdB/S EInwJnnMdXpFnJpE3d2LcfeoBaVETFqFDuPeWY/d++soW4Fqy2nXRUjF4eUAgZp8EsT0 h1icW1rL9/g2QBWW+0ZpFMB0gOyc39TgvMaK6gBsV9EnbU9SaAZQBXjbYPvWzuVzRLrg 9sBA== X-Forwarded-Encrypted: i=1; AJvYcCUnWGvzL9zLH+/r/9WHw1kl9PgX5nc/HX9nCRGPqeveQg2LAZlyKG+P+GyRd/efOM/SNOwORHWpERbYAQfBkG5cfEhQ3OQ= X-Gm-Message-State: AOJu0YyNYPv4Qh+Xd1GwT/70n0hgDT/mKioXxv1Pgvskhbl60ohVhAed KxlTjDELhIZZeL/ZhXdY5zO4QSY9GuhcmVp0ArJoDjk7Emw3tfqPYWs8ON4wvYo= X-Received: by 2002:adf:f549:0:b0:33e:8aba:cd0a with SMTP id j9-20020adff549000000b0033e8abacd0amr2538518wrp.9.1710365669722; Wed, 13 Mar 2024 14:34:29 -0700 (PDT) Received: from m1x-phil.lan ([176.176.182.179]) by smtp.gmail.com with ESMTPSA id k6-20020a5d5186000000b0033b48190e5esm62867wrv.67.2024.03.13.14.34.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 13 Mar 2024 14:34:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Richard Henderson , qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Paolo Bonzini , Thomas Huth , qemu-ppc@nongnu.org, Alexandre Iooss , Mahmoud Mandour Subject: [PATCH-for-9.1 07/12] plugins/api: Check for USER_ONLY definition instead of SOFTMMU one Date: Wed, 13 Mar 2024 22:33:34 +0100 Message-ID: <20240313213339.82071-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240313213339.82071-1-philmd@linaro.org> References: <20240313213339.82071-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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=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 Since we *might* have user emulation with softmmu, replace the system emulation check by !user emulation one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- plugins/api.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index 8fa5a600ac..06d3e95da2 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -294,14 +294,14 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info) * Virtual Memory queries */ -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY static __thread struct qemu_plugin_hwaddr hwaddr_info; #endif struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr) { -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY CPUState *cpu = current_cpu; unsigned int mmu_idx = get_mmuidx(info); enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info); @@ -323,7 +323,7 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) { -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY return haddr->is_io; #else return false; @@ -332,7 +332,7 @@ bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) { -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY if (haddr) { return haddr->phys_addr; } @@ -342,7 +342,7 @@ uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) { -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY if (h && h->is_io) { MemoryRegion *mr = h->mr; if (!mr->name) {