From nobody Sun Nov 24 02:59:29 2024 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=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1730130627; cv=none; d=zohomail.com; s=zohoarc; b=fi/z5uV/Jzjk4TLeZlR6okexUWLX5YAUr3rnUax7I8tLY1bQkFnlVK7fZNAnnYbEItcOW9KVrgiX1HKtTyvftsabt9YSEBeVt1MCr1LnmuwxWm2EUPVU/9fUPwPyBrN/PIrJXbpQLwoKPRG6CrAHB1BuEu6CyWt5BggKfL5vE4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730130627; h=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=DPLr0d8FwquAzKliN25Vvro3xH1NV3dTjQJhxaKuYlk=; b=NhOD2RnlnHwARHAU+jBpwAqfJ7b5C4re9dUCtSM6XKIaPj2Bxg3xXDA0/4OMOcak9EySqyA+vl86xLEXLPZDtRZObH7/el4zP1FInnkVZj+7gyOhy4tP/f08B0mFxxCTdXoMktCGfmgoy+Df70P1XBlLbdwgIcYroidjuRSzcB0= 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 1730130627557503.4261446231802; Mon, 28 Oct 2024 08:50:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.826683.1241028 (Exim 4.92) (envelope-from ) id 1t5S0K-0008R3-7d; Mon, 28 Oct 2024 15:50:04 +0000 Received: by outflank-mailman (output) from mailman id 826683.1241028; Mon, 28 Oct 2024 15:50:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5S0K-0008Qw-4m; Mon, 28 Oct 2024 15:50:04 +0000 Received: by outflank-mailman (input) for mailman id 826683; Mon, 28 Oct 2024 15:50:02 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5S0I-000874-IH for xen-devel@lists.xenproject.org; Mon, 28 Oct 2024 15:50:02 +0000 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [2a00:1450:4864:20::233]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4aa7bcf2-9544-11ef-a0c2-8be0dac302b0; Mon, 28 Oct 2024 16:50:01 +0100 (CET) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2fb51e00c05so64668321fa.0 for ; Mon, 28 Oct 2024 08:50:01 -0700 (PDT) Received: from localhost.localdomain ([217.156.233.154]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b3a0834a6sm387674066b.191.2024.10.28.08.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 08:50:00 -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" X-Inumbo-ID: 4aa7bcf2-9544-11ef-a0c2-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730130601; x=1730735401; 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=DPLr0d8FwquAzKliN25Vvro3xH1NV3dTjQJhxaKuYlk=; b=gg2fIKTVONMRK8myfgOs7owVeKPQ27ZCGdE91TUesEJtkiR1SiIKRuhiA6JvGwCC+t oG1tHdzrwSwXGNeiI7HQ9Xx/V9PGL3VM86T7Aq4VFG4znGP51Kj8fLLnn5Ojtn4BZbam jUfawQoVqsmEVCBMrTP6bmYQtr1TvEjtfTZBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730130601; x=1730735401; 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=DPLr0d8FwquAzKliN25Vvro3xH1NV3dTjQJhxaKuYlk=; b=hsCU2tBbStOk+vT0f9ivOVa4bNY0aMh1HlkQ18zxVLs2sZvty+1jmisAMxidXOel68 VaRSx1yzkWn2EGJR0+sPYgdY6aLJWcKdmx/vLIHbze3Q/YlYPcfRZrkg9JciJTC/KReb h2H8rjAs9sb14eKEFOkvCl0H4m/qfbYgNGVF3Wv1nteB1aJNYmAKl3SgY5Pvw8KFeO0a 8yE1DeWLj3rRqK9LXJKssJbuvN6bZ4uvB9LWyf/hafIEcz+1GuMhTUzZaWq26hSMErOm r6xZqdKby+l93wgcPRCRpPGzIk4GjGZgFWMzAxD4GwwYnyn8o3OtiCfjlvoQgWajE9Aa aGRw== X-Gm-Message-State: AOJu0Yxff1ThNwvqEzoTzNtaYmyelF5LEGvEchkJrxkAXVTzLJxycIYS wX2mbYN49qKYd0aWJJiJ4nC0udcb90AmeJFEmEpJyS31QmHTWoGlGSU/P9Ahjc+aIhsJKEDdRsa Z X-Google-Smtp-Source: AGHT+IFtmzmZV5fwObpGT1d2ilRoYu6/BvAiUMHd9PeBKgHP0k7Y5B9lU5THnhultSOFDHtQezy2ng== X-Received: by 2002:a2e:2403:0:b0:2fb:357a:be4d with SMTP id 38308e7fff4ca-2fcbe0a35aemr45594251fa.43.1730130600675; Mon, 28 Oct 2024 08:50:00 -0700 (PDT) From: Alejandro Vallejo To: xen-devel@lists.xenproject.org Cc: Alejandro Vallejo , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 01/14] x86/xstate: Update stale assertions in fpu_x{rstor,save}() Date: Mon, 28 Oct 2024 15:49:19 +0000 Message-ID: <20241028154932.6797-2-alejandro.vallejo@cloud.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028154932.6797-1-alejandro.vallejo@cloud.com> References: <20241028154932.6797-1-alejandro.vallejo@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1730130629215116600 Content-Type: text/plain; charset="utf-8" The asserts' intent was to establish whether the xsave instruction was usable or not, which at the time was strictly given by the presence of the xsave area. After edb48e76458b("x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu"), that area is always present a more relevant assert is that the host supports XSAVE. Fixes: edb48e76458b("x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu") Signed-off-by: Alejandro Vallejo --- I'd also be ok with removing the assertions altogether. They serve very little purpose there after the merge of xsave and fpu_ctxt. --- xen/arch/x86/i387.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c index 83f9b2502bff..375a8274f632 100644 --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -24,7 +24,7 @@ static inline void fpu_xrstor(struct vcpu *v, uint64_t ma= sk) { bool ok; =20 - ASSERT(v->arch.xsave_area); + ASSERT(cpu_has_xsave); /* * XCR0 normally represents what guest OS set. In case of Xen itself, * we set the accumulated feature mask before doing save/restore. @@ -136,7 +136,7 @@ static inline void fpu_xsave(struct vcpu *v) uint64_t mask =3D vcpu_xsave_mask(v); =20 ASSERT(mask); - ASSERT(v->arch.xsave_area); + ASSERT(cpu_has_xsave); /* * XCR0 normally represents what guest OS set. In case of Xen itself, * we set the accumulated feature mask before doing save/restore. --=20 2.47.0