From patchwork Mon Oct 21 13:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177089 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3443077ill; Mon, 21 Oct 2019 06:46:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdWisdvYezFaqBCofSUfv4RGvrvbJn/lC9uwyB9NVZNX9l1Drq81hUL8IEgqQWLfXVJAEH X-Received: by 2002:a37:8805:: with SMTP id k5mr22315419qkd.125.1571665599616; Mon, 21 Oct 2019 06:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571665599; cv=none; d=google.com; s=arc-20160816; b=oEdCToRdimjdzU3Am9GRz652PKGJpNG0jnBb9YfGbS3I4xrsRQw0vr/0HQQS/QhIn/ BkxLwE5oqFeS8b1yXL5eRPvR1KvcSN8FY5rzgrU2aZIO/48XuCZAtTy2rnoDCxmLB9di +LHITAB4Ju9YGJTbVg1HmPSe/7FkyHI0unu8BpPJaj7NEIpDaJldGEJbDNHujOj0aqWt M0MS27lBY4w3z6DPfFsgM44/cs7FMPxuybDSmuRa4H+17Pi4i3rZa4qx2rbNOlEf7Ptl iad4jfitDBILETJFMGt4Ba9zgkbCSVAyJlgSUef10Q/OAge6bSOqeM7TBR5TWoDF0hJg jsmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=qlmvdpaIFBiXFkjQ4YNJNIpdNHXmflVBlBiQ+xgkJj0=; b=Kbl+fD6dLdTJD2PRDDn3+ijvtmXoJW/dS9xl69b75rX/nuKHcjBtHO6RWVljsMgEGg Ud9YgPR3vblMTt8bKm2FRn3AiBl0lyLCM0LOySe93B1AK8fZFrPpn/NkjwmioxXeNIMw aIk/23KNBHu1KFx8edaPKtbTOX48LgYhfOGnSYRqxF3drE/Vm6pl8/d8EU91FIVWDjEY RvuLy7CzwhSJc6XyVgL4mT7oUvgqo7zJRYmLwnSFDfqMk7WK0Dmz95wXkuLVGpns8S+m 8yMwammPJ3ihyKXgRfw1uK2ZYVIVuq3EzG4OmDzJw3INIeY5VEvty59eR12XYsFBuHxS kYzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T7+AZSRt; 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 n27si1682350qta.87.2019.10.21.06.46.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Oct 2019 06:46:39 -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=T7+AZSRt; 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]:42226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMY18-0002Bl-M4 for patch@linaro.org; Mon, 21 Oct 2019 09:46:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41488) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMXyd-0007vQ-Qp for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMXyc-0000l4-GI for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:44:03 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMXyc-0000jw-A4 for qemu-devel@nongnu.org; Mon, 21 Oct 2019 09:44:02 -0400 Received: by mail-wr1-x436.google.com with SMTP id w18so13522320wrt.3 for ; Mon, 21 Oct 2019 06:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qlmvdpaIFBiXFkjQ4YNJNIpdNHXmflVBlBiQ+xgkJj0=; b=T7+AZSRtnSvrLaYYDqEhKoS7fvLUj5n7w9iNsnsupHSTZzkUE1+uEJ2iLTbcWxxuzB onAzwbByMj0/s3BiTeX2WAFVXD2nSWuWCspvMyGh+/wA3a5CwBFfUHqCn/h/bqbrgCsr 38zdui/o+lKu1J+qUfi4l7O1QRNT863v+O7vuEkAV7tt6gZSjCkdv018hrKygmEbjuH1 mo1yvleUXeXE4pg4A5UoaW29p48e2fTa7McOHJFpD8mq77F1NSpKT5QZPG1Zz8xnxa7d mrxdnNG49ToBy7EbX4XZYFktcBZUeX/QpG6Ua8Ii5y1rFKSfEsrYYpW11fUG+GAEdgE8 DS7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qlmvdpaIFBiXFkjQ4YNJNIpdNHXmflVBlBiQ+xgkJj0=; b=HD322CZtCqbyxAMoDvqRqurEjhEtUx2jROXQyoLH6C4PWMgBappezSrRVE0/e2SxiW IePbvdnjWWTehDkVdYeuyx8n2Dpb2aKR85It1Y7vND5IpHuIwDgfJ+5/eDRYK21hFkj8 cMd6DKnxVPvkDusOnSMZIver8PcQEpoIsaU9Q9XOdOZIXzEGtdxEU/BtiH8+OVBfTqYZ DXZPAYemv6GoMHq0qK4HIwzQ5OYNo9UGMbVGTndlHijPOQ2LzmQfnYbiFx0CR5HmwxjW JrWBxIg9OD+EHT28XE6kzh54xhAjj4OWtVVYWDl8LqAcl/hmTmQyREXKmkChd19ZcVhr 3uVA== X-Gm-Message-State: APjAAAWo4WfvJ75wXe1dtp2rNRyigK3eT5dqQfA5G4zbQAd0ZAaXPReK 0F9wekizk4qhn4nNU4rnk9yYlnJKBDE= X-Received: by 2002:a05:6000:12:: with SMTP id h18mr9864973wrx.161.1571665440606; Mon, 21 Oct 2019 06:44:00 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id q196sm10443689wme.23.2019.10.21.06.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 06:43:59 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v2 0/3] Convert sparc devices to new ptimer API Date: Mon, 21 Oct 2019 14:43:54 +0100 Message-Id: <20191021134357.14266-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , KONRAD Frederic , Richard Henderson , Mark Cave-Ayland , Fabien Chouteau Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This patchset converts the devices used by sparc machines to the new ptimer API. Currently the ptimer design uses a QEMU bottom-half as its mechanism for calling back into the device model using the ptimer when the timer has expired. Unfortunately this design is fatally flawed, because it means that there is a lag between the ptimer updating its own state and the device callback function updating device state, and guest accesses to device registers between the two can return inconsistent device state. This was reported as a bug in a specific timer device but it's a problem with the generic ptimer code: https://bugs.launchpad.net/qemu/+bug/1777777 The updates to the individual ptimer devices are straightforward: we need to add begin/commit calls around the various places that modify the ptimer state, and use the new ptimer_init() function to create the timer. Changes v1->v2: * patches 2 and 3 are the old 1 and 2 and have been reviewed * patch 1 is new and removes a pointless NULL check; without this we'd probably have got Coverity errors when patch 3 added a use of t->timer before the check for it being NULL thanks --PMM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *** BLURB HERE *** Peter Maydell (3): hw/timer/slavio_timer: Remove useless check for NULL t->timer hw/timer/grlib_gptimer.c: Switch to transaction-based ptimer API hw/timer/slavio_timer.c: Switch to transaction-based ptimer API hw/timer/grlib_gptimer.c | 28 ++++++++++++++++++++++++---- hw/timer/slavio_timer.c | 32 +++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 15 deletions(-) -- 2.20.1