From nobody Thu May 2 07:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1593802751; cv=none; d=zohomail.com; s=zohoarc; b=A/Z9NovB3s7kcGZgXEmm0Fy6dGea2l5//wX5tHh9PYJOJIHduqoPNKCVJBvctK5WnQMPxI//zfINnx2395I7H4CshGQhbrtUAzdhIBZZfizyeIBnNmetIOUBUZMMmRLELvQgktedqcNCQQ4dJLmVFwWQUwNMa6PKavi7rKIkr7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593802751; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NRdSaebxxpQtMnPysytAP33orrhVy4jChl+bw6WV04k=; b=Pw8RBi2R9f32roqeChw9lHbxN2sVoCS/y0Wv+jfqfSJ+eqtUdFYnVzHOru30P79c29HptEIscEPY77wZMTJhIS0FR5a/2ij/frhfrzQEFB7N3h7NntEfEcTPdNgi9yf1EqFV1oaTbOlEeC1mneojYLkEMmlid8h1VrPnOtcE92k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593802751195893.2342766376667; Fri, 3 Jul 2020 11:59:11 -0700 (PDT) Received: from localhost ([::1]:56186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrQtx-0001l6-On for importer@patchew.org; Fri, 03 Jul 2020 14:59:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrQt5-0000X6-IC for qemu-devel@nongnu.org; Fri, 03 Jul 2020 14:58:15 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:54807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrQt4-0001U2-4m for qemu-devel@nongnu.org; Fri, 03 Jul 2020 14:58:15 -0400 Received: by mail-wm1-x343.google.com with SMTP id o8so32922875wmh.4 for ; Fri, 03 Jul 2020 11:58:13 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id t16sm16060929wru.9.2020.07.03.11.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 11:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NRdSaebxxpQtMnPysytAP33orrhVy4jChl+bw6WV04k=; b=htalOAG2XOlJ3mUsuWqejlLWO/5RpsFdYhGsk4ip9IhIj43FODYDpUfYlp+HbV9er/ OOxmcSy35uH4wwLf/HrvIThGYCNvFq1Hc5mF297nZ6XOjA3GtgDJS8xoSnXxkemMLUwK IJ5Nazx+C4QKwOnxKiP5iQyYNN39+QqOmmfHSJuiHcOgvS0iR4hbU4C6+p7vQJ+KOvFU pEbojh4JDHslMcfvg05jWJ5VOYmaRsfAaQLAUT6P3Dsmb5hi+r5y+xsp6ZmXqhNGoBvl ltTrGgEItPVDHHGAt33A+kw8kGwqNmafhXHQW9PsKL3Ibnxo6Cu06azh136QgmA/xxOj XrTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NRdSaebxxpQtMnPysytAP33orrhVy4jChl+bw6WV04k=; b=U/kqRzOE0CH6DB8riUO2QI3IqjwysPw+D+uHrQOAVjqwxv7zfHHQEatD8tskmTL7/6 ep/AuuE0tB6XLPMQaEF+3YP5TyHR/ZWV1f+xRy8CknNVUUQBxkn5CU+p4UOfB7ZiGznQ Q46ZaCMoSNt5A0+j/qAsSQHT9rurUesnGRcnNUOcHSG3hISulTrZJwRDyIPJ6yddJ4iV nCtfRaeY37R6OsF9XZCzjof7x4DxBaaOF4ntZr8RyvCx5y9NZn0XjmGKfufKSXkqng0H D3jMv6rFSGN0FMeGYh0JWqPK5CQlBQjFBidie3QwbS18LXd2y1lDUj1gikYNcrjSKFTl 4a1A== X-Gm-Message-State: AOAM531ReCtojIAy8KTS/y8rLBC7XforxbXDRWX9mdJ6riQMueecSPyi JIx7qx54CJtXxrx5/VLgy60UDERbz6s= X-Google-Smtp-Source: ABdhPJy+XWE10TSaTB1D1VprNZOrklzD6bF6RP3bTBUm6dirbLcOL6pcgaZ12FJA5G/CQwTYCeqItg== X-Received: by 2002:a1c:9c8c:: with SMTP id f134mr37105851wme.142.1593802692584; Fri, 03 Jul 2020 11:58:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] hw/char/serial: Separate and document static properties Date: Fri, 3 Jul 2020 20:58:08 +0200 Message-Id: <20200703185809.5896-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200703185809.5896-1-f4bug@amsat.org> References: <20200703185809.5896-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S. Tsirkin" , Juan Quintela , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add more descriptive comments to keep a clear separation between static property vs runtime changeable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela Reviewed-by: Peter Maydell --- include/hw/char/serial.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 535fa23a2b..d955963ef1 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -55,9 +55,7 @@ typedef struct SerialState { it can be reset while reading iir */ int thr_ipending; qemu_irq irq; - CharBackend chr; int last_break_enable; - uint32_t baudbase; uint32_t tsr_retry; guint watch_tag; uint32_t wakeup; @@ -77,6 +75,10 @@ typedef struct SerialState { =20 QEMUTimer *modem_status_poll; MemoryRegion io; + + /* Properties */ + CharBackend chr; + uint32_t baudbase; } SerialState; =20 typedef struct SerialMM { @@ -84,6 +86,7 @@ typedef struct SerialMM { =20 SerialState serial; =20 + /* Properties */ uint8_t regshift; uint8_t endianness; } SerialMM; --=20 2.21.3 From nobody Thu May 2 07:47:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1593802752; cv=none; d=zohomail.com; s=zohoarc; b=Hr9wDFZGcGNf7LhVFXp+fK5adqMKx73Ai7rdikBMOyebSBm3WEwlEm+QaXrAwx5utu3/dhLnFwGNktRZ2ASifmxzD9t0UvegXp+TCx5iTZWGgI+/0Lai/TFfnN0TkvhNpRXBDiCGHj1slqoGH8gtUkfF5fOnHY6yqF8zvzvVOnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593802752; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wpS510g0PsDSPMVgjXGeNihl06G1BtPWSiqFQOesBaQ=; b=ZGojvqGS9Rmm9G0HkmFXqv4UvMdC5wQD4yajSo4rrI7mNPKmq004/asEVxrC+WQrotEFFaWvYzH7VFW/q/gKaR9H5SBgVvQGuI3HDf6kSRR5BDTfqxHmdIiq14XrrL/+ZQyGXSSz0Ou5MDVJ9YRe3cD90GzMEZdXvEeNMXMl07c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593802752825531.8756463207267; Fri, 3 Jul 2020 11:59:12 -0700 (PDT) Received: from localhost ([::1]:56300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrQtz-0001nq-F9 for importer@patchew.org; Fri, 03 Jul 2020 14:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrQt7-0000YE-0d for qemu-devel@nongnu.org; Fri, 03 Jul 2020 14:58:17 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:35285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrQt5-0001UB-Kw for qemu-devel@nongnu.org; Fri, 03 Jul 2020 14:58:16 -0400 Received: by mail-wm1-x334.google.com with SMTP id l2so33569243wmf.0 for ; Fri, 03 Jul 2020 11:58:15 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id t16sm16060929wru.9.2020.07.03.11.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 11:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wpS510g0PsDSPMVgjXGeNihl06G1BtPWSiqFQOesBaQ=; b=aTZ/AZxHikEnaMA0LUS+J82N5gfqYqixd9o9B/ZrJCmuQWqqdPKAjMohzbfZPaHE2p reDc+nBo4cM4emGeuKesOnOr8Ku5yB54N6q7OvTuAMiz5TaCc2YDrnD1PH5QPgRcLcJW J+BtCAn+5Z123PZeMCLk4mZW5RL/zEtbfOZjSbRo0E9zlrWpNyjoK88uEL6MrpcDC/kA iUCpT0094WYY2OQnOlyw0CZnOpX9+u4qqSe4XJRWQhX9vCGxyCDnlCIAfm+1ivnMmzWd 5BejPBtKetAwQx+lCqW8dgFZzYWP4Wq6BeR27y1dPNmVxlc24fxYa+hnhcfQwnyCGVTy 6MKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wpS510g0PsDSPMVgjXGeNihl06G1BtPWSiqFQOesBaQ=; b=fNbNDHjKlQNLv0B6GivuQrr2MAXtoDC7oX3q1VjKs7IGe1D1fUlSS40rirXyZHxXBS ZaazBbDRF9JEmfQdjkEOXNGsXAa6ouPPJ1vVpd+Yu3nkZx0+zTrymgpV2R5UXU4YWWqA J/XRfMEzLZw8SA4ReP8jPlYHD2y7UJx9djVUL3Tkno2Tca4wVwjfEM8DWcz5B/toWR+b GOOZGTnbfu3bCQnwY9jXRKQ4pfy4Ek3cVG0X/439nh4uuHICa3Wo420T4gmeB3AVM7aX slKK2drByfKfcXRMVjqfU5Gg+vunHZ6hMx5HmQQqhMKXYNRiF9ifFrmxdH+qwmyd5Q5D sgNw== X-Gm-Message-State: AOAM530PimiQZfAYInm7ytQ//3wlNqMnU/7g5NQXA/2wxOq7R+Sa6wme zBjgi4J5RpNSD8S7HSZygXoiZcXgTz8= X-Google-Smtp-Source: ABdhPJwO4fp2BwxLxAAN1nWnEG/kUyMWMaDf7zHmtpJWAvO9rtsJtKbbIF/iwo31Yl4wGrNrUBac4Q== X-Received: by 2002:a1c:1f54:: with SMTP id f81mr37869040wmf.4.1593802693685; Fri, 03 Jul 2020 11:58:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/2] hw/char/serial: Allow migration of the I/O serial device Date: Fri, 3 Jul 2020 20:58:09 +0200 Message-Id: <20200703185809.5896-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200703185809.5896-1-f4bug@amsat.org> References: <20200703185809.5896-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::334; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x334.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S. Tsirkin" , Juan Quintela , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The serial device mapped on the I/O bus hold a migratable SerialState. Keep the same version range from SerialState: 837 const VMStateDescription vmstate_serial =3D { 838 .name =3D "serial", 839 .version_id =3D 3, 840 .minimum_version_id =3D 2, Fixes: 10315a7089 ("serial: make SerialIO a sysbus device") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- hw/char/serial.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index 9eebcb27e7..c167b584fb 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -1002,12 +1002,22 @@ static void serial_io_realize(DeviceState *dev, Err= or **errp) sysbus_init_irq(SYS_BUS_DEVICE(sio), &s->irq); } =20 +static const VMStateDescription vmstate_serial_io =3D { + .name =3D "serial", + .version_id =3D 3, + .minimum_version_id =3D 2, + .fields =3D (VMStateField[]) { + VMSTATE_STRUCT(serial, SerialIO, 0, vmstate_serial, SerialState), + VMSTATE_END_OF_LIST() + } +}; + static void serial_io_class_init(ObjectClass *klass, void* data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D serial_io_realize; - /* No dc->vmsd: class has no migratable state */ + dc->vmsd =3D &vmstate_serial_io; } =20 static void serial_io_instance_init(Object *o) --=20 2.21.3