From nobody Sun Sep 28 17:03:18 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756257514; cv=none; d=zohomail.com; s=zohoarc; b=TdFI4ibcjZXWWILxJY4tJ8IQtSXkyW8tsnUlboYP3DlhSlpmqa5FWByqT7izxjVL/U1I3AedTEjG2oO0MKedSSSaGPnP4Swm919FhUErwSFLdAGrKPdPWCItpzpy+lecWD9S2TRk3VocGzUjFyCDYV5Omj6pEP72ceLu8i6NY+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756257514; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T9UF9kwXsCF9XPGfLIekiKxdaKcYyBFch6OZM4B4BRw=; b=iTl52zA6c7as2gYgsqHP+AiUhBntbamtXVddJ/QIfaZerPkSi0zxjbXv5Ih8Jz5zynAM2lYbcqnpC6qottqX93L4u7fEPpOrkC1WHEwuvmhG0gSglG3qeCjaCqE8fSX5heinW5o+XsE5XWT8uMg97f3cYGmDUZQ6UxYukT4btic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756257514564269.06333087495125; Tue, 26 Aug 2025 18:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ur4jF-0003br-PK; Tue, 26 Aug 2025 21:13:36 -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 1ur4hX-0001Fq-RR for qemu-devel@nongnu.org; Tue, 26 Aug 2025 21:11:49 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ur4hL-00009q-MY for qemu-devel@nongnu.org; Tue, 26 Aug 2025 21:11:46 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-76e6cbb991aso5482559b3a.1 for ; Tue, 26 Aug 2025 18:11:33 -0700 (PDT) Received: from stoup.. ([144.6.121.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-771f2b2d2bfsm4348408b3a.93.2025.08.26.18.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Aug 2025 18:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756257093; x=1756861893; darn=nongnu.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=T9UF9kwXsCF9XPGfLIekiKxdaKcYyBFch6OZM4B4BRw=; b=xwRGYWv7WQvWnmTf56qyvWEkGlDYhgiX/mnn9pyZRsfdEnd0E+qB8G7NXeEzIn11n0 7iN2vVuWIVBOQhr4E30qQAMDBwhvBu+vG7dcgh9AL8E4UujIb80ATQJSEhkan1WrRv0v YtdKjm4IQ3WxREzZ+msPQe2Ij5WLwTglZ6i/4fUlCVmpP2pM0drbUrupz15AxOt/Xfhk bNw14CLP/e6JgwS/E97ll0udphhoiqzszLnOIQqfMiDq7CEloKBIznNFpF6rHN3gjIaG zNNDOoa5Za/vzz1bWontdzaiOOkc6Zr+aOsLJD+UVU+rw1MHSMVwLCKjxRTDTIoDLLm+ 41pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756257093; x=1756861893; 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=T9UF9kwXsCF9XPGfLIekiKxdaKcYyBFch6OZM4B4BRw=; b=wmtTE5WoMXC7n2g1j2RDNBdKUiDJis6AId7YQa5QyxgGRwN+qg44nUa55QaIryYIYi zqz/tRZeaWp+KTf4z2fSOVLuTivmdknRuotPfZ/x6ICyZOAGwWT2+q75YlIRu/i9CdWw JwgyG6JGgxF3V7FHOK3igXl+NNPX/+5y598Rc7d1PRlsiMhqIWpW2+OT7Dod14uoRAkC btviAgt7bxywueEwQ3RU2jsWI2xtRlXYS0MEnE+YTe37D/uQxObfazyQLRZEM7LfALH6 nnq1lVpGRsTpVQ88MVWTR/y1EC4bs0RjZ3HK21AgLdkkIpRIGdw2w3n8f//lrISZnwdu cKkQ== X-Gm-Message-State: AOJu0Yxqi9AJqxF4X0a6X4cNbV9hWjs7gpRYSnSGNwsNILzgCZAEPdgg 3F/NJFNcYPtBNog/qZUdX2U6MwaFd4Lp6uDYgIB0Wat/1+G7gPUW6XnBLsgX90BAb9PQU1ddr2i zHCJVP9I= X-Gm-Gg: ASbGncvsrOx2nIv6f1TZLJckomhh+/8WkA3Mmd46YUFxNsgvTDegYQZoYfZPQsIE+P+ msu7hcjrjuXda3yD+SKl0hGM8w2kYWl5fhIPuCchh8nwbJpqh+m2ZpcTQFGxlxuvu0lcUoDdXvk SbANUy+EPw8vVmZjgRatNrHEniJxbujF9/louA/a3u/R35duebxHhC+SbrwaaYrstWvSCk8fp0s 8N3QeNLUOR2hKI7fjvCl4uVvkD8JwZleHClXB/WpmBVeIP5uYVm2d34vHMEG+PufHBhaeaKSlKq vc2w5SNCG9s1vIVKO+VqK5fXvM+N3cXjyCJJ3Meqjc/YHGfe94Pijxgq9dxar5+J+CPjLpK8e3M 5VIUNo2PKxIqzIhuFJSthWdsDqw== X-Google-Smtp-Source: AGHT+IF/mzYod4qjdc8jh/cuhqmtw6VGdJ9fnFM/FRHRUt5DojyjaDdxsRaJ55ygP+nmSAO1U+e7iA== X-Received: by 2002:a05:6a21:99aa:b0:21a:ecf5:ea71 with SMTP id adf61e73a8af0-24340b5b4cemr26504217637.15.1756257092735; Tue, 26 Aug 2025 18:11:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 47/61] migration: Add vmstate_info_int128 Date: Wed, 27 Aug 2025 11:04:38 +1000 Message-ID: <20250827010453.4059782-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250827010453.4059782-1-richard.henderson@linaro.org> References: <20250827010453.4059782-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756257517479124100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- include/migration/vmstate.h | 1 + migration/vmstate-types.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 1ff7bd9ac4..3b3416c2c9 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -222,6 +222,7 @@ extern const VMStateInfo vmstate_info_int8; extern const VMStateInfo vmstate_info_int16; extern const VMStateInfo vmstate_info_int32; extern const VMStateInfo vmstate_info_int64; +extern const VMStateInfo vmstate_info_int128; =20 extern const VMStateInfo vmstate_info_uint8_equal; extern const VMStateInfo vmstate_info_uint16_equal; diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c index 741a588b7e..1476c278e1 100644 --- a/migration/vmstate-types.c +++ b/migration/vmstate-types.c @@ -18,6 +18,7 @@ #include "migration/client-options.h" #include "qemu/error-report.h" #include "qemu/queue.h" +#include "qemu/int128.h" #include "trace.h" =20 /* bool */ @@ -193,6 +194,35 @@ const VMStateInfo vmstate_info_int64 =3D { .put =3D put_int64, }; =20 +/* 128 bit int */ + +static int get_int128(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) +{ + Int128 *v =3D pv; + uint64_t hi, lo; + + qemu_get_be64s(f, &hi); + qemu_get_be64s(f, &lo); + *v =3D int128_make128(lo, hi); + return 0; +} + +static int put_int128(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, JSONWriter *vmdesc) +{ + Int128 *v =3D pv; + qemu_put_be64(f, int128_gethi(*v)); + qemu_put_be64(f, int128_getlo(*v)); + return 0; +} + +const VMStateInfo vmstate_info_int128 =3D { + .name =3D "int128", + .get =3D get_int128, + .put =3D put_int128, +}; + /* 8 bit unsigned int */ =20 static int get_uint8(QEMUFile *f, void *pv, size_t size, --=20 2.43.0