From nobody Fri Dec 27 01:37:28 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=1730130624; cv=none; d=zohomail.com; s=zohoarc; b=ZOyRM+mKNjywht0mt4hUkWKoRFZ/nFbnPsIUoFPnuwYE+OpQZ8W/dt/UlroRODu0ihBrHYUDfvu5bMadBNMiF8tsbhKgXKPSovUBYOS4GN+IU27eLBDkUPeMbNMvXeQ9K2g5s7xPlntod3iuByI5UwvVTT32txHqWMrBcJxqki0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730130624; 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=hY/UrTCQ/vWU0sbBxlJ8N5ALQVl83VMvY6/kdegt+f8=; b=G15X4HJj302Gv/SwDTkP4Wkjkeka4qHjRektXIKjuLdLA9O6hXlNcvVq9domFBy4hIA2cVzqhRVKFg4xCa6RqgRs273bvEEdaDkAP9OJ3ofX3gXSSUtEGms361u1g3OSsC9RS6SDJnRIfmgkacWnp3uQJCDpAaLWmZu3GhFPPL8= 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 17301306239971009.9076293489536; Mon, 28 Oct 2024 08:50:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.826688.1241074 (Exim 4.92) (envelope-from ) id 1t5S0N-0001FH-SF; Mon, 28 Oct 2024 15:50:07 +0000 Received: by outflank-mailman (output) from mailman id 826688.1241074; Mon, 28 Oct 2024 15:50:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5S0N-0001DL-Li; Mon, 28 Oct 2024 15:50:07 +0000 Received: by outflank-mailman (input) for mailman id 826688; Mon, 28 Oct 2024 15:50:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5S0L-0008FV-Ho for xen-devel@lists.xenproject.org; Mon, 28 Oct 2024 15:50:05 +0000 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [2a00:1450:4864:20::532]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c1752b5-9544-11ef-99a3-01e77a169b0f; Mon, 28 Oct 2024 16:50:04 +0100 (CET) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c95a962c2bso5541659a12.2 for ; Mon, 28 Oct 2024 08:50:04 -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.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 08:50:02 -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: 4c1752b5-9544-11ef-99a3-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730130603; x=1730735403; 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=hY/UrTCQ/vWU0sbBxlJ8N5ALQVl83VMvY6/kdegt+f8=; b=FJek+/D7mp0vn/T9HA2IbH50c731yiPg9/cjRpNDHKVx86eIvfLiQCvPG6ahNtbUR+ LV7oC4/RKRTUDyAy5j7XOQWW2/x5xlP4qma3T/3g1QZmlsJoWf7ltftn2eChnOZ7KCRs MqYziWqu8Jj3YWUyg7HFH6gYg339cTt96FkkU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730130603; x=1730735403; 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=hY/UrTCQ/vWU0sbBxlJ8N5ALQVl83VMvY6/kdegt+f8=; b=Gly7dzCclPefjZNsd5+p9WUx8CvJxkN8DiUEr2eJGUEJt7iJUosNzK4tOs8t9SSWX4 FVzZn86SbHWOAsdjVnHQnsT8VnkWgD4CeazcBLqmVkgozhoxhU5UsWnEHTug0R2r6pJb hOkUz7N3zQnNHm7FdN/7sembCbiKxNhlfa/zxRbbG+/k/MYOxNX0iQsaXTc5YzDpOKj5 QAvDszfa8bbB/a9xg9hJgkejWY5Fh7h4PdB+2ugmt2JXUku210uXfVja7XtOpA0Ye2z1 PoXtiPJp0Rrkhc44bYMX67tr9y8hd9KlKpfkTIAu1aJ7l9mpNlwML0HCX9bkYeAlYSDS 2YbQ== X-Gm-Message-State: AOJu0Yw5CAF7kEtNNwPRUTikoCYELzfx9gBKc61yed043r8CmPbM01TS 5fAKIKLMjvwHTAWkZacqqwDD+6viRlVyXQpB189EHrOV2WU2YKWl9/XAYfp/mg9LCkGNHky2Ca3 r X-Google-Smtp-Source: AGHT+IG6StWqjpAO8DYedOrCCnEILK72ffLHyWgeM9Uz/5/G68jTWsMGvKh3D3LSCUH1wOiNDrZUFg== X-Received: by 2002:a17:906:6a1d:b0:a9a:4f78:b8 with SMTP id a640c23a62f3a-a9de5c922c6mr748802166b.2.1730130603202; Mon, 28 Oct 2024 08:50:03 -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 04/14] x86/fpu: Map/umap xsave area in vcpu_{reset,setup}_fpu() Date: Mon, 28 Oct 2024 15:49:22 +0000 Message-ID: <20241028154932.6797-5-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: 1730130625231116600 Content-Type: text/plain; charset="utf-8" No functional change. Signed-off-by: Alejandro Vallejo --- xen/arch/x86/i387.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c index 375a8274f632..a571bcb23c91 100644 --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -306,8 +306,10 @@ int vcpu_init_fpu(struct vcpu *v) =20 void vcpu_reset_fpu(struct vcpu *v) { + struct xsave_struct *xsave_area =3D vcpu_map_xsave_area(v); + v->fpu_initialised =3D false; - *v->arch.xsave_area =3D (struct xsave_struct) { + *xsave_area =3D (struct xsave_struct) { .fpu_sse =3D { .mxcsr =3D MXCSR_DEFAULT, .fcw =3D FCW_RESET, @@ -315,15 +317,21 @@ void vcpu_reset_fpu(struct vcpu *v) }, .xsave_hdr.xstate_bv =3D X86_XCR0_X87, }; + + vcpu_unmap_xsave_area(v, xsave_area); } =20 void vcpu_setup_fpu(struct vcpu *v, const void *data) { + struct xsave_struct *xsave_area =3D vcpu_map_xsave_area(v); + v->fpu_initialised =3D true; - *v->arch.xsave_area =3D (struct xsave_struct) { + *xsave_area =3D (struct xsave_struct) { .fpu_sse =3D *(const fpusse_t*)data, .xsave_hdr.xstate_bv =3D XSTATE_FP_SSE, }; + + vcpu_unmap_xsave_area(v, xsave_area); } =20 /* Free FPU's context save area */ --=20 2.47.0