From nobody Wed May 15 22:39:45 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 ARC-Seal: i=1; a=rsa-sha256; t=1690991268; cv=none; d=zohomail.com; s=zohoarc; b=QgDuR8zq+dwKuKJURt/t0QKlIG9D8bCkIswd/4I9KeCVjHyF0fsqDLM/b1mU3WXE4ykUA/aYEHD6oFmfS5+C/5oTMQPEd5yZ19XwoaWqPhqbtJm7JZq+TVo3yNJa9rRJ7VdZnPWHI1BSK8UWEOwZKmt7PoQbDGAHuRQvxnarCrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690991268; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JcRcT5GsB9W1AnjvjW1VWtnJX4Dzo7/Z8y9C0RNk4CA=; b=M27ElPo7z4wb1g5GM/tsfI2KusQ3R6vG9r4gOkvTKx2lodo5rXoa+oVMl8X2nzc19YVn45isbmFQtZvY2XPUaJGa9wggfTKR6jfvajsO6mxrk5pwk2frUMZBV8a2klfDu/JTx2N+k8GGGzEBg1j3o3BSjgR3khLefRZhlU1jJ8s= 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1690991268732868.6031659404991; Wed, 2 Aug 2023 08:47:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.575068.900807 (Exim 4.92) (envelope-from ) id 1qRE4A-0006m6-Kn; Wed, 02 Aug 2023 15:47:14 +0000 Received: by outflank-mailman (output) from mailman id 575068.900807; Wed, 02 Aug 2023 15:47:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRE4A-0006lz-I1; Wed, 02 Aug 2023 15:47:14 +0000 Received: by outflank-mailman (input) for mailman id 575068; Wed, 02 Aug 2023 15:47:12 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRE48-0006lt-KO for xen-devel@lists.xenproject.org; Wed, 02 Aug 2023 15:47:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRE48-0005Xa-DM; Wed, 02 Aug 2023 15:47:12 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qRE48-0005q5-55; Wed, 02 Aug 2023 15:47:12 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=JcRcT5GsB9W1AnjvjW1VWtnJX4Dzo7/Z8y9C0RNk4CA=; b=GqoNAt m7w1BaISQjHmf1TIoeMOiIiF4hfOF2XzJYsoBcPgnxEjZ+fUhpyHtUtL/ZQ5/wLZpNPGX/BEFvPZf WgdL2eHskh7xkTZ4lF+v0dwGHIK/NIkCwXPi2suzx6iKDdusnK7lX0vedQKcjzmYZTnqORxTHd/lf eR/1yYS4CsE=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH] xen/x86: Constify the vCPU parameter for expand_xsave_states() Date: Wed, 2 Aug 2023 16:47:05 +0100 Message-Id: <20230802154705.84530-1-julien@xen.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1690991392623100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall expand_xsave_states() is not meant to modify the vCPU. So the parameter can be const. Signed-off-by: Julien Grall Acked-by: Jan Beulich --- xen/arch/x86/include/asm/xstate.h | 2 +- xen/arch/x86/xstate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/x= state.h index 7ab0bdde89cf..c08c267884f0 100644 --- a/xen/arch/x86/include/asm/xstate.h +++ b/xen/arch/x86/include/asm/xstate.h @@ -100,7 +100,7 @@ int __must_check validate_xstate(const struct domain *d, uint64_t xcr0, uint64_t xcr0_accum, const struct xsave_hdr *hdr); int __must_check handle_xsetbv(u32 index, u64 new_bv); -void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size); +void expand_xsave_states(const struct vcpu *v, void *dest, unsigned int si= ze); void compress_xsave_states(struct vcpu *v, const void *src, unsigned int s= ize); =20 /* extended state init and cleanup functions */ diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index 92496f379546..3d566252eaa2 100644 --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -172,7 +172,7 @@ static void setup_xstate_comp(uint16_t *comp_offsets, * It is the callers responsibility to ensure that there is xsave state to * serialise, and that the provided buffer is exactly the right size. */ -void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size) +void expand_xsave_states(const struct vcpu *v, void *dest, unsigned int si= ze) { const struct xsave_struct *xsave =3D v->arch.xsave_area; const void *src; --=20 2.40.1