From patchwork Thu Jan 2 08:45:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tu Dinh X-Patchwork-Id: 13924343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7DD7E77188 for ; Thu, 2 Jan 2025 08:46:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.863739.1275188 (Exim 4.92) (envelope-from ) id 1tTGq1-0007HM-Sy; Thu, 02 Jan 2025 08:45:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 863739.1275188; Thu, 02 Jan 2025 08:45:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tTGq1-0007GF-OA; Thu, 02 Jan 2025 08:45:53 +0000 Received: by outflank-mailman (input) for mailman id 863739; Thu, 02 Jan 2025 08:45:52 +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 1tTGpz-0004rS-V4 for xen-devel@lists.xenproject.org; Thu, 02 Jan 2025 08:45:51 +0000 Received: from mail180-50.suw31.mandrillapp.com (mail180-50.suw31.mandrillapp.com [198.2.180.50]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f692b2ef-c8e5-11ef-99a4-01e77a169b0f; Thu, 02 Jan 2025 09:45:48 +0100 (CET) Received: from pmta11.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail180-50.suw31.mandrillapp.com (Mailchimp) with ESMTP id 4YP0fF1C1JzCfD7NC for ; Thu, 2 Jan 2025 08:45:41 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id b133c83311a14cd3872070929731beea; Thu, 02 Jan 2025 08:45:41 +0000 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: f692b2ef-c8e5-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1735807541; x=1736068041; bh=QFIxqPt7/jeUPPpwBYw+2ueBPIx3z09csJHPFtv383Y=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=0RUiMycPuccrGYEQh6/0epojJrlT9+8TcXJXNq0kLcAZXp+/4ZXOnYdFppzmha5ju Gf6/c5/OJugVYnrxJQQfGiqUmZ/V7m4lVMdQzR4+3GmWLyR3qto6TH9Wcv1FXPNnP/ cob4hZrFNiLHKfF5F7N/hlI3bsoC5tjPRu0DKjMtX91XaXigUXNRkyIZtNbGwZonx+ phD6Ay1TMRnfjgQaKrizq3rkNMiqD3j1Y4fUWEDl8KVj9ZSa+TRWZJ1gXoOJ1d5/Cp Y2IipbICa0c2IfWL/2bSgUSUtRdElI0LL2ba2mVgb0pdF6nWT1HEja6H6XTsnDOUc0 WbKyAF07GMwMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1735807541; x=1736068041; i=ngoc-tu.dinh@vates.tech; bh=QFIxqPt7/jeUPPpwBYw+2ueBPIx3z09csJHPFtv383Y=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=UQewD+KVlhDdl1+IdAMse4OdZYUZ5geILHQ/MlXHjP83PXH8QiqU+XvdCQdxxRB6k iBf6RSVtEwnaW8xDO+8ZtgAfd6zhlOvQ20ZmVu4zeTd0GxDUcDyWk5kJ0u+qDplSoo 1w/nW76hofiNowGgrDilqv9p1gWx1HC+4K1m3odOPiZFJPP/+e2mn0jsq2LV3OMBeK Vn484RFCoD4XkMFlPv8MViv5uMvJc3E16qSDU/qUhA3xpwvGlUISCB8701r1VywA+L ahCy/rnA8oHkjRzpeGY4kDyrnPcSCf6s59Xz0rv0hiGl7AZUmtneIHYBS5s0lQPH5f c5qvNS8CXlL/A== From: "Tu Dinh" Subject: =?utf-8?q?=5BRFC_PATCH_v2_07/10=5D_x86/hvm=3A_Don=27t_count_XSS_bit?= =?utf-8?q?s_in_XSAVE_size?= X-Mailer: git-send-email 2.43.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1735807540297 To: xen-devel@lists.xenproject.org Cc: "Tu Dinh" , "Anthony PERARD" , "Juergen Gross" , "Jan Beulich" , "Andrew Cooper" , " =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= " Message-Id: <20250102084413.102-8-ngoc-tu.dinh@vates.tech> In-Reply-To: <20250102084413.102-1-ngoc-tu.dinh@vates.tech> References: <20250102084413.102-1-ngoc-tu.dinh@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?utf-8?q?Please_forward_a_copy_of_this_message=2C_including?= =?utf-8?q?_all_headers=2C_to_abuse=40mandrill=2Ecom=2E_You_can_also_report_?= =?utf-8?q?abuse_here=3A_https=3A//mandrillapp=2Ecom/contact/abuse=3Fid=3D30?= =?utf-8?q?504962=2Eb133c83311a14cd3872070929731beea?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250102:md Date: Thu, 02 Jan 2025 08:45:41 +0000 MIME-Version: 1.0 HVM vCPU state images are uncompressed and therefore can't contain XSS states. Signed-off-by: Tu Dinh --- xen/arch/x86/hvm/hvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 922c9b3af6..c7b93c7d91 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1208,7 +1208,8 @@ HVM_REGISTER_SAVE_RESTORE(CPU, hvm_save_cpu_ctxt, NULL, hvm_load_cpu_ctxt, 1, #define HVM_CPU_XSAVE_SIZE(xcr0) (offsetof(struct hvm_hw_cpu_xsave, \ save_area) + \ - xstate_uncompressed_size(xcr0)) + xstate_uncompressed_size(xcr0 & \ + ~X86_XSS_STATES)) static int cf_check hvm_save_cpu_xsave_states( struct vcpu *v, hvm_domain_context_t *h)