From patchwork Tue Apr 9 05:02:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 787164 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp57026wrs; Mon, 8 Apr 2024 22:04:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX3tQplB4j4fODL768iUNs/v0TXFSP1s5y3NtYfY4KH2XAELrCehbfZ7VCdzJTIzn1qrVTsXTch0m9E/0xSelO9 X-Google-Smtp-Source: AGHT+IG88QqF25aG/6r3lh57ZxNdBieShnFdbJ7iRGQpc6SHNXfC4BZiD798/QlSmjqGweGpTLZp X-Received: by 2002:a05:620a:372a:b0:78d:696d:6b9b with SMTP id de42-20020a05620a372a00b0078d696d6b9bmr4187210qkb.29.1712639043325; Mon, 08 Apr 2024 22:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712639043; cv=none; d=google.com; s=arc-20160816; b=vpVwJorVdAYaOv74j/YIwDlea8I3qP0ERDnv/RzL24dRTDkc8lH7v0pwRp6dlVjWzU KhnwLpnVCweN7UZ1AsxBLAJ7vq522JAqO4IexRUx1vVo71B8sw9tM7JO9POm0oGyyj26 Ol9G4MOqr7+p4Q2VboszMiP7+8wV6f0MasDuXvS0o8OJQg7s8Tlv59dmt1y9MXWpB8L5 MYV006Zkd84b+0SEjGGAZtVQk/3TdsPO7mE7d0HD6Wdn8MQEvGpxfiDS8sjDL51pgCo/ q/5UVS6GKz4WYxBngeDq1pqqA+wD0iRm1u2Pvc4JKrZ6Z0WDUBz2f8ulgO0lV3vkp3SA knEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QdlWMWgnGp4nnm6wecPBCmGBGP6RpnH+ptC3EDh4jQk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Jsr6XB/nf80GdArti7TBgpAU2DTD+jkTGzjj5LUb+wQhoy4ZWVxLg0/pxOrxDdn0U/ fnbRRdPReMiJGzvaqvst7xndIrHsxIPgnWONOtAKOJJUuVko0u952P/qoh4sAGT9MSzt 8wTKpkzaD9gmexklhi1EFOU2MAe0rTqtP+s2AAozHSSu6hf91j9peguOZyePL3zKtiTU YbE5sVXAGoE+PnwXCz2lx2YEMLTguK+XkYjcOZnL6YUB687XX+/kj7swuhgNSX8nAWBi 2hTLjQrLX6m/secjkJsKs+JHGrgbG1QdSoQY10wXCGnqoZY2y/48PgruKa7AsRZMA5xe ciNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ol7HKID2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v21-20020a05620a123500b0078d60855e5dsi5629676qkj.709.2024.04.08.22.04.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2024 22:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ol7HKID2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ru3dp-0003CB-Mq; Tue, 09 Apr 2024 01:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ru3dm-0003Ah-EN for qemu-devel@nongnu.org; Tue, 09 Apr 2024 01:03:26 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ru3dk-0005Ia-RT for qemu-devel@nongnu.org; Tue, 09 Apr 2024 01:03:26 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6ed0938cd1dso3148137b3a.2 for ; Mon, 08 Apr 2024 22:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712639003; x=1713243803; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QdlWMWgnGp4nnm6wecPBCmGBGP6RpnH+ptC3EDh4jQk=; b=Ol7HKID2WkaGoMSBXbMMflP/AN2JZhIYhPFU1Gu3ZSCbgDdR5fuT0aPMKoKxHeBV0y g2OyLYKkyi078ttj30SqFHqoUV2sC35jZAN+PVGJELvdPnpJCqfEkf/tqXFMjpwFUfWQ Vxsg0F93dSRlLU66UVxooINTyPsLysdgzWYD9nDcMiIDsJcPzFaaTxGTGPtxkqsk9D6E vz9x6d2V7Oh9Q/pt5SV+cRTpMGTAJ1ChkcPN5JtwO9kw1Js3s2iaBV+1YkH03IDeKbiJ tW6IF+LQ1pvV6Xke1mo9kbPzvpnpL+6tdxZoMJQ1EOzEjI391xR0/wSrsZtpl7V+MAi5 25fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712639003; x=1713243803; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QdlWMWgnGp4nnm6wecPBCmGBGP6RpnH+ptC3EDh4jQk=; b=DgvnUsXMM2QYbI4E2LayDNiS11X+gZXDp8WfacfKx5zmmeuQxzLIvkRhF5lEHyBKIw ACvnvtmb5P8JoNWWeZMCRDJIezlDZ+yZAPHhOXd/So4hOQgSjs4vT2RNi2xu9cNoFtRG ukYNrO+rAGopWc/nDjpMVhdbIsHc3jTrCPv47DASYfWSu47aDAUj+Td4712f3xqZ+lo1 Dht17hwVvfvZU5Hba3IjXFlYKlNbRIT9CT0YfZKDwxNkJqFhs02BDlUD9GM8opNH9pG4 D4jJT1llIzqOh01prmNSMTpgqOB/wq/izd0Gks2MN8opEO7h/ql+Vpi4taem//kEYUXo j9Zw== X-Gm-Message-State: AOJu0YxRupx6eCTGuftRGLCjT4Smbw4zXoiFJE/oHb+T8cfHBXnJIkSl l+0x9OfgHOHccTfyNJpmrDepR1GU8fpYwEQ0WukxOpRJ6IV2+aD1vnw4Zmmxf3THymnobunlshS 5 X-Received: by 2002:a05:6a00:3d44:b0:6ea:bf1c:9dfd with SMTP id lp4-20020a056a003d4400b006eabf1c9dfdmr14465987pfb.27.1712639003022; Mon, 08 Apr 2024 22:03:23 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id z26-20020aa785da000000b006e64ddfa71asm7654894pfn.170.2024.04.08.22.03.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 22:03:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveArea Date: Mon, 8 Apr 2024 19:02:48 -1000 Message-Id: <20240409050302.1523277-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409050302.1523277-1-richard.henderson@linaro.org> References: <20240409050302.1523277-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This completes the 512 byte structure, allowing the union to be removed. Assert that the structure layout is as expected. Signed-off-by: Richard Henderson --- target/i386/cpu.h | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 5860acb0c3..5f9c420084 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1419,23 +1419,34 @@ typedef struct { */ #define UNASSIGNED_APIC_ID 0xFFFFFFFF -typedef union X86LegacyXSaveArea { - struct { - uint16_t fcw; - uint16_t fsw; - uint8_t ftw; - uint8_t reserved; - uint16_t fpop; - uint64_t fpip; - uint64_t fpdp; - uint32_t mxcsr; - uint32_t mxcsr_mask; - FPReg fpregs[8]; - uint8_t xmm_regs[16][16]; +typedef struct X86LegacyXSaveArea { + uint16_t fcw; + uint16_t fsw; + uint8_t ftw; + uint8_t reserved; + uint16_t fpop; + union { + struct { + uint64_t fpip; + uint64_t fpdp; + }; + struct { + uint32_t fip; + uint32_t fcs; + uint32_t foo; + uint32_t fos; + }; }; - uint8_t data[512]; + uint32_t mxcsr; + uint32_t mxcsr_mask; + FPReg fpregs[8]; + uint8_t xmm_regs[16][16]; + uint32_t hw_reserved[12]; + uint32_t sw_reserved[12]; } X86LegacyXSaveArea; +QEMU_BUILD_BUG_ON(sizeof(X86LegacyXSaveArea) != 512); + typedef struct X86XSaveHeader { uint64_t xstate_bv; uint64_t xcomp_bv;