From patchwork Wed May 29 15:59:18 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: 799858 Delivered-To: patch@linaro.org Received: by 2002:adf:e110:0:b0:35b:5a80:51b4 with SMTP id t16csp805254wrz; Wed, 29 May 2024 08:59:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWN6nhRAQOlFazfiLkMLSY/afnDfE0S35HEHg4OZ1Q4S46pQJu0eNNR1GI7fIYhFiIJzCy9x6B8PCgwTcgNTWbf X-Google-Smtp-Source: AGHT+IGT5OzxElH7QOdChHIlev7kgQYWvyljkFIUfU6Yb6PzQk9xs730xxI5kCsCUe7+eMdQSnbZ X-Received: by 2002:a05:690c:fcb:b0:615:c96:1a8d with SMTP id 00721157ae682-62a08d5d2fcmr186096967b3.8.1716998378707; Wed, 29 May 2024 08:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716998378; cv=none; d=google.com; s=arc-20160816; b=mCXb7YkN1eMieIc9XBs75w/oXffSGXym7UxHp738+ZK9kpgQSnBBbg2QRRaXAtbnFI YUFJD8mye55N2Rvub+hltADyE/y7Y4fdJ0vhWo4+KYgrjgXIGXvRqWjt6l1tyQddfe1v VcwwTtFHT3thFr9cKPcgUOiDSSORso0+iN0fIZXqSB+pe9W+N74ujH6HvgKRM1L3AJrY an75ZnyosOecGdHnRQ6MCUGN3RRtK9b8MDF3q0SsLTvT7Cx7iWe0hhr/liy21k+0tBtt zOCiJbG9sLjVwhL6DCTeODma6xJVo3l7pXD8hm4fW8pkAlXjBRNnOd5RsEvX1Qs2riUg vG9w== 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=l2RowXhHBbxrob+0bISMh+r0iXs06Afi5Oflt9v9bTM=; fh=nskppnSUn0KDt8r1xzP38J+3VV+KmxAqYkXZ/W28yhM=; b=ScfNJs8/g/Glg0d5FW8UYN6QEuop5D2XYYK1m3ErYlKhpvsk7dNhzD3Y8whz/O9B0J 95/qRJpxAURT47g9JyiwNOVVTFTCDkkJoY0MhBRNAekyBvwrwAbLM/V1aqxYL+gLaw43 ssT6IfpyLrTDReXFyEMyT0qg5pC5SFz563hFbFwUNBOc5vojVqhXxTDdDpatJaidYuin bWbJHJRvaUl1FYa0oxLyp7jbXc3ZC/M1W6GKcA6bOQLcoz2gDFL0WLsoWKJARbJ9ULUx btnMTFpvh4eu5QpUfNETqZPPml+eAHnK3MgMNQ15wvV+Is+kOobYQNCJxFwGUkGQ3HAB t22A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Byt6XeU3; 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 af79cd13be357-794df26afaesi239693285a.81.2024.05.29.08.59.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 May 2024 08:59:38 -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=Byt6XeU3; 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 1sCLi2-0001YT-LQ; Wed, 29 May 2024 11:59:26 -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 1sCLi1-0001Wy-Iw for qemu-devel@nongnu.org; Wed, 29 May 2024 11:59:25 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCLi0-0001ad-0g for qemu-devel@nongnu.org; Wed, 29 May 2024 11:59:25 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5788eaf5320so2647958a12.0 for ; Wed, 29 May 2024 08:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716998361; x=1717603161; 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=l2RowXhHBbxrob+0bISMh+r0iXs06Afi5Oflt9v9bTM=; b=Byt6XeU3+sXdnt4xqp9RBMenGNNGA6BS2wQFeVrZRDVUGTRwTaH9msto6xD9CwPFxO DE9iFSemWV5SNHySLiHDCZGJz0VktJ+mm7VfTKEwkwNB9kDfEWSBTWXm/SnALab0xSXj Ex3hr+wNz7knKjBRs87tefrANLOVTH22FO39FG4rGrsLS8AN2PPLBOYgwT+BCqYYTP4U vrVTbExq+jA20WbGODmyMK3YW6Y+2slCALLySqvQIBv2h9/CrQ+5TRrvN+FFPCe8Hwnz t+Ox5NydrMIRTQFJe+9FIBI5zm+m2cp0HxeeC3PSYibfdzCoS4wycFyTxd8HnhiRkErF vQgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716998361; x=1717603161; 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=l2RowXhHBbxrob+0bISMh+r0iXs06Afi5Oflt9v9bTM=; b=fQ1927byyGBsrAnNHCOe0UoQRWQxdOptuqdrhqUQ7oGXfRQXrQ3qyQSKNUvmh4SabV 8WVjVjTKOhGWlCYdxYdslbMCNBQeoj5zUJWBJt1UIYAEFt718UIZpxm7gVx3MWXRrgfc mf8l375Ee0Sifu8duQZ8fRpb1CuaiXrcna2DJ5nRJs/L7iMQkoKL6wSOZBQWdCV2iZSk s5z2fcqL53LegZtNcr34iZPJuyasaI0DQXZ05x+k845zZ3Q5Eo97UJ1EE4FTjVIzeqaa ybQudWOO5s/9gq7Gev9OpK2BogJz0BODWFha0LxuVsxAD2vIOFq+haijE0d2OweemX3Q VQNQ== X-Gm-Message-State: AOJu0Yw0N2AMtJKAvyGg3jW1sYHjQ95LlGayo7K+VvaWUV14/1SiafLC ewbku979MiKvBVufod2mBpxKWL38foxEWhnLW96KVZeOOiTP/MbssQ5LqqWuCU9HTEKh1Mvf+sb I X-Received: by 2002:a17:906:280a:b0:a59:dd90:baeb with SMTP id a640c23a62f3a-a6264f0ef79mr1168884866b.48.1716998361018; Wed, 29 May 2024 08:59:21 -0700 (PDT) Received: from m1x-phil.lan ([176.187.204.141]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc519cesm728607366b.113.2024.05.29.08.59.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 29 May 2024 08:59:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH] accel: Restrict probe_access*() functions to TCG Date: Wed, 29 May 2024 17:59:18 +0200 Message-ID: <20240529155918.6221-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::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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 This API is specific to TCG (already handled by hardware accelerators), so restrict it with #ifdef'ry. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- Based-on: <20240529155548.5878-1-philmd@linaro.org> --- include/exec/exec-all.h | 7 ++++++- accel/stubs/tcg-stub.c | 14 -------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index b6b46ad13c..72240ef426 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -301,6 +301,9 @@ static inline void tlb_flush_range_by_mmuidx_all_cpus_synced(CPUState *cpu, { } #endif + +#if defined(CONFIG_TCG) + /** * probe_access: * @env: CPUArchState @@ -357,6 +360,7 @@ int probe_access_flags(CPUArchState *env, vaddr addr, int size, bool nonfault, void **phost, uintptr_t retaddr); #ifndef CONFIG_USER_ONLY + /** * probe_access_full: * Like probe_access_flags, except also return into @pfull. @@ -392,7 +396,8 @@ int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, void **phost, CPUTLBEntryFull **pfull); -#endif +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_TCG */ static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb) { diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index dd890d6cf6..7f4208fddf 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -18,20 +18,6 @@ void tb_flush(CPUState *cpu) { } -int probe_access_flags(CPUArchState *env, vaddr addr, int size, - MMUAccessType access_type, int mmu_idx, - bool nonfault, void **phost, uintptr_t retaddr) -{ - g_assert_not_reached(); -} - -void *probe_access(CPUArchState *env, vaddr addr, int size, - MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) -{ - /* Handled by hardware accelerator. */ - g_assert_not_reached(); -} - G_NORETURN void cpu_loop_exit(CPUState *cpu) { g_assert_not_reached();