From patchwork Fri Oct 25 14:12:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 838343 Delivered-To: patch@linaro.org Received: by 2002:adf:e287:0:b0:37d:45d0:187 with SMTP id v7csp306031wri; Fri, 25 Oct 2024 07:13:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXICMske3kz41EWHoQcCC7essREYvrVqdJdJDyl0//aEqLR0HTpmMk2gr9rXo6LXqU72T/5Kw==@linaro.org X-Google-Smtp-Source: AGHT+IEeBYARNG/fWtzt+IOENpoV33SqrWuoZUXCsSmxQisSpsSSygPu7ojROPSvb+AoupJpJev7 X-Received: by 2002:a05:6358:9106:b0:1bc:7c08:81c6 with SMTP id e5c5f4694b2df-1c3e4de4c50mr378676955d.28.1729865631876; Fri, 25 Oct 2024 07:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729865631; cv=none; d=google.com; s=arc-20240605; b=beTaomytVDCJxNlUJ2u9CfCBW0FkGQ2U0/WvyMsSnvtgQx+pjDLONEQf8QhmsOcKK0 hDXrY07jlOdNdb3VTaeNPi90JdUjav4GRx5bVmgRKsjO/1WA/oCIk8Yf+Eys/SJ8yGQo aJ4QK18qoZpyTOaGSzUM7oZiqBfyqJLxWJfXH5AX/lJXJS9Ud1AMGVCtrotmpWY/Tkp7 qpK0CZsHGG3VPJg08ouK/EgP5jrpiddG4f3jz/a1AaHlyVf8RxELsuYEkKS5+RCvoQRh 9sW1dKXPJ1YZT2fkNOtxwCGAWIVWYY3ieBQo7io5UTYHNez9fKpq4xC1QcazaHWafTJr 1/lA== 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=mCkNXmPfCnwutAypvXIltADsiovUrFYgTsHQnSnupeI=; fh=uEm0laqCp7F0hzpu2pihqNpBVRWKY5qtwOvZMheZWSI=; b=cLy786ejgupPCo3zIOTraWhIacOOByn/ugVyeAoNSH5j2ksiJPqQUyvSVHBHMAzbgv CBdqoPbYA1wtw2nnjAZnmlYMOIou/Rbi2UF7xMDEB/dIvHEqe1k6l4eHuxFPZS/xc1hO mjXj5dXSzPL6Zvi47U6VNzXYPC8qYIPnnhxH4/Hxikr3BwDxBX2jeteVQb8hxPu5pAg2 iTgGTiXq2f8ROLaLWx2OXrdRDGGLfgmfLQ3I5m9xsKnUwuDIQ9M+lwCyrkRi6rdMEcuM ftGeD4SwH9wFFW/UXe5y3t46YKOU/UdmemXjAYbHZ48rW15fx+kUPyjSX1D8AW9dg/5u 5DBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pca3dyA0; 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 6a1803df08f44-6d179a11016si16533046d6.229.2024.10.25.07.13.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2024 07:13:51 -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=pca3dyA0; 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 1t4L4E-0004TC-Ow; Fri, 25 Oct 2024 10:13:30 -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 1t4L47-0004Km-8m for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:23 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4L3x-0007tl-3Q for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:23 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43161e7bb25so20292815e9.2 for ; Fri, 25 Oct 2024 07:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729865591; x=1730470391; 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=mCkNXmPfCnwutAypvXIltADsiovUrFYgTsHQnSnupeI=; b=pca3dyA0DUBtE/UZ+t+nbehNTEGr0PcZJrjxxZux1SDTYiAoHoVAxirQb0lEFRSTff M+8TK5ftfu2AmIzHGAhANFHIrybvu/rbdrR9iOX0YWZlIF2AVN8q1LbpyF1ChOaqTmB9 +kqJZ+sv6Tkhb8s1q3WrbKB63JN2xYe5z05Lb1fRA5NHFRZhWw2b3UPwBcaYt7h8zmVg Bv1Ql4ZXRhiQg7QJfpU6WQNk2nfhw39o9Et1J2KKsSL0CCXnzb0G+A++hOshHsN9w/wI /ya39ESiS9Z6+iGx5iL55AYEG+E4NOlZAnMyy7pnDlNXSFGLHH7llbuXHi9V36j8GEYc 3IJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729865591; x=1730470391; 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=mCkNXmPfCnwutAypvXIltADsiovUrFYgTsHQnSnupeI=; b=sZt5VzfVXDKspvu++NhGK6GR3A4ylNyjJh5FyDkuGIjHofc9FHl1tt1wJS7m/aBP+U jL1mjJTx/zcDbG6xDzyZ68NZ5a1Tqf/YD4NZgY7gts5Vam/M4Gqo0MkV2u9A4jQYB0gf mutdQFR4Co76bE5nygNOevnRghSoudgKKGwk41Lw/sjncl3YWumhsb/OxNlyxkTpf1Sk lRji3Msenpx/r84Ma4KlkSqPMrGBC3g3mVNbxYx8wXTcNt1TE+Wdkf0EZKtzI8bOh5nk I1Cs/zeCRaitfvOI01FITlFssR5WDX2xhdjkWnP07OrnuMtN6PmIqeg2c9XNsRhyFUG7 8AeA== X-Forwarded-Encrypted: i=1; AJvYcCUEZdfuSd+H4Q1OmqiroKr7gBMSvPudllCJdPRi3doP0dHpZr93GR5FkLjAW+9bMkO9I/GSS+VFsAtJ@nongnu.org X-Gm-Message-State: AOJu0YxEgodaWx9mkvGS/tHne6hP1te8wfKS77/hOdGZ2AETr42fuHHx 5PqL+k784LAvVBMaTw+syCaoT4WWv37ex6fajndwj7Mdhpe6AD4pO2djxOJZ/+A= X-Received: by 2002:a05:600c:4687:b0:431:2460:5574 with SMTP id 5b1f17b1804b1-4318418ac7amr71250255e9.27.1729865591153; Fri, 25 Oct 2024 07:13:11 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b57b051sm50104535e9.42.2024.10.25.07.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 07:13:10 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Song Gao , Eduardo Habkost , "Edgar E. Iglesias" , Jiaxun Yang , Aleksandar Rikalo , Stafford Horne , Nicholas Piggin , Daniel Henrique Barboza , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH 17/21] target/microblaze: Move setting of float rounding mode to reset Date: Fri, 25 Oct 2024 15:12:50 +0100 Message-Id: <20241025141254.2141506-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241025141254.2141506-1-peter.maydell@linaro.org> References: <20241025141254.2141506-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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=unavailable 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 Although the floating point rounding mode for Microblaze is always nearest-even, we cannot set it just once in the CPU initfn. This is because env->fp_status is in the part of the CPU state struct that is zeroed on reset. Move the call to set_float_rounding_mode() into the reset fn. (This had no guest-visible effects because it happens that the float_round_nearest_even enum value is 0, so when the struct was zeroed it didn't corrupt the setting.) Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/microblaze/cpu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 135947ee800..6329a774331 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -201,6 +201,8 @@ static void mb_cpu_reset_hold(Object *obj, ResetType type) env->pc = cpu->cfg.base_vectors; + set_float_rounding_mode(float_round_nearest_even, &env->fp_status); + #if defined(CONFIG_USER_ONLY) /* start in user mode with interrupts enabled. */ mb_cpu_write_msr(env, MSR_EE | MSR_IE | MSR_VM | MSR_UM); @@ -311,15 +313,12 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) static void mb_cpu_initfn(Object *obj) { MicroBlazeCPU *cpu = MICROBLAZE_CPU(obj); - CPUMBState *env = &cpu->env; gdb_register_coprocessor(CPU(cpu), mb_cpu_gdb_read_stack_protect, mb_cpu_gdb_write_stack_protect, gdb_find_static_feature("microblaze-stack-protect.xml"), 0); - set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - #ifndef CONFIG_USER_ONLY /* Inbound IRQ and FIR lines */ qdev_init_gpio_in(DEVICE(cpu), microblaze_cpu_set_irq, 2);