From patchwork Fri Jan 13 15:45:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 642013 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp302502pvb; Fri, 13 Jan 2023 08:36:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXt1Quv4NzhU6jLLDptOe8ThRklcRtFyq51czPFSoZPVe+CUuwQRxfjs/4gPRLfbmAJIhD+P X-Received: by 2002:ad4:4990:0:b0:51e:d2cd:dd7a with SMTP id u16-20020ad44990000000b0051ed2cddd7amr13488821qvx.16.1673627783642; Fri, 13 Jan 2023 08:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673627783; cv=none; d=google.com; s=arc-20160816; b=s8SSUZFDsOykNot3uZm3GXoXrYuGUDU/j9RWU+a3CVz1KEPTVLToYfHpmqLkJ6WQNa EDBi7jpRWoRhoIwivgsw+nrVvd3WI+rDa9azjJWplhGjZe4pMOjmuNbfiT2I5rC6+iOE mcb4nBqUM4PraLoBFINy/yVNZ5o23uDTK+kdONYcObCeQGytOiqRPNQWl+LPvo5Sfzuw hvRC1rpKPtHbPDMDVLFLc6nqAAIDRKDJlCyrwx3PF8UPMl2ghxq9d+1ecDiZZxG8WSfp ic6IP0xsrWc8I8M1pyqt4PfgnQ4nYN9i3eKKf5e9lpwuWg5Y4wVP9rhu3rwhDPbwvixi hOzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0wPcunVg7yQ5n7dMEXY8T78bqLxi/bsTCdvYF3d+Ri0=; b=XbewxJf2+IhAm0GdaKxDbYp0XEZN3EnLJqWWCOsCyLM6sjZw1MYjoz5at9baCdrNec Uh4DydaPAbwVvTssrAYwPseTaOQYs62DL3c2JDfy8qWghKdZJm08iET12ooyiEllXNLn uOGXgam+erEIr6ByMLaVtcJBE3m0JGiBGlOefY1/9BUuvXBk5qJLGGfbiYYM5f83S8ea 1l1bBNOXvf/7kSizH2znvj69jyhzz1D0ViJ8QHqYi5WqhMKZcJKF6bHWcNrlY4R7omFO hsA6f50ny40RJbTyVvf2MnTg8LK9Y8sxOMA6I7QT8VlTnjs3zWy+Z+x3Gz9GKkK9Pej6 IyrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jW+KkVeP; 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 ESMTP id dv9-20020ad44ee9000000b005319f31f905si12777778qvb.85.2023.01.13.08.36.23 for ; Fri, 13 Jan 2023 08:36:23 -0800 (PST) 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=jW+KkVeP; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGMIq-0003JN-3H; Fri, 13 Jan 2023 10:49:12 -0500 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 1pGMIP-0003AA-Po for qemu-devel@nongnu.org; Fri, 13 Jan 2023 10:48:53 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGMIO-0006US-7E for qemu-devel@nongnu.org; Fri, 13 Jan 2023 10:48:45 -0500 Received: by mail-wr1-x42c.google.com with SMTP id q10so2141659wrs.2 for ; Fri, 13 Jan 2023 07:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=0wPcunVg7yQ5n7dMEXY8T78bqLxi/bsTCdvYF3d+Ri0=; b=jW+KkVePwiHrYHqSTlutt4x5FaG7P5VF+8zgPTRy2xrgbkFebeTN09+outrrpRZwCy 0PD/WpRH+U4v5B/XSIwDMvPSZm69pzy464Un+VrJNiwiYMXkAnatH/HlmwRqrH2SZjW4 01AZ81S9kx9J0LcFrbeMmc2haxImNaPmCVg95wHX89uQ+7eaCzkYbdFsGlf/r1Jfpe66 5p2L/ohI7MdLEMpj/H/t6LggoffjTzGWOAqZ6nHP57gzVR+Kneom/V8jY/A0DZ2BmH34 LOYARYGFsL+BIii/hql6aR4y9RA+6FwX/qOQllHUndIURncGgi1jCF1hAHtiioZxMxzV oZvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=0wPcunVg7yQ5n7dMEXY8T78bqLxi/bsTCdvYF3d+Ri0=; b=KxK3UvEUj5KWKAu45ppIbxufrOoFoju4niJdTPcY+CpwW1tjVkOoi/iiRk5S+rRbDO ZAIpfHUPh4w0EkKqht5uPJDtjis4OA1uSDFLf2MqL36ZFtPMnoGb/wri7vZfznEpwLtA B8fult5TajQhS8A45Q8e6aDpTNKaLOB9CSemyU0I0bkwfpMbDTIKpmuMGK9GPTWmIFdN jSV+2uDR43leNIJkz54XZSxyWxWQVmzFZk7XgGyTTEslkhihsqIOR7rWFbmdKreGpnYF ju1i4cs7iO95D1NnknNTf8qDVuiXkAV/zr8IrIVbiZYH0srOHzf+yhXtw1BSUQydUxBf 8pLA== X-Gm-Message-State: AFqh2koERY1F/iFayYUTSq3llYJtu01YNsRYNPxElrmnE1/C4GU56dRf +XLo9a2OvxpIzVjGM1q+canUX5Ox+yj0JLza X-Received: by 2002:a5d:5b18:0:b0:2bd:db84:d663 with SMTP id bx24-20020a5d5b18000000b002bddb84d663mr256143wrb.5.1673624923179; Fri, 13 Jan 2023 07:48:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g2-20020a5d4882000000b00286ad197346sm19251049wrq.70.2023.01.13.07.48.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Jan 2023 07:48:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PULL 39/46] softmmu/rtc: Emit warning when using driftfix=slew on systems without mc146818 Date: Fri, 13 Jan 2023 16:45:25 +0100 Message-Id: <20230113154532.49979-40-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230113154532.49979-1-philmd@linaro.org> References: <20230113154532.49979-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth The 'slew' lost tick policy is only available on systems with a mc146818 RTC. On other systems, "-rtc driftfix=slew" is currently silently ignored. Let's emit at least a warning in this case to make the users aware that there is something wrong in their command line settings. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Message-Id: <20230110095351.611724-5-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- softmmu/rtc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/softmmu/rtc.c b/softmmu/rtc.c index 7e2956f81e..f7114bed7d 100644 --- a/softmmu/rtc.c +++ b/softmmu/rtc.c @@ -33,6 +33,7 @@ #include "sysemu/replay.h" #include "sysemu/sysemu.h" #include "sysemu/rtc.h" +#include "hw/rtc/mc146818rtc.h" static enum { RTC_BASE_UTC, @@ -177,10 +178,13 @@ void configure_rtc(QemuOpts *opts) value = qemu_opt_get(opts, "driftfix"); if (value) { if (!strcmp(value, "slew")) { - object_register_sugar_prop("mc146818rtc", + object_register_sugar_prop(TYPE_MC146818_RTC, "lost_tick_policy", "slew", false); + if (!object_class_by_name(TYPE_MC146818_RTC)) { + warn_report("driftfix 'slew' is not available with this machine"); + } } else if (!strcmp(value, "none")) { /* discard is default */ } else {