From nobody Sun Sep 28 17:04:57 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756336959; cv=none; d=zohomail.com; s=zohoarc; b=BKWfXdqs0oMRhSrauZJ2JoXMk+j43BUk7+HtX11S4TTDVI4VL+5cHwVVy+z/uQnj+MG3zU46yyUEhVg3FiujCHfogwdNJWoaV9l5z4S8eNB3gYKQIrB9MO4QBrFwN/9JhhEbfBQEXrbZhXxLZmMHlnT2e1MwF8+P4cNtGHmgHPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756336959; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HsK1dRAVucN5uYDjY51g3VI30aLAIpvpyFsxl3c/Nkw=; b=ZyWxJi6hjgOXARMU1nGhjjo/n2NswIlvEmOqfnT0hrZzw7G9ln3wqbRDHiiEbC64gCE/ZPCY+oX6JnyrWZ6vHwFZ5q4UO5cbY5SvxYFcQlVPDViQ5vfq6QojCrA6zrK8f+BxRwyF6v8kgcInZeJIf48f+JDxLtFAQoItp9Yd8RA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756336959116952.5269235900356; Wed, 27 Aug 2025 16:22:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1urPTC-0005CJ-JS; Wed, 27 Aug 2025 19:22:22 -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 1urPSy-0004WI-PD for qemu-devel@nongnu.org; Wed, 27 Aug 2025 19:22: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 1urPSv-0004LO-0P for qemu-devel@nongnu.org; Wed, 27 Aug 2025 19:22:07 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7720c7cbcabso297102b3a.3 for ; Wed, 27 Aug 2025 16:22:04 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7703ffebd33sm13986886b3a.29.2025.08.27.16.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Aug 2025 16:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756336923; x=1756941723; 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=HsK1dRAVucN5uYDjY51g3VI30aLAIpvpyFsxl3c/Nkw=; b=IXViq7418Yle243J2NUEIOryzZlzRknRLwPPPXkM56j5g3/5f/2QHq62BbNpVDY4Nu HPJMACCyTIYYumgYiwu+B1PzGQ5cXLeAyPxO5OIRB+deoNaYXeV8f0zXoBeZ1DM/SaSJ tcSRCTtiyHDLYYyUxfxXVs+6t1UhmOVMaTt4PyF4xWNA6avdkW+o5lcXfmJdwlre3v9o g13ErJYt/e/bpD+BM9Eqdg8JOnlaDOCmKklhpsjtVCZQh8aL/ppETCJ7XFLS6cf79w7d Y5z3MiZHjO+oA9xkLbhvYAwmlsxO2FZx9iQDEDEzX1VMyxLFLcnkeHg17invVymjnToq 4ceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756336923; x=1756941723; 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=HsK1dRAVucN5uYDjY51g3VI30aLAIpvpyFsxl3c/Nkw=; b=Bw4Gu/jpPBwbZVQ8BM7drIUWgOKrh+DE+WQx9hFejv+muJrGEf5hOBWgHnzMzm2a1V SJA1Lr9N+L7qGMQx8P31Ce93epdRy+rI7usxic/odROufmTiLMy7MgY4n9SUsghmuDdw SjpLbs6m+pYaD/t49O9fChlKeOA4SGkytDk2/qmnOJiM12IebKnLxd4YfUKt6zy2W0yn pKGYmXJjh5GsO9qQ8s1WyN2ZyntBWocLUQLEVn4ewRWWlEc3zJusNlHDBq2tDPLBIEpA admTvt0tnm9KzDBAEiKtYcPjfABEDwT+Mv/ifdV+N0X4K8gx8LFfbI+NDo3szjkqdOfD +eAQ== X-Gm-Message-State: AOJu0YzTnbYzCoShMNsbqXdvKwsnyHxYikVcjIK6qholX2Ap2XRuE4d+ EfDDeYlrA9IKb3kmRk/nIp7v+bNxlJ2u1BwcGdHA6RsxvfcyVygCvXWDnc76mRJ6Id2xD8t5po+ 3hCfqhJQ= X-Gm-Gg: ASbGncubno18kUPCY5ue9D5P+fm6ys9OAckzNwXCGLkvRB+94L0KfG/6LIN68N+vRXH pvKfu1fQiByuechW4Ptylqe1d8Z4deGbTczcUt3GlvDBAiCFQJlgkhDo+8HpG9Pk+80uB6Drrvz bFYRyiJsENWuxHL13hx4qW/YQm6yLyShWOiueGp3USCreekbJHV87PCM6GXFznUzjla/nQwRj9x 6TMDesX3oKbbquv+hY8JXnwhC/9MWpcMLhXQ3PkHbyaZsT3gHYBv41ol05fz/zqmwwXW3cpu/6j dx+UI0G8VOUbZhDvcLh1PtxXwwALUehY+ytVFuB6JwDM0OzZrdKI8Z2w1YuGkCzo164qm731dUJ cTuyR4gWN1MqBI5Iunw3x+mHnyDfx6Aj26SxN X-Google-Smtp-Source: AGHT+IHQa6/mY7sGgMUeuf3h3bGunarCvSRhaPq2raCSBaVeAGfePEfum9Tnex4L9Ws6q2Tc3yzD5Q== X-Received: by 2002:a05:6a00:398a:b0:76b:d75c:8a76 with SMTP id d2e1a72fcca58-7702f9d90b9mr25706648b3a.1.1756336923420; Wed, 27 Aug 2025 16:22:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 34/46] linux-user/microblaze: Create init_main_thread Date: Thu, 28 Aug 2025 09:20:11 +1000 Message-ID: <20250827232023.50398-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250827232023.50398-1-richard.henderson@linaro.org> References: <20250827232023.50398-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756336960738124100 Content-Type: text/plain; charset="utf-8" Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 +------ linux-user/microblaze/cpu_loop.c | 39 ++++---------------------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ac96755b06..3f9ec49359 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -640,13 +640,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *r= egs, const CPUMIPSState *e #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_MICROBLAZE =20 -static inline void init_thread(struct target_pt_regs *regs, - struct image_info *infop) -{ - regs->pc =3D infop->entry; - regs->r1 =3D infop->start_stack; - -} +#define HAVE_INIT_MAIN_THREAD =20 #define ELF_EXEC_PAGESIZE 4096 =20 diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_l= oop.c index 87236c166f..d8277961c7 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -127,39 +127,10 @@ void cpu_loop(CPUMBState *env) } } =20 -void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) +void init_main_thread(CPUState *cs, struct image_info *info) { - env->regs[0] =3D regs->r0; - env->regs[1] =3D regs->r1; - env->regs[2] =3D regs->r2; - env->regs[3] =3D regs->r3; - env->regs[4] =3D regs->r4; - env->regs[5] =3D regs->r5; - env->regs[6] =3D regs->r6; - env->regs[7] =3D regs->r7; - env->regs[8] =3D regs->r8; - env->regs[9] =3D regs->r9; - env->regs[10] =3D regs->r10; - env->regs[11] =3D regs->r11; - env->regs[12] =3D regs->r12; - env->regs[13] =3D regs->r13; - env->regs[14] =3D regs->r14; - env->regs[15] =3D regs->r15; - env->regs[16] =3D regs->r16; - env->regs[17] =3D regs->r17; - env->regs[18] =3D regs->r18; - env->regs[19] =3D regs->r19; - env->regs[20] =3D regs->r20; - env->regs[21] =3D regs->r21; - env->regs[22] =3D regs->r22; - env->regs[23] =3D regs->r23; - env->regs[24] =3D regs->r24; - env->regs[25] =3D regs->r25; - env->regs[26] =3D regs->r26; - env->regs[27] =3D regs->r27; - env->regs[28] =3D regs->r28; - env->regs[29] =3D regs->r29; - env->regs[30] =3D regs->r30; - env->regs[31] =3D regs->r31; - env->pc =3D regs->pc; + CPUArchState *env =3D cpu_env(cs); + + env->pc =3D info->entry; + env->regs[1] =3D info->start_stack; } --=20 2.43.0