From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by sourceware.org (Postfix) with ESMTPS id E652E3858D20 for ; Mon, 30 Oct 2023 16:05:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E652E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E652E3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698681915; cv=none; b=siO4wTX4aoZVUGHv3Qq0OCgplVBiOgaCN9xkcpvC9tHxh1dzNb6t+BEwbdc9s7sYmhJEHK6YHHPN9RsnTHR+WXQGX8qW+pu+5nYE8UrU3PC+yV6jEGltZ8XjGm7Ybnnq/EUy4VQDw4fwdnLpyIZZ38YAt3RkZXp/hA9oSNdTDxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698681915; c=relaxed/simple; bh=ZnePyLs7DtzRFEKRDDTFQ+S4smyXsYiOumsn3e2xBfg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=cOgtFUikEewFu2MFiLR2gwhsN/khOKgpHAgg/bf2qktXiszZ4tljmV/aht03XTn9Z7JtGQ5lBITbXrLqhMnjeCuXoLa7CFoG9TC3MIFKJGGxW3pry/q5yJZGfBfpQ9xt34yYrMRXfdsWNkCeJBmcCX0IwX9gP+XJeZpQR9a5iK0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5a877e0f0d8so48601817b3.1 for ; Mon, 30 Oct 2023 09:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698681912; x=1699286712; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YQGWL04b82kYrda3TcdPx36oP1NgrTfcBQjMEM6pmbY=; b=gnEF4aqZtIp93yRALcVj7yH9mBMnb6cAyK9g6/CyCW4mzmtNogxPC3cdCjwNOstYsr E1xe515OO+36qx5lvPo8DYXH3PyvbPZPdtiQiEda4oXl/9Zf+RCocn8lY416PU1Q4xOT CexJdoK8HzkZBrkh0N8i1BRIMya1ZeF0EDs/RSECjQucEZhC3vdXpyxTN896YhMijyLt 7EMOtSNV+kWOhIP1WmuU4JCVPVt8E/fMkdmTukZMqvuQFgtoCQdvI0nujkCUVdnkWBqw N/y7ymmVKI/Wsve1YC0Mirs0htBM0U/p9GthCe7B5VqJvjKSJQcKc8B9KrvVbbwMnfzn Ba5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698681912; x=1699286712; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YQGWL04b82kYrda3TcdPx36oP1NgrTfcBQjMEM6pmbY=; b=LRDVCh0PcSjLmukBtMlpVQy01gn4lulJo7tt6Tpi0ylEl3fQnxxLjPNvrxN2dmz546 MAzzw0nsG4t/UiIMrReLkX3zVQ0d7UC0SUiQqaTQH8FTlUs9EuFNuY6dK6jRAk78+Wcq HCI7Ue3pWGzgiWPDRVDvljAhy1wig7zfXgdDqVCPlgSNn1t+xHik55obf7ilMRnqkmmL GAxVPPTrQxAV09vTF7KM179yW/OO0ZwUm4YVxVhl1H8De6E3gyTOI0bnUvdxKgN6jb6Y iAeRgb7Eeb3oInvev0Pc+rVRWRoQdPknuHxzwVk/LKyN23abL2jXMfZjyGe4e5iECW5Y Bkpw== X-Gm-Message-State: AOJu0Yyp3qd9ECDgGgJqgTleVadHWShQKxHFg3xe5lWzVduN4nNw6yCh GmDfaO5w35WdFVIJOWNiR6ERSDiyKskVdo7cQEY= X-Google-Smtp-Source: AGHT+IHUl4vyis37bWkEVKHmPGbAhs1ziBAEzPEYJLcXW6lcI0lUIjb8WB0rd7NpN8uIKymgDkLf1A== X-Received: by 2002:a81:9945:0:b0:5a8:1a54:ba4b with SMTP id q66-20020a819945000000b005a81a54ba4bmr63918ywg.13.1698681911941; Mon, 30 Oct 2023 09:05:11 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:3d3c:bcc6:1332:41fb:7f81? ([2804:1b3:a7c0:3d3c:bcc6:1332:41fb:7f81]) by smtp.gmail.com with ESMTPSA id l197-20020a8157ce000000b005a8073e2062sm4502462ywb.33.2023.10.30.09.05.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 09:05:11 -0700 (PDT) Message-ID: <7da594d5-4c19-49e2-8918-2d5cd2c1311b@linaro.org> Date: Mon, 30 Oct 2023 13:05:09 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] i686: Do not raise exception traps on fesetexcept (BZ 30989) Content-Language: en-US To: Bruno Haible , libc-alpha@sourceware.org References: <20231024113716.3911015-1-adhemerval.zanella@linaro.org> <20231024113716.3911015-3-adhemerval.zanella@linaro.org> <5280730.l52yBJDM9G@nimes> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <5280730.l52yBJDM9G@nimes> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 30/10/23 12:21, Bruno Haible wrote: > Hi Adhemerval, > > In the error case, the new code mistakenly masks all floating-point > exceptions (i.e. as if someone had called fedisableexcept (FE_ALL_EXCEPT)). > This is because the FNSTENV instruction is documented as > "Saves the current FPU operating environment at the memory > location specified with the destination operand, and then > masks all floating-point exceptions." > > The mistake came from my initial proposed fix of BZ 30990. Sorry about that. > > Here's a proposed fix, on top of your patch. I've verified that the sequence > of instructions > __asm__ ("fnstenv %0" : "=m" (*&temp)); > __asm__ volatile ("fldcw %0" : : "m" (*&temp.__control_word)); > does restore the exceptions trapping bits. > > Bruno Right, it would be good to have a regression check for this. I will update the patch.