From patchwork Mon Nov 26 20:04:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 1003451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hssv47Yz"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 433dSK3Bdyz9s29 for ; Tue, 27 Nov 2018 07:14:57 +1100 (AEDT) Received: from localhost ([::1]:38599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRNHS-0002M5-Uy for incoming@patchwork.ozlabs.org; Mon, 26 Nov 2018 15:14:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRN81-0001lR-Ek for qemu-devel@nongnu.org; Mon, 26 Nov 2018 15:05:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRN7y-0001Kj-By for qemu-devel@nongnu.org; Mon, 26 Nov 2018 15:05:09 -0500 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:38135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRN7x-0001GL-7F for qemu-devel@nongnu.org; Mon, 26 Nov 2018 15:05:06 -0500 Received: by mail-ot1-x342.google.com with SMTP id e12so13562635otl.5 for ; Mon, 26 Nov 2018 12:04:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iCCY7Fm5GCDHs60JUHHi8Lto+s0n7AMMlXZzIvwWOSE=; b=hssv47YzxC0CMZ1e6YcWzujat2UzHBsTXyIjFRXm2diB2RjUkM9ALBXzz9tNtGlF7q wsXHX6+oK1xE4m1dtSlBDrpHrQpH2cLeOGpUizB8Azu3LCS6f8z5n5Jj+XOiRszCXGCc FWL7SgC3RE2EX/pZ7KsGgVQeRDeA0AxRdOtpCB9w2qWVd2T971A45ROWzEtKZ4BtQVXL 7fuDx0qC7TLqOSjEQEA6BFu0Iq4dlQdvTjlSKHsr+S72s8Ov+yOe80Fr7Eayl3GxXcdp KAIstSaInPfGfvJca4kNf4g/BVIkiJ21kcMhC1/UTzGn+2TLVg1B3Kroz6+M9ordpku8 TuwQ== 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 :mime-version:content-transfer-encoding; bh=iCCY7Fm5GCDHs60JUHHi8Lto+s0n7AMMlXZzIvwWOSE=; b=ZSE/QZFlOKrREkppy4zPGbs/wxatGvPZXc3dZLHL9RK2AkCXWgDUhn1hOP9bUa6Xa2 pBN9L2zyRxfMrs6kkUN+GRJA3WGo74bw/oDqmyLBakAQB/FBR/teKRyY+GDGw9cGOGfT YFG6NrN5yXtgNu5JQvFDHrOAQ0hbfVRnpcgZe8vFWXAIEfoNKm+mLwJ/Wv9C5y48ZTqh Qt3+zodtdzZFaLryWc8BA8duse7Ss8EQw49O5k/G8InW3RDiDLmThXgl9Qs1xm/K4sbu kiLe45GGWZs8LiyD233uU3PKKEn2Nb9J/duN3+0Z3Of7loU80VF7EFaF8OpVgzhuPjVb p1qQ== X-Gm-Message-State: AA+aEWaHnxwWLzAscmGoHjQXvxJrikOMdrasylsJQu04X67qAXOqZMC3 MY7nsvSGw17fws3DEW+PZA== X-Google-Smtp-Source: AFSGD/VOq580SP1p8wwmBI2spuMqGUDBlQ57yXjY003wgtCkR8aAhJtlpRTQm0cIxrywhEf98iYsCg== X-Received: by 2002:a9d:52a0:: with SMTP id f32mr13358127oth.6.1543262689330; Mon, 26 Nov 2018 12:04:49 -0800 (PST) Received: from serve.minyard.net ([47.184.128.64]) by smtp.gmail.com with ESMTPSA id w5sm366075oif.48.2018.11.26.12.04.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 12:04:48 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id D7ABB8FC; Mon, 26 Nov 2018 14:04:46 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id D2F73301463; Mon, 26 Nov 2018 14:04:45 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, "Dr . David Alan Gilbert" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Date: Mon, 26 Nov 2018 14:04:19 -0600 Message-Id: <20181126200435.23408-1-minyard@acm.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::342 Subject: [Qemu-devel] [PATCH v3 00/16] Fix/add vmstate handling in some I2C code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Corey Minyard , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" I believe I've fixed all the issues pointed out by everyone, and I've tested migration between 2.12 and 3.0 and back on q35 and piix4 (with the fix I posted earlier for piix4). Changes since v2: Added proper license headers for the newly created files. Added myself as a maintainer of the i2c core files. Removed unneeded code in several places pointed out by Peter Maydell since i2c_recv() returns a uint8_t instead of an int. These are in two separate patches. Added a patch from Philippe Mathieu-Daudé to replace a magic number with a constant in the smbus_eeprom code and verify the count so there is no overflow. Updated the pm_smbus migration to not update the version numbers in the existing vmstate structures. The needed field didn't accomplish what was needed because it is only called on the save side, not the load side of the migration. So I'm using VMSTATE_STRUCT_TEST() to transfer the pm_smbus data now, that should be all that is required for backwards compatibility, and will be safer for falling back to an older version. I found the problem with the SMBus being broken on piix4 after a migration, but I sent it out as a separate patch since it has nothing to do with this series, and should probably go into the current release being worked on.