From patchwork Thu Oct 17 13:28:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 176627 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp949696ill; Thu, 17 Oct 2019 06:45:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq39AuPIGU/pjNzF8ZOoqEeMlNzE/b5WkvDWwtxpRYQQmLFIz2l+vK6usSSfZ51l5OEkAH X-Received: by 2002:a37:68b:: with SMTP id 133mr3234050qkg.315.1571319917409; Thu, 17 Oct 2019 06:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571319917; cv=none; d=google.com; s=arc-20160816; b=Hif1bpE55jxeVPyj79g3AcucOxwtw5s+xdDfbJZrAOYdxN9we6e80w2odO9mwkhh8i 3HMu5UWzi5k8LnxzA1naXmhzzxr1NFhl6b7p5rlglXJ7Ua/cbAKw4uhTyQ0qgMo98lMe 9jrWKQhPdKCPx3fJnhLMarUH04HgqBdx2OxuTFNzhR4fe/I5g5AjRBIq60/+pj28mlDF plBz1jNRlDEpfo4a7ojS1D2hIgZ59W0mbeW3V+oTQAOgvq58SQq6/1z4xqSt6dbmdi7v h2zL8ARwwiKoTqLG+TYPoqUPpKp6NQBLjj3RcDjhmKmoCSD2uSuISYiAUk1Vh4zMK2mZ owdg== 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=nyhhqAl7Z9TETz1bn0jRLKleGGKQCC3sDu2+swR1V/Q=; b=j/COAmyjQXm7BdKlmRLWqqfejAgFe0Lzn/S3KV9hNh+kWd+rqM4tuBdr3waZEMk0lw NYqnAgk8VgVkFe5ilWwRtMNrgC3r34wdOoUhMinb3tWwoTKoX6jfq5xEPjWmGm3koopl 1zs1GeArGLHlJLIwNnjAoZ5TmRy0UfJmmxxhXWzgAZTS1a43W+yMjIAy5t7uyu/gYS6r PdDoqvsM0L/9ysWxh4O0kv/IhQH0ptoEOdiB02RsQCNnlbSyXu8fif8aNu5Uus2A+YaO ynSKtCM/w88Q0JUcZpyDrmcnJAxHBvy3UDw6CztNFM4fXswk0QKgMTJ2NjEKyeyaQkmZ zfdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IOXaLxnF; 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=pass (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 l44si2218894qtb.384.2019.10.17.06.45.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 06:45:17 -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=pass header.i=@linaro.org header.s=google header.b=IOXaLxnF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL65c-0000lH-4P for patch@linaro.org; Thu, 17 Oct 2019 09:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36119) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5q3-0006iV-Dy for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:29:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5q1-0002YP-6G for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:29:11 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:34326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5q0-0002Y3-W7 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:29:09 -0400 Received: by mail-wm1-x344.google.com with SMTP id y135so7047655wmc.1 for ; Thu, 17 Oct 2019 06:29:08 -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=nyhhqAl7Z9TETz1bn0jRLKleGGKQCC3sDu2+swR1V/Q=; b=IOXaLxnFPFP114/5iBdVo9nM8yQ6CF8C5XkHTeF4X+P2HaOkY8YEujVpM1B9nK3CFO t3RG6t6aBif2BCt95EH10WeVZA90Pdvk+67NSFh4UIO6Zh1mJ8CI4cpIWZ36BUMpvIk8 Ps5DWiSATCkuNu3u9pMKrQEpDjjpu3JEKy935dTB+3FnBmERR4PwLoYkuoXs370gqbrj q1JcwggXF5iVsn6LXbWuK1BKUEMjRtbRW7sLSYHUK9dxYxVoRRmCr38hdKwDSM7PG7LI txJn7YDR63Ow/2l+RHguZFTWm+vo9uN/M2WQ0noW+pYATgEQAPsPzIIC7DW+EPwF9g0V uQ/w== 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=nyhhqAl7Z9TETz1bn0jRLKleGGKQCC3sDu2+swR1V/Q=; b=KDr5hTOaQ8p0Tz+oMJB9SjtA9jKXlnFGnWc+XK9h3oJmpy86jcnYsJCSY0+8q6LADa bie9yd6ner86ojpwC+5O+QHUijZQjJHO0HU2Vtvu8klEslOE47/NS1Kah7zcDcdRrwwx RwO/JxmHrt/XpO7P3dkyoKvshxZazAHyOaidoT4ZFD7O8aIAI2VDDR//txTH9NFM9r7p axkvyXwnVt2FiWMfC/eCuRfNI6QRuCd/K33Ktx3tcr5qIT3m6b5sDA6v5INVuS7tfQS/ auZi322wA1xKqVRTV0G8cJ2pAUeJxjAdNpgawE59TYQ35bF6vysvf8DtjHE6bd/i8W7f uA+Q== X-Gm-Message-State: APjAAAUr06eJl6vLRPGSa586Go78rTpJoV00Xx3M6knGoyhdABX9q3Wa dE46wKR+S264tBbhQDFXKYA0+LGSq7bFyQ== X-Received: by 2002:a7b:c40c:: with SMTP id k12mr2908563wmi.100.1571318947449; Thu, 17 Oct 2019 06:29:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n15sm2703392wrw.47.2019.10.17.06.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:29:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 0/8] Convert misc-arch devices to new ptimer API Date: Thu, 17 Oct 2019 14:28:57 +0100 Message-Id: <20191017132905.5604-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::344 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: Thomas Huth , "Edgar E. Iglesias" , Michael Walle , Guan Xuetao , Magnus Damm Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This patchset converts the devices used by the miscellaneous minor architecture machines to the new ptimer API. More specifically: cris: hw/timer/etraxfs_timer.c lm32: hw/timer/lm32_timer.c hw/timer/milkymist-sysctl.c nios2: hw/timer/altera_timer.c sh4: hw/timer/sh_timer.c unicore32: hw/timer/puv3_ost.c m68k: hw/m68k/mcf5206.c hw/m68k/mcf5208.c 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. Testing I have done: * 'make check' * running a milkymist system image I had lying around * running an sh4 system image This doesn't exercise the devices very much, so more specific testing would be appreciated. I plan to collect these patches up and get them into the tree with other ptimer-related changes (probably via target-arm just for convenience) unless anybody would specifically like to take a patch via some other tree. thanks --PMM Peter Maydell (8): hw/timer/puv3_ost.c: Switch to transaction-based ptimer API hw/timer/sh_timer: Switch to transaction-based ptimer API hw/timer/lm32_timer: Switch to transaction-based ptimer API hw/watchdog/milkymist-sysctl.c: Switch to transaction-based ptimer API hw/timer/altera_timer.c: Switch to transaction-based ptimer API hw/watchdog/etraxfs_timer.c: Switch to transaction-based ptimer API hw/m68k/mcf5206.c: Switch to transaction-based ptimer API hw/m68k/mcf5208.c: Switch to transaction-based ptimer API hw/m68k/mcf5206.c | 9 +++++---- hw/m68k/mcf5208.c | 9 +++++---- hw/timer/altera_timer.c | 13 +++++++++---- hw/timer/etraxfs_timer.c | 23 +++++++++++++---------- hw/timer/lm32_timer.c | 13 +++++++++---- hw/timer/milkymist-sysctl.c | 25 ++++++++++++++++++------- hw/timer/puv3_ost.c | 9 +++++---- hw/timer/sh_timer.c | 13 +++++++++---- 8 files changed, 73 insertions(+), 41 deletions(-) -- 2.20.1