From patchwork Fri Oct 1 17:11:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515101 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1028892jaf; Fri, 1 Oct 2021 10:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFPQFeZfo8HUcyV8xhDeK94nHOEW/O7ISizvAP1Uyhu2BE0Wbx3OIAlMAe/mbs2JC58JiV X-Received: by 2002:a67:e157:: with SMTP id o23mr947836vsl.25.1633110846950; Fri, 01 Oct 2021 10:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633110846; cv=none; d=google.com; s=arc-20160816; b=rXC7f6hyOgdqbYtCEohFcRwbK/yf8lX72UmJmUSGNxnXNhBSpyXvaT13BfivI21iii idwdZ1Uzt4mPNh0iXs1RixkOth8Inyv2Nzb/34ZnyATWXvjN4t6OY5tdGaNEJoDzB1FS WcpLlUdol+kpeebuq9if9fQorUXhC9bwksDbcB7ba5UI7VITERjCVhHyNzx0VbSvSz42 VJdo4qxAkR5O2wliBgUaqK0igLYpV1Rv6y/aIBnm6pOWezbtJPmVI8KTUkTekqd+ar8F lH8Omh/JYlnbFVungWoz45sJFMQxXudb4uD3sPir57CaMicV3bLMueJ+LVw34ey+o91G 84Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=iPL+UEtKoL8lJ1cyR3L2m8ieOZFTWfsG23UG08w8UQA=; b=k4iMm3KSLAXNaprlWikFhmMmVCLNzC4qsXV/P5KWiLO8n8mtqvASyWTqspsw2NOjlc l7fZlvxxWfK0F2Iixn1C+jXnq61wMVFWppuVFIMMo6WzAZDWdGrEAFRGqVfdnSKS6l1f y5+U9Ln7UntgFAf+lChhfn8fg8lQVYOT7oV0aJ4y9+4+nmb36pyWj70mlZ7oRyzGNmfh Rz4LbJCfTQEXqMKurzMt52B5OWzRFz8Z334Wbkt2FntfIuEjyl9rXlKpVamuFreMzo+x Uv11+tBfU1fwRWMA4A6KL7+i9smDPerUezwDCog5HDThPrTvN4/bM8E+WM9VEBz77clu Nh4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lAPempVc; 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=fail (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 r1si1332308vka.8.2021.10.01.10.54.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:54:06 -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=fail header.i=@linaro.org header.s=google header.b=lAPempVc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMjW-0005Vu-An for patch@linaro.org; Fri, 01 Oct 2021 13:54:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWM8C-00024X-9k for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:15:32 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:34319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWM8A-0007nf-Lf for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:15:31 -0400 Received: by mail-qt1-x834.google.com with SMTP id m26so9655851qtn.1 for ; Fri, 01 Oct 2021 10:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iPL+UEtKoL8lJ1cyR3L2m8ieOZFTWfsG23UG08w8UQA=; b=lAPempVc8wKoCpsCyl7WPizXjjoRoKUIKutQDgqLcxRhw7QBy0BxLYrht4oKg0isT4 zOlLhpP2bm7/id7TvMYJ1b+GU84WV8m4bso67TY4kY7v/wPtLZwCGzWtFks2nAHiU7gK C0YNteDLdHvMWlrjoi3jwWFPqcuv5FUruHTBldgQavauA0Qf+MgxbS9rWa+uYHBe8aj5 nP3Q2HN9ZyJBRJ5aB2+4dhh+o2wsWRInuzamwdveUZZTSWg7/PAU+O7zLaoUps+gMU0T 3PCTIIXnvUdA1plp4RL/+GgBR8riSefC4Xx35wKauR3oVbZgMUgJDgNzU/JZ6MV8iYt+ MLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iPL+UEtKoL8lJ1cyR3L2m8ieOZFTWfsG23UG08w8UQA=; b=aiZNJYvtjsMcFHxq3Ye1/sLymfsp5rj65kYGObqC5qP17i5rQSBR9c19JRXWdWfwGc zvh/2W4fCy7uAPhkSyLIMmUbYo2EZc6gcyj9mEFToj+V+eLFL+o+VFRQHIV0gF7rpDxJ SEsvZAfi5Ez3Yvv0fkRGjnMDSnPQbRZt72a3KiOMoiXLD4WglKlP8lJfu3H3dNCQvTp7 Sq4XYspFuRCzTgdxWuT3sJmbrSJ4c4BwzeZrv2S//g9EcRKqbcGBu/W0ByvR2tR44Xp+ lIsEOs8TWcgF7Y+4JSZP1R6aph19spEZg/HVkMVS2iujGjrwTrNLAoQKPPxxJgj0qAr4 ld/A== X-Gm-Message-State: AOAM531w7iRMaImzUuxhcDPNGVkA9+Pae7Ssn65a1WKnTSttp0ttUSAC odwQw76AOmF2NuMu4jgz1/7CWCm3vr3lmQ== X-Received: by 2002:ac8:5685:: with SMTP id h5mr14364478qta.153.1633108529762; Fri, 01 Oct 2021 10:15:29 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id l5sm3697516qtq.4.2021.10.01.10.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:15:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 41/41] accel/tcg: Restrict TCGCPUOps::tlb_fill() to sysemu Date: Fri, 1 Oct 2021 13:11:51 -0400 Message-Id: <20211001171151.1739472-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001171151.1739472-1-richard.henderson@linaro.org> References: <20211001171151.1739472-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x834.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-?= =?utf-8?b?RGF1ZMOp?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have replaced tlb_fill with record_sigsegv for user mod. Move the declaration to restrict it to system emulation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 22 ++++++++++------------ linux-user/signal.c | 3 --- 2 files changed, 10 insertions(+), 15 deletions(-) -- 2.25.1 diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 41718b695b..8eadd404c8 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -35,18 +35,6 @@ struct TCGCPUOps { void (*cpu_exec_enter)(CPUState *cpu); /** @cpu_exec_exit: Callback for cpu_exec cleanup */ void (*cpu_exec_exit)(CPUState *cpu); - /** - * @tlb_fill: Handle a softmmu tlb miss or user-only address fault - * - * For system mode, if the access is valid, call tlb_set_page - * and return true; if the access is invalid, and probe is - * true, return false; otherwise raise an exception and do - * not return. For user-only mode, always raise an exception - * and do not return. - */ - bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr); /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); @@ -68,6 +56,16 @@ struct TCGCPUOps { #ifdef CONFIG_SOFTMMU /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); + /** + * @tlb_fill: Handle a softmmu tlb miss + * + * If the access is valid, call tlb_set_page and return true; + * if the access is invalid and probe is true, return false; + * otherwise raise an exception and do not return. + */ + bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); /** * @do_transaction_failed: Callback for handling failed memory transactions * (ie bus faults or external aborts; not MMU faults) diff --git a/linux-user/signal.c b/linux-user/signal.c index 8c22f711f1..d32bc5e1e5 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -694,9 +694,6 @@ void cpu_loop_exit_segv(CPUState *cpu, target_ulong addr, if (tcg_ops->record_sigsegv) { tcg_ops->record_sigsegv(cpu, addr, access_type, maperr, ra); - } else if (tcg_ops->tlb_fill) { - tcg_ops->tlb_fill(cpu, addr, 0, access_type, MMU_USER_IDX, false, ra); - g_assert_not_reached(); } force_sig_fault(TARGET_SIGSEGV,