From patchwork Fri Dec 20 16:15:30 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: 852440 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp2148899wrq; Fri, 20 Dec 2024 08:25:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+45WRmO/Ludbi3Rw4/UjdB0403NrZ9OYCPMQnKlYTtwxLC75OrhG3wzkcfvX1LhQ+HC4NzQ==@linaro.org X-Google-Smtp-Source: AGHT+IHPpYcniLzNwznU+XAW5/NjT1FDDAFf8HeXmZSYNhUCVLXjxzpnW7ea4AqgYzLrmuzxMeUh X-Received: by 2002:a05:6102:26d3:b0:4af:e61d:e225 with SMTP id ada2fe7eead31-4b2cc360655mr4412929137.10.1734711927301; Fri, 20 Dec 2024 08:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734711927; cv=none; d=google.com; s=arc-20240605; b=eh2xEKl/shEaf75dkZjDCU9m/3vel1SSH30uCUHMEUmnN6po3Y0Dm6lo+QS2NCh1po 4tB3+nFIOE/f7CbZqe5Emc2/hpocLHB5DzmO6Kim6NnKXuExak/hgzxIejgwJorHWjb8 8xclIcmnBXphok6Pq875gXCZXuI8VV8S+Cn/R+2xaV0mqa+KjIOSd/Kjho14RhHGuyy/ bo6i8WZ7QYi1buhIm1zd1VAwhLnwRjB+WVPKXhG0VxPZdlxtQdlJyb2kOfeh4GjTjKqA tL6htqsKzjfWp99r8EBUQqmSvwGt/Dn0IIL+Gnc4sLavOcml6QRsMzCaGwIk1jaNDKz5 gxAw== 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=ySncAU20DLIPtQBH3XLZd0BEdgpTbpYKBukLqC+aRo0=; fh=jDzlsuVfu9yneD3KBOEB0ptb3EY+AtxVXbt7jaKLMXk=; b=cO1MUOhPbLGbI8haSD6J9sMfIwaq2TA6aTBksjaimU8VbxDFTycq4moN2KumECxMAg UCEhyLMw2aWex86hrE5DFr/2ydcOGPWvPi3EYWvvAW2wNV33+IFTt9eurHhtfuHEWorp Hg4NYr9jznHi7KE6zPNHcBTuKD4AUOWtgMgT4x1uonfPHaQ3gz53TmUYOVFc9FxfsEPG DpY7DDMWkwlTVq7o3ckKG6kt7uOl26RE7G8ZqQ+DNppRd3XFKoAhsGTILbp4HrwgsUWT olFc03skW/MAeMR2nQUM8nqwaRqdCVksHFakfK6l9TLlpUaEnMfLK78Ab6XK9PJaDQZJ WKOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=siuiBF49; 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 ada2fe7eead31-4b2bfb73170si1430774137.420.2024.12.20.08.25.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Dec 2024 08:25:27 -0800 (PST) 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=siuiBF49; 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 1tOfil-0003ox-4L; Fri, 20 Dec 2024 11:19:23 -0500 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 1tOfiJ-0001eN-6I for qemu-devel@nongnu.org; Fri, 20 Dec 2024 11:18:58 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOfiH-0008Cu-BQ for qemu-devel@nongnu.org; Fri, 20 Dec 2024 11:18:54 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-436341f575fso22781965e9.1 for ; Fri, 20 Dec 2024 08:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734711531; x=1735316331; 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=ySncAU20DLIPtQBH3XLZd0BEdgpTbpYKBukLqC+aRo0=; b=siuiBF49udzuJeKPE7n308Tu7YuYdLgqJvb3KuqTI5xcLDAxj3IjRSPzqmdct3tnsa CCJlvRMBJH31Hc2RUHfnI0Qbret7SsM+4YLDt/UY9+YYp6Ure1tNzVa6xgGZtKsXH79l 0CEHu3sIsf72roxCektX19KUS0VwUJm9TRd90UNyUASrMIocrzDezP5hoYWlgVZ7U0VW /1EdhYE7IybPr4M8003SQqXx3VOg3Yuhqo5N70AWJY3tJHGUY/pco3n2gE2iazhDwtta yBJfBfjjXGxMR/b8laTu0edVmp/51vq9zuHOZ0082LZGgYGSRGLlwj/poOW4EUQfCE3p YBog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734711531; x=1735316331; 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=ySncAU20DLIPtQBH3XLZd0BEdgpTbpYKBukLqC+aRo0=; b=vXvCP360R1mL1OGh4kwNdadu+I6XmDJf9XERPhBNLXXngoi0i6Xg/6yRIfQekvjY3w 09upuhNxDcZ/kkXWk2+7Jvtg9Ekt437/epGBCJSPm6pRVncvTm+S/jwbPTjm8Po+79Kp 7pBYLNf/1awRJDQHrhcWa69MvUJQg8yjupEFDRezoqgiNg4DFOGSxXkZm/31H8EElB2O 9/QWQosyym6P5xDRsopuGLLthVtd+cGCtbT5GqaTUxdRNBsFPx5Lx01JnbDR32nqu2i0 Mp26/bJ7k0ncecBOcC1CO7jfrHwjgGDAsMcype/qm54i/tt+Gkmn0x8ETW7eC5aO887X 0qqw== X-Gm-Message-State: AOJu0YxEdzzViLbRFN1/ye/2qOQLho2aYmGTZGp/JxegkkAqZTdAu1kj 0tdDVKdxTgeZttxIMmYpzvYDHV9SdtrgiYIjp498jzwRIK2mk+rlvsCCkztdK3AUaJyoiQ56Vbr n X-Gm-Gg: ASbGnctgsqgnPnkphSdLz5H7499I3mfzde834kVRCzyhlryMFM+Ay9mp1CIuCXD04kg fzCDhdcQW7+8ygTRRE+H4/nV1jBrBFcOH5hBqGV+xjmkXkaEFxywH9AUAwibprakhx+tz04Ikpj QG4Astd3GUM3MsgCsgDbFgO/dwnvLLq/SnS2EXqDmAazcMHd1QlqEfDqlJanEsezTotWizyeB42 Js2/INmoP++yO8bpzsuoQgiDmeLVh41HRyZzVe0FTV73oeZCrhlI8brW+l6bFirLg0am4TRevo= X-Received: by 2002:a5d:47cc:0:b0:386:144d:680f with SMTP id ffacd0b85a97d-38a223ff30cmr3604669f8f.54.1734711531528; Fri, 20 Dec 2024 08:18:51 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661218f43sm49922625e9.19.2024.12.20.08.18.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Dec 2024 08:18:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Richard Henderson Subject: [PULL 39/59] user: Declare cpu_loop() once in 'user/cpu_loop.h' Date: Fri, 20 Dec 2024 17:15:30 +0100 Message-ID: <20241220161551.89317-40-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241220161551.89317-1-philmd@linaro.org> References: <20241220161551.89317-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 Declare cpu_loop() once in "user/cpu_loop.h". bsd-user gets the G_NORETURN attribute. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-18-philmd@linaro.org> --- bsd-user/aarch64/target_arch_cpu.h | 2 +- bsd-user/arm/target_arch_cpu.h | 2 +- bsd-user/i386/target_arch_cpu.h | 2 +- bsd-user/qemu.h | 2 +- bsd-user/riscv/target_arch_cpu.h | 2 +- bsd-user/x86_64/target_arch_cpu.h | 2 +- include/user/cpu_loop.h | 2 ++ linux-user/user-internals.h | 1 - 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bsd-user/aarch64/target_arch_cpu.h b/bsd-user/aarch64/target_arch_cpu.h index b288e0d069b..87fbf6d6775 100644 --- a/bsd-user/aarch64/target_arch_cpu.h +++ b/bsd-user/aarch64/target_arch_cpu.h @@ -43,7 +43,7 @@ static inline void target_cpu_init(CPUARMState *env, } -static inline void target_cpu_loop(CPUARMState *env) +static inline G_NORETURN void target_cpu_loop(CPUARMState *env) { CPUState *cs = env_cpu(env); int trapnr, ec, fsc, si_code, si_signo; diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 517d0087644..bc2eaa0bf4e 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -37,7 +37,7 @@ static inline void target_cpu_init(CPUARMState *env, } } -static inline void target_cpu_loop(CPUARMState *env) +static inline G_NORETURN void target_cpu_loop(CPUARMState *env) { int trapnr, si_signo, si_code; CPUState *cs = env_cpu(env); diff --git a/bsd-user/i386/target_arch_cpu.h b/bsd-user/i386/target_arch_cpu.h index 9bf2c4244b7..5d4c931decd 100644 --- a/bsd-user/i386/target_arch_cpu.h +++ b/bsd-user/i386/target_arch_cpu.h @@ -102,7 +102,7 @@ static inline void target_cpu_init(CPUX86State *env, env->segs[R_FS].selector = 0; } -static inline void target_cpu_loop(CPUX86State *env) +static inline G_NORETURN void target_cpu_loop(CPUX86State *env) { CPUState *cs = env_cpu(env); int trapnr; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 04faee459df..3eaa14f3f56 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -26,6 +26,7 @@ #include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" extern char **environ; @@ -187,7 +188,6 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2); extern __thread CPUState *thread_cpu; -void cpu_loop(CPUArchState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); diff --git a/bsd-user/riscv/target_arch_cpu.h b/bsd-user/riscv/target_arch_cpu.h index a93ea3915a1..ef92f004803 100644 --- a/bsd-user/riscv/target_arch_cpu.h +++ b/bsd-user/riscv/target_arch_cpu.h @@ -37,7 +37,7 @@ static inline void target_cpu_init(CPURISCVState *env, env->pc = regs->sepc; } -static inline void target_cpu_loop(CPURISCVState *env) +static inline G_NORETURN void target_cpu_loop(CPURISCVState *env) { CPUState *cs = env_cpu(env); int trapnr; diff --git a/bsd-user/x86_64/target_arch_cpu.h b/bsd-user/x86_64/target_arch_cpu.h index 4094d61da1a..f82042e30af 100644 --- a/bsd-user/x86_64/target_arch_cpu.h +++ b/bsd-user/x86_64/target_arch_cpu.h @@ -110,7 +110,7 @@ static inline void target_cpu_init(CPUX86State *env, cpu_x86_load_seg(env, R_GS, 0); } -static inline void target_cpu_loop(CPUX86State *env) +static inline G_NORETURN void target_cpu_loop(CPUX86State *env) { CPUState *cs = env_cpu(env); int trapnr; diff --git a/include/user/cpu_loop.h b/include/user/cpu_loop.h index 8e2df232758..b0d4704018d 100644 --- a/include/user/cpu_loop.h +++ b/include/user/cpu_loop.h @@ -23,6 +23,8 @@ #include "exec/log.h" #include "special-errno.h" +G_NORETURN void cpu_loop(CPUArchState *env); + void target_exception_dump(CPUArchState *env, const char *fmt, int code); #define EXCP_DUMP(env, fmt, code) \ target_exception_dump(env, fmt, code) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 46ffc093f40..b9b05c1d11f 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -65,7 +65,6 @@ abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); extern __thread CPUState *thread_cpu; -G_NORETURN void cpu_loop(CPUArchState *env); abi_long get_errno(abi_long ret); const char *target_strerror(int err); int get_osversion(void);