From patchwork Mon May 5 19:50:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 887445 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp2220162wrq; Mon, 5 May 2025 12:50:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW/8wsqppqpYRtUbZzZwrCJWo1tbw8G+WS41DMBrrASu173shns4S3DttzGeLuvGrigKkIUDQ==@linaro.org X-Google-Smtp-Source: AGHT+IEkpTiKGwq5UCu9xxYUXTves02cwxtEx+5JGpfRAnQxKg3IaaJ6qyeJwDd7neu/AvauEaZI X-Received: by 2002:a05:620a:6014:b0:7c9:4bba:1ac0 with SMTP id af79cd13be357-7caf081b976mr115258185a.9.1746474659123; Mon, 05 May 2025 12:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746474659; cv=none; d=google.com; s=arc-20240605; b=HcPxY0NuyD3DpovWHE11oMKy4BbKSzdFXm1RA66bS7naTUG30iKGH1lLn4oQICyfeq cuOdOIzqWCQ9Np7coU/pdLjIaYzXKi6K/3Gyqm0gANPACykkZ8ZOF17KQ/pEhs7cxaZl T+SQRtTCPBL+zD3worg5IMAP9JpHQxJvHjaWFz/XqOzXRIibvBzRbE0w+qGwsMaTAV9Q AHNPst7Vm8GuULat09j3DeCn6ryNFPyGHWQdduMuwd3GkgsVE9AfhJZUAXrED61xJD1A vwtbC6WmS/q4R9RGmP2dHP8BIWVOiDfeiPpaQaixbnP9zYLl2oeRBorDw9ynUjaQrQ32 Q1Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=yR1HKmXCPfGdsdtQ5AgCLnBtqE1jcfbBbaMp/JIfNKs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=i0JHzvw19hdJUcXeQEmbGxtMB3o1aqB1n1eTozxwYDYp+T5wmRTYPDVPwMxl1wXlD+ Ut2Se9+klNWpNhrlByD92Zu0uH4pKoe2MNA20k0gg9G0iJgAX9+MVw6LZFXn8sDYHcuS E94HdUnx5HXm4Io272DBXsvaApXkNc/mQO3iAYoHD+6pu0+5beUtKnwaN8Mt3NDpZK/k TokftMnFl49vyC+n/GppZ6PR5L3SY2Ki3mFdn3Pnqgy9ICKoFiGB9Eg5HFeG7PT0PHII 9WzWcAl8N3vFM5KUDoWXtbyE7LHAWXXSKdQh1UUsdBlmNxwHOPCvgoROuQ+LR/B3uet4 YnFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HXjJxSDa; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cad2435c9csi980271185a.422.2025.05.05.12.50.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 May 2025 12:50:59 -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=HXjJxSDa; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uC1pK-0001Z1-IL; Mon, 05 May 2025 15:50:10 -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 1uC1pI-0001Xr-ME for qemu-devel@nongnu.org; Mon, 05 May 2025 15:50:08 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uC1pF-0004jf-HF for qemu-devel@nongnu.org; Mon, 05 May 2025 15:50:08 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7399a2dc13fso6969290b3a.2 for ; Mon, 05 May 2025 12:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746474604; x=1747079404; 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=yR1HKmXCPfGdsdtQ5AgCLnBtqE1jcfbBbaMp/JIfNKs=; b=HXjJxSDab6qNv/f2GYxTW3pEYie+e5XMl7cVCCepNGqrbYhaanylfDesxOES6DAKbL xX1S7UDFdbdrIk0mYjwpP9+deRfPWQxInZ4OdeItYFuiMQhSuY5nysFf98tY4ycgajmI DNSLkMlQ/z5YFHJfKVhcy45J4sQcFTyNYg6XZGUImbUhazrROumZCGhm/eQm7bmfbAw4 Ps+SzAxF1YhgnOKrGBX/4xqPaQsqGGfVwnJIc2S4oK0OKTjQ/WtHd66uq+2IjglhIieQ LaVBKpBlXVb2Bf3x5XUlVgn4NLMBuRgObe4hH99bjtlw8zcsdpJpzu7KqtuCZLkZxaGF tzhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746474604; x=1747079404; 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=yR1HKmXCPfGdsdtQ5AgCLnBtqE1jcfbBbaMp/JIfNKs=; b=NjRRcV9fJqE7KnkJPQKQSX520AN6ybHGnD18dJIwyso1wWDZZJkf/z3r5SaAsCzgQs iMBJqCvyihdezA1GE6qFNsagdfP2uO16nziywhJpeBqsLGk3lSSIg+5IyT8iv+Nwksah jN+EF5neprSSMinC63uQALfXnjcW8okxJZCJ5YBy87y2Q040imHOh2wGsdsBpqbBcC1T lFsAq2dDKKDnqbwnAa9RxFNnE1qjsscC8jtPj9SbgTZ4GfsumqJHLF30HyQ71pbhWNcs O2EFzFiDewURxW8c84+GvNxO8Iu+kig5JViFEo8WlYvSI9G7n6k5UJSmh3x0sjK4TRrf Ldrg== X-Gm-Message-State: AOJu0YwaRuKURkex/rl628KacEkMC7umx0q+V4K4QYYa7codqevWg8ZO jCr0p0YKvS0JgepXZpIrfpv2QmPI9pavTShj4YzRTCOyiZw+EviaqPaX/ehdIBUMNhWrPjdHHDT 4 X-Gm-Gg: ASbGncv4U9dMfkUK986nAFRgB9jJujSmz7OJjxRg725Hupz9mZGpI2pybdQeZKEHfKp kLFTT+GANFJkiqNXiZmaCTX4Vfwwxgazd7D0/lem/Q3iPRbqK0mIjumadICd/4lOzRlfYhYSvlk KxMx3Xiztfu8p9id6MHP/Ygs32eQhsjlgdXe4oIsTeUygd9TzIjgPG6gT7VhUi3ebq9ZSdj40j7 we1aOi2QnkIzoh2n/SPisc1080Nlc25TNYAS4ZUOAJcg4c732Axp/bOFfYGdM0pedPJJ1qEwOjf 8Suze9LqDJAIcyu7sDnJsOO2ewPanO4y5opJA57OvL3J20F7vN1KbcQ7D4Zo63wD/pFO8XmX4Rs = X-Received: by 2002:a05:6a00:ab86:b0:736:a77d:5412 with SMTP id d2e1a72fcca58-740919f4923mr652186b3a.12.1746474603738; Mon, 05 May 2025 12:50:03 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74058df2a6csm7275900b3a.81.2025.05.05.12.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 May 2025 12:50:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL v2 48/59] accel/tcg: Use vaddr in cpu_loop.h Date: Mon, 5 May 2025 12:50:01 -0700 Message-ID: <20250505195001.3479169-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250505195001.3479169-1-richard.henderson@linaro.org> References: <20250505195001.3479169-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 Use vaddr instead of abi_ptr or target_ulong for a guest address. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/user/cpu_loop.h | 12 +++++------- accel/tcg/user-exec.c | 2 +- bsd-user/signal.c | 4 ++-- linux-user/signal.c | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/user/cpu_loop.h b/include/user/cpu_loop.h index 589c66543f..ad8a1d711f 100644 --- a/include/user/cpu_loop.h +++ b/include/user/cpu_loop.h @@ -20,11 +20,9 @@ #ifndef USER_CPU_LOOP_H #define USER_CPU_LOOP_H -#include "exec/abi_ptr.h" +#include "exec/vaddr.h" #include "exec/mmu-access-type.h" -#include "exec/log.h" -#include "exec/target_long.h" -#include "special-errno.h" + /** * adjust_signal_pc: @@ -46,7 +44,7 @@ MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write); * Return true if the write fault has been handled, and should be re-tried. */ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, - uintptr_t host_pc, abi_ptr guest_addr); + uintptr_t host_pc, vaddr guest_addr); /** * cpu_loop_exit_sigsegv: @@ -59,7 +57,7 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, * Use the TCGCPUOps hook to record cpu state, do guest operating system * specific things to raise SIGSEGV, and jump to the main cpu loop. */ -G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, +G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, vaddr addr, MMUAccessType access_type, bool maperr, uintptr_t ra); @@ -73,7 +71,7 @@ G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, * Use the TCGCPUOps hook to record cpu state, do guest operating system * specific things to raise SIGBUS, and jump to the main cpu loop. */ -G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, +G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 68e01fc584..e1f4c4eacf 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -126,7 +126,7 @@ MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write) * guest, we'd end up in an infinite loop of retrying the faulting access. */ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, - uintptr_t host_pc, abi_ptr guest_addr) + uintptr_t host_pc, vaddr guest_addr) { switch (page_unprotect(cpu, guest_addr, host_pc)) { case 0: diff --git a/bsd-user/signal.c b/bsd-user/signal.c index 1aa0fd79d6..dadcc037dc 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -1030,7 +1030,7 @@ void process_pending_signals(CPUArchState *env) ts->in_sigsuspend = false; } -void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, +void cpu_loop_exit_sigsegv(CPUState *cpu, vaddr addr, MMUAccessType access_type, bool maperr, uintptr_t ra) { const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; @@ -1046,7 +1046,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, cpu_loop_exit_restore(cpu, ra); } -void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, +void cpu_loop_exit_sigbus(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra) { const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; diff --git a/linux-user/signal.c b/linux-user/signal.c index 4dafc2c3a2..cd0e7398aa 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -750,7 +750,7 @@ void force_sigsegv(int oldsig) } #endif -void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, +void cpu_loop_exit_sigsegv(CPUState *cpu, vaddr addr, MMUAccessType access_type, bool maperr, uintptr_t ra) { const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; @@ -766,7 +766,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, cpu_loop_exit_restore(cpu, ra); } -void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, +void cpu_loop_exit_sigbus(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra) { const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;