From patchwork Tue Oct 25 16:39:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 618127 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3520141pvb; Tue, 25 Oct 2022 09:49:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7IV92lr/xapkqtdajd1c5QuGS4kxJSpcLMbVyioGMvSO5akfyQuOTpqcfsq0li92BJcv0E X-Received: by 2002:a05:622a:1c1:b0:39a:9da4:1177 with SMTP id t1-20020a05622a01c100b0039a9da41177mr33112966qtw.11.1666716559905; Tue, 25 Oct 2022 09:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666716559; cv=none; d=google.com; s=arc-20160816; b=zPwg9Ur5vHySbosvJvFC/+DpaKBGj4k9UPanYG4iatGDGR3RTxoBNJ8+GE6vbkLCkd 8/giajybFIyKij2GW1YGbojs7e6/VZYqggVLnKPHnpubP5FL3GVW/V5kpsG6M6SScIzX xvfuIoXAputAJI5rMSz+SWes0I0xO8jOl0O7+3SZOZmMbbfLeP2YGRxxCwkxKcZ5ZO9x lNz7XavalL4Nq+SJfii9B9amSe+SV8vl3JNxyplaiNk5Pe+o3mjUH5IpJVH5JZRXMGE/ a3BIzrDfTJ7T96eMMTUJ6z7fPs/I/ZDH14MqX1TK7GdfjiOlSkwotZcucvYKZc/DALRM Maiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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:to:from :dkim-signature; bh=3kQR/k4FXpFM00JdMuTW5fGm+HZ5nsSbJYa2cV1JqRI=; b=biVGrR7QD2L6CKEGkJCHBZFEAhWDZCOJ4S+u1ao75RIw6p01f5fW00qm/DzAjswSf5 i/n7Dfv7pVJPSTn8WLKjvi91NwnfQWTyK/N1rWvSt927+OigD5BfJeETDf1hAMobwbno R7wX0e80wlknVhPdcShDZdWMy4v5z2lsoPSnm6ga0oWk14YnV3c9R26MgQ6Pi9znxR3R 6ZqihiZQS7Xy6coUR4iWBPh8a6LhUF9+DiHZ3rD9l5opCzwms/rzkrUS/YbgkA7HmMXe x4qOATchz3PPP02zPUhIueIYLUWjyEU3DxoNRmJTbKRDkLfwAdU6FAL9TcO5vlhpdg+S Nu6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X3RfrRGe; 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 h3-20020a05620a13e300b006e9ab21c842si1864873qkl.188.2022.10.25.09.49.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Oct 2022 09:49:19 -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=X3RfrRGe; 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 1onMzU-00074C-Kc; Tue, 25 Oct 2022 12:41:24 -0400 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 1onMz1-0006eW-Ae for qemu-devel@nongnu.org; Tue, 25 Oct 2022 12:40:55 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onMyg-0001bE-OT for qemu-devel@nongnu.org; Tue, 25 Oct 2022 12:40:52 -0400 Received: by mail-wr1-x42a.google.com with SMTP id o4so13850778wrq.6 for ; Tue, 25 Oct 2022 09:40:26 -0700 (PDT) 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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3kQR/k4FXpFM00JdMuTW5fGm+HZ5nsSbJYa2cV1JqRI=; b=X3RfrRGeIkWpfflrZ0sIMkKcB4wDVLQxAr/iThYJrdWmo35yY66HRL3ap4NpsBHbdP /ci0ikT9tuDf3ODmGZDPpKekrTs4+JJVk1hbJxFyXpM4+ROCqHRYTMTvp7vSHMEBGs6Y blj6pCjBkVjA/X+L12nJvB+jAeKyaWUcgIoC6Tf5ho56ZGyPnI1co8iP+NGCcmMWrxKc NyVu1J8J+NY1CMF+9Ce++DLFlhbVKqBZru8N5jYa3sDxTYNJlP6nXhAvNuGD4NauX4LB VhMxMaluW0pArKIVBLAGjcp7VxynkYMiFZ66xSqGCR+SkTlfU/4E8hd6fwnldHjS6tnk KEMg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3kQR/k4FXpFM00JdMuTW5fGm+HZ5nsSbJYa2cV1JqRI=; b=Nf0VzHy7GNjlwHyAdCJ71MjpdLqPOu/Kty7clsx+aAJ+KmCyWc5KHIKR4aRWRHHNcp mm6JA8VxqY8Gvb5Hm9lquW6DzpjWOqH9nehW065SpyQzyXdEodMD3dlHGJooyHYoKIAq VtnJLEDoiEzo27gl/UDHokb0EE6WXLgrDgEXBSQwTeEx2K/6cIp3Afkkkx/gObFXinaD hz+7B0yCuCiunjCoJ1nBgHLfcVvH9J6nXl7JsaociPu45V7IP9dTeZcpopqV2xyNXS4+ miJbOElioRDatMiqGiOoYK0E0W4hSiu+ril5a4HOtXWQ3nuXyS226rRpO5CCOLP0cOQl Q1jw== X-Gm-Message-State: ACrzQf3fnWDAHjXR7lmThzb/D6Es5yJ3wpKtSjYXO2gPN7XtVLResqW9 2tM1JN4JG2SV7a8h88KOMMa+0rI4Po99Aw== X-Received: by 2002:a05:6000:156e:b0:22e:6bf3:79d0 with SMTP id 14-20020a056000156e00b0022e6bf379d0mr26621512wrz.456.1666716026739; Tue, 25 Oct 2022 09:40:26 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id z12-20020a05600c220c00b003cd9c26a0basm2971084wml.40.2022.10.25.09.40.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 09:40:26 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/30] mips/boston: re-randomize rng-seed on reboot Date: Tue, 25 Oct 2022 17:39:50 +0100 Message-Id: <20221025163952.4131046-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025163952.4131046-1-peter.maydell@linaro.org> References: <20221025163952.4131046-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: "Jason A. Donenfeld" When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Aleksandar Rikalo Cc: Paul Burton Cc: Philippe Mathieu-Daudé Signed-off-by: Jason A. Donenfeld Message-id: 20221025004327.568476-9-Jason@zx2c4.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/mips/boston.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index d2ab9da1a01..cab63f43bf4 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -41,6 +41,7 @@ #include "sysemu/sysemu.h" #include "sysemu/qtest.h" #include "sysemu/runstate.h" +#include "sysemu/reset.h" #include #include "qom/object.h" @@ -810,6 +811,8 @@ static void boston_mach_init(MachineState *machine) /* Calculate real fdt size after filter */ dt_size = fdt_totalsize(dtb_load_data); rom_add_blob_fixed("dtb", dtb_load_data, dt_size, dtb_paddr); + qemu_register_reset_nosnapshotload(qemu_fdt_randomize_seeds, + rom_ptr(dtb_paddr, dt_size)); } else { /* Try to load file as FIT */ fit_err = load_fit(&boston_fit_loader, machine->kernel_filename, s);