From patchwork Wed Apr 30 23:06:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 886087 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp56917wrq; Wed, 30 Apr 2025 16:08:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXnYea6lCE0/Gpi4vJKjUsALSCuJn8kTtc4yhFvQCBJUl+gFDskRMvOMU2toUyjX+m3Vam0GA==@linaro.org X-Google-Smtp-Source: AGHT+IHbdqS5B+IyW7b3qZVllMpQGWdi9Wam790vlUXojfR+UP2tc9gUIaBanDaPc+B28d8XqQ+G X-Received: by 2002:a05:622a:4105:b0:476:8fcb:9aa3 with SMTP id d75a77b69052e-489e4a8c6dcmr83997111cf.13.1746054488775; Wed, 30 Apr 2025 16:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746054488; cv=none; d=google.com; s=arc-20240605; b=UKpQ7b79yDk8m65eQtub9DVa78hD49gnwdt7KhB0sfzG2iWcaNlatDHnEF+4+vo161 ez6HnpIQZagO1y0E1knPMt1pkkxLDLbM/pn2Sm2ekSkLqizi+Tsx4Eip3wwuSJSAAk0z EcLY3MG5mcgYIv7A5zOTCLLoXGBq83n3gaHK1tKqmHS5eZe+v4DA2ZXKZkKjTC1u1nRg rHRBjFvgfT7CvgaqyoERT8tQVKl74Laz8N6T041YvlqIc5Oe0QehrkS6WV78itCGIdm2 x6aKFI1svPn/W9kCdJXVQSqeFEvZdUQbXfW4gbY11aqVCCSIdfXbOOw0bov/fdztegwE 2V0A== 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:to:from :dkim-signature; bh=LT3GsVAW+K3YxYOzK2RrjUaER8kwWH4wBwdfp6giJSE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kI5gcSUNXb57skH0o0rLd3PLGTv/fpoCPtLk2mPJYWuBL5fE6sRxfQYD/56Ia+odX4 9fAuS9WXy3rlhKp0mOVYXGRSzdC6FqW57UZ3MWxUypC5ezvRmn1Qauu7Vwi5uvsBIhEn o6M59MKx8sr9TGaC/Qt+Z4dN1TAmotMC6MaVX7WOLmI4O2eUUQ8MxXn4ujtX7vjfYPs5 diy3CS3inLnN47YLNVRZR6m8NNOi0bNGKUt3ZWFwTr6YEsBWfO2hgkxICaSfSYC/n3Bw L9KV8zfuqtOlOtKeuXbXta4tkjHOkCdALaB+bb/EUhjIYiqT+OTdtOyW5V6lT5cIYiY3 bTWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WoiVWTzn; 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 d75a77b69052e-48b0661b484si3836561cf.13.2025.04.30.16.08.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Apr 2025 16:08:08 -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=WoiVWTzn; 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 1uAGW8-0001qj-9Z; Wed, 30 Apr 2025 19:07:04 -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 1uAGVl-0001l6-2y for qemu-devel@nongnu.org; Wed, 30 Apr 2025 19:06:41 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uAGVi-0007Vb-B9 for qemu-devel@nongnu.org; Wed, 30 Apr 2025 19:06:40 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-736c1138ae5so450078b3a.3 for ; Wed, 30 Apr 2025 16:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746054397; x=1746659197; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LT3GsVAW+K3YxYOzK2RrjUaER8kwWH4wBwdfp6giJSE=; b=WoiVWTznZNVzzj/X3wmz5+uuvk2DnecEhbfOHAdHfEBo8QFedM/7HihsTfxgw5LjTT Q3CTGrpsui7e1qKAa5WjYuyXR3OMc4FAK1G4eALo/vXr5nH0FDbUjlix13f3I5NzKihZ +6mds2qzlUcrwfbR+Sm1Dwy9tyc0CSy9T01NTNYPkr3TC2LN0PnbcGSjJ73jLwum1aKm wLA1se+iXYWhtirG1xp1UmgyCRbArke6Fy5pZ7YASxyiFZRr/WpY2gq0/mN9eANZI4D0 0ErW23LVGIqhHjU9xe1tJjb3BI9QKZRK3PRAzkbkZxOzjC/aKtFDvREj1u4gxhBVH71H RxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746054397; x=1746659197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LT3GsVAW+K3YxYOzK2RrjUaER8kwWH4wBwdfp6giJSE=; b=GCFa/uSsT5FWEtDeKOmTa+CFWcREcRVgYYGdUwVaLLH72R+AA7qDwsZoYkWud2X/J1 ohUhiqG38iHvygFep0go+n9N1aJksXx9IYiRfLIqj59e7aHjb4WYeNanlsuGOYMs9WjD 19/rhA5XILCT3/IRavWpUcS68S7EJIDo4O//onVPDljxsx2lXytWv6N9UxEtX0SJOMCS D6Xq/HBzufPBdlbzWAnOpUntRdHCJV9vpEGFRYRC5Gm46lidRrbl8+n/RqdjJNdLB2kN fApXqq7utuyC5idGsCGua6R+/fe/Wo/GQtwCGOn5u+uOio8lmBzF96ssPjfLdJlKhQ+0 waFg== X-Gm-Message-State: AOJu0YyJ8Jrmz6XmepJDbS0Jw/h/6IMa3FQpR3w9x2C3YqILZ93ETOs3 lhmK4rA1IgJXJ+8qRgNkNdxOgbo8cKmixdC/STez+rjLSZH4LmFBJk04QgiKTKLLRYuYC8dvFLl I X-Gm-Gg: ASbGnctqqRK4jU5GNIZSmV3QdygEwy+TWauM9EJwNa/wP0GMUPhNOvMrcG4chyhxS2P PT4ncvbPVFRYcOSMWm3TqvWqF6UggK7P6cXgqi8wMTvaHR7wMxDCItgoNWROkohtQSr/hdbvMQG u2b6Yd7f6bKJduoyizYolJoI3l53wOCGm+UNEWAEMyB6Y3fU0FL9ex1GcJXy/b34bpPnQhzulhF +LsQAa0w49lsvqc3UYyZ/OMuvTdEZaFzpHS3SOywYCH6QiaOghxcxRgFT4Hq8gXT3PEKAvztqkx AdMorufIHWjGC1i5QoA9ipz1QZlakCb68Ubq2tRRJEPZY1F38mbQL0pWVUnqcq1rV3i25opgOyx 8ENBq0uY7Bg== X-Received: by 2002:a05:6a00:3a06:b0:736:5c8e:baaa with SMTP id d2e1a72fcca58-7403a75b4c4mr6766778b3a.2.1746054396900; Wed, 30 Apr 2025 16:06:36 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74039a30e2fsm2323287b3a.103.2025.04.30.16.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Apr 2025 16:06:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/6] accel/tcg: Use vaddr in cpu_loop.h Date: Wed, 30 Apr 2025 16:06:31 -0700 Message-ID: <20250430230631.2571291-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250430230631.2571291-1-richard.henderson@linaro.org> References: <20250430230631.2571291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/user/cpu_loop.h | 12 +++++------- accel/tcg/user-exec.c | 2 +- linux-user/signal.c | 4 ++-- 3 files changed, 8 insertions(+), 10 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/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;