From nobody Thu Apr 2 20:28:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1774551892; cv=none; d=zohomail.com; s=zohoarc; b=HHs3ND9bSWR4r5E9j+QNHHYfVFSH3P30S8psN7IQECjQio/mQxV6/0BVugcxxh4y59qjFOG9GymJO4poU2u9nQuSrm36/IDbGk7UdSFKkpx0UkIOUA8Q43tAFav8JvXCMF4JUE8fDWfQ2dEsnCPZq6SlYzV0Eri+MAVQjFMFo/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774551892; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EH0X5qsNryn7DMb7Z59PuUpS3Gk/+G4mt63iwdGVrdE=; b=PHRYQQk9GoBgE4TZQrdy6mSlvDduZPQLvFjd5a+t0H7X3v9KlmqDF+7zuKZ098lgB2fXL5QGHAXstVEmabvKy+Xy+mrlo3Gv6FYzXdoGKhHWEYasJ9oZi0rgYUCgnh6Ukyx5DDud2WlvGDiwNpDnjJ/8X6MggEzTmuoVR5GdZsY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774551892072970.9824326060482; Thu, 26 Mar 2026 12:04:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1264708.1556115 (Exim 4.92) (envelope-from ) id 1w5q0X-0003SI-KF; Thu, 26 Mar 2026 19:04:41 +0000 Received: by outflank-mailman (output) from mailman id 1264708.1556115; Thu, 26 Mar 2026 19:04:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5q0X-0003Rh-Dy; Thu, 26 Mar 2026 19:04:41 +0000 Received: by outflank-mailman (input) for mailman id 1264708; Thu, 26 Mar 2026 19:04:39 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5q0V-0003AO-T8 for xen-devel@lists.xenproject.org; Thu, 26 Mar 2026 19:04:39 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w5q0V-00EqAi-99 for xen-devel@lists.xenproject.org; Thu, 26 Mar 2026 20:04:39 +0100 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c58338-5cb7-0a2a0a5109dd-0a2a4506ea40-14 for ; Thu, 26 Mar 2026 20:04:39 +0100 Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c58347-3034-0a2a45060019-d1558031cc84-3 for ; Thu, 26 Mar 2026 20:04:39 +0100 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-48540d21f7dso14778785e9.0 for ; Thu, 26 Mar 2026 12:04:39 -0700 (PDT) Received: from localhost.localdomain (host-78-146-242-105.as13285.net. [78.146.242.105]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48725eb1ca0sm2176755e9.6.2026.03.26.12.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 12:04:37 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1774551878; x=1775156678; darn=lists.xenproject.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=EH0X5qsNryn7DMb7Z59PuUpS3Gk/+G4mt63iwdGVrdE=; b=wQYqUVpbZpB+EYWhk0q7238vJB2C8to3u0K+iQuw1HlEtfdSAJBr2pSrrBAlrJE7/C WslUv6nJSF+8L7+d2HIRSjakPQIYNnvi4atvwIHeNj3GWIfopCB/GaIvScqyFDxZmg9B tSyUrquVjoRzGhtYv516Z7+lMlVoOCZP/8Q5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551878; x=1775156678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EH0X5qsNryn7DMb7Z59PuUpS3Gk/+G4mt63iwdGVrdE=; b=BpOzWA7TGsIjMmeC3+r6gnzSc+/cg96AC1JpuSNrqVZtjHR9FV5agrQjyL5tCY04rH o2VexgyqrPp+iOspCHtOzIa7dHwV2eo2ST9Rif6pabTi11yGFkkgpcUzCJOIN28vLkpq j15KRiqeE3hXDE5gCKzxs8RrjSYLuE/vuU0/S+QRK4cdnOBrmBqkWUupwgyNmxeqpST3 b5aqyYhkmUiWgMW8GilCYeb6TI2EXor2sdVBPI3BRLYBM+x6+PspzTHCCcN2ZTKFv0Uh ZYUARhDvWD8cTla7/yhh/dnKD/hrQR1uFKR2o3kpLWV2v2T7Rk+Pd/nNizblnsD7xDUM pwFw== X-Gm-Message-State: AOJu0Yz34d/vZvc2UfGBGUO5GABwtTqknARB82UnLsEjBR+QYQQOcLsG U7why/HyK7p9GJIFEHiUJknyHqxrTshMHIko5W0diwVkmLmIKLFjROzXwIfYZ+dsMZIoXbO6+xS Hvdru X-Gm-Gg: ATEYQzzSXpbHZRta8IkedYm+oDexm4Cv9jwyveX+iLpyZl8S95o1rJV2H+qBhgapMes OCyeVHFCFHt3/NWySxKZLWo7i62jwRoA7ijE95oQgyyQV9/IjO14TKgafXDEdBEXtcO1hzvcjeY 69k/sVqXFcwXBNkVWd/i7N4PN1RF4pYQjxVDNyFGddTOl1iKlP3xBgRS9Ojm8/lBlED5oPLncfP qo+hon9C0bsedLrJKzDTVa86PbDiojpz1DZ6AMcvSBlmFU7I1uHO+NE775XVVHa7pj/AXR/BrHo HTIag2r3KXsngo8T7ArBPDA3ENjOn6bxiEZVat0L3GOawg2wQijwjkE4Ta5Q38aVRHhWNGZ/oFg TTlHp2Y41Exlx1HgiTjzD0lwIX1CJ5rQWahn3BsQ8Fum4Ck4Q1tTiWVYIs7YrlsH3tE9EPBorTN 5vQVq3Q0myUHz/M8zSeu5hrb0wMhkw4hrrBzzO/TzZfkyj+fDkOMS7sf2sKoz/+IiQ1P7KUyThF fyO X-Received: by 2002:a05:600c:524e:b0:486:d76c:fa51 with SMTP id 5b1f17b1804b1-48716071a07mr140127405e9.27.1774551877889; Thu, 26 Mar 2026 12:04:37 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Ross Lagerwall Subject: [PATCH 2/2] x86/fpu: Initialise FTW as well as FCW in xstate_alloc_save_area() Date: Thu, 26 Mar 2026 19:04:29 +0000 Message-Id: <20260326190429.1156367-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260326190429.1156367-1-andrew.cooper3@citrix.com> References: <20260326190429.1156367-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1774551879-8198F1C2-CD0F8D85/0/0 X-purgate-type: clean X-purgate-size: 1415 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1774551892917158500 xstate_alloc_save_area() configures FCW and MXCSR to #RESET values but miss= es FTW. Fixing this means that the backing memory always has an architectural= ly correct value. Adjust the comment to state that it's the #RESET values which we care about. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Ross Lagerwall I don't understand what the rest of the comment is trying to say, so have l= eft it alone. There's still a lot of cleanup to be done to merge i387 and xsta= te. --- xen/arch/x86/xstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index e990abc9d18c..747df0b2e9a9 100644 --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -550,11 +550,12 @@ int xstate_alloc_save_area(struct vcpu *v) return -ENOMEM; =20 /* - * Set the memory image to default values, but don't force the context + * Set the memory image to #RESET values, but don't force the context * to be loaded from memory (i.e. keep save_area->xsave_hdr.xstate_bv * clear). */ save_area->fpu_sse.fcw =3D FCW_DEFAULT; + save_area->fpu_sse.ftw =3D FXSAVE_FTW_RESET; save_area->fpu_sse.mxcsr =3D MXCSR_DEFAULT; =20 v->arch.xsave_area =3D save_area; --=20 2.39.5