From nobody Mon Sep 16 19:29:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709492122; cv=none; d=zohomail.com; s=zohoarc; b=lJoT7IE3krYvwSMOyYBodaOkCmggl+hROVI0nYpPTvk6AlIgsQ3dUvne6aN64MH1v0A6y1iSO+KdHjjBma1NKpKONncMQkItX3iAci8wPnuTkpYQXiYr3GV7YSieVG37/Ce3QFbkiiQykD1inHy7RWVkRrjwNwIojLKIo6Gfjhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709492122; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B8smuVSbO2fN2A9j50qsVKag41OVErk/e6VgB0UOyX4=; b=BpFqGo0yqoFJzdWBZDCMhCxH6BWPXaSnQk8waTC3A9Sw/2OPCTgAdEuV+NizkQWZtWKPfKSo09sd4bghu9UQQjyVAFomOFVG3OJxCC+157/Wb7cBiIn8zTy5dM/vfvPrYAK9SYlRSwEJO66fFMBK8kBfegjZfhSOpgV3fyO7OIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709492122135132.6448874467094; Sun, 3 Mar 2024 10:55:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqyH-0002zN-KL; Sun, 03 Mar 2024 13:54:01 -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 1rgqy7-0002xp-78 for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:55 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgqy4-0003xy-Ku for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:49 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso43782691fa.2 for ; Sun, 03 Mar 2024 10:53:48 -0800 (PST) Received: from archlinux.. (dynamic-092-224-118-014.92.224.pool.telefonica.de. [92.224.118.14]) by smtp.gmail.com with ESMTPSA id o17-20020a05600c4fd100b00412d68dbf75sm5259460wmq.35.2024.03.03.10.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709492025; x=1710096825; darn=nongnu.org; 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=B8smuVSbO2fN2A9j50qsVKag41OVErk/e6VgB0UOyX4=; b=ZaE6lQlmDRXUmWs2yiijWw+SYR6lNkxOWarzsXDDuLXgrdL2Me3xOqLvJU+uh5MfQU SY3LeisXNIgN7zMK0UeiRSl6K9L908BtjuWg+updJts0eV4+I+iRAv1MCv7y/4+2uJWo quBuRde36+bITRNOEa53AKwNsVer87z3ErlzkHYA6QY5gZbBtUILiTlh4aro+ovsh/fc AwwfF1RmiSfuoqLJehRwUYGFZ+SBu4K+eFakm0YefG/oxH9rou7iOt+MOm1o3GMtKgbH q2C7d//5CdStAwsfWOdqkps2gComKJKbir5jEMyLayT1D5EOdRS0/zhzuyoZb6Oc/Kzv TVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709492025; x=1710096825; 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=B8smuVSbO2fN2A9j50qsVKag41OVErk/e6VgB0UOyX4=; b=dsrPuTXwp0KbNYkWjDvZc+5gUGghiDYn/1Efj15oL+daFXy+9iHka9e7+bVTBGnyaT xD0Ofiq2f6b1Yo0Pd3DMT5ZA8smmnA5E5YOsKMM7/8Y6sVysxgSS4L3Xdb5pPT6laS9T 5Ev5gXsPmB5kKPWdSO/46NFk8vHiBiKXjqFVM6e73+sxv4yW/hWmDP96AmU9xvcj5S6Q R9brjcGE6t24xCienYonvZ5QW9NSRcqSSeKEQGyMDaOwaslslxvv+zKTSs06G9paOs5c n38NDYG+3hYym+3eTYIGWzSektKXyYK/oCfwOcNdty+9zfT6rgmnZHQIv/fA7JFh1LKo 4tVA== X-Gm-Message-State: AOJu0YwLTHRNUJvsl6XaCMRzjinZ3INq2tAheQZ9xvgsImkf9soIZFk8 rVP0aNl766wzNw46xW+ldbOk3a2ZQZYgO2SI+xEghBSAVbY1ZkmlFUjWCE3i X-Google-Smtp-Source: AGHT+IHActmuY6zBRxH+SNmBhoEzfZTlMjNDZ8xhM75p4rkW6eCBbhX+TNBEwwwG4Lgyaz2/e93P7w== X-Received: by 2002:a2e:9d85:0:b0:2d2:d449:6425 with SMTP id c5-20020a2e9d85000000b002d2d4496425mr5029555ljj.35.1709492024878; Sun, 03 Mar 2024 10:53:44 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Eduardo Habkost , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Sergio Lopez , Paul Durrant , David Woodhouse , Richard Henderson , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 1/4] hw/i386/pc: Remove "rtc_state" link again Date: Sun, 3 Mar 2024 19:53:29 +0100 Message-ID: <20240303185332.1408-2-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240303185332.1408-1-shentey@gmail.com> References: <20240303185332.1408-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=shentey@gmail.com; helo=mail-lj1-x232.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709492123799100003 Content-Type: text/plain; charset="utf-8" Commit 99e1c1137b6f "hw/i386/pc: Populate RTC attribute directly" made link= ing the "rtc_state" property unnecessary and removed it. Commit 84e945aad2d0 "v= l, pc: turn -no-fd-bootchk into a machine property" accidently reintroduced the link. Remove it again since it is not needed. Fixes: 84e945aad2d0 "vl, pc: turn -no-fd-bootchk into a machine property" Cc: Paolo Bonzini Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f5ff970acf..63b7583af0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -613,14 +613,6 @@ void pc_cmos_init(PCMachineState *pcms, mc146818rtc_set_cmos_data(s, 0x5c, val >> 8); mc146818rtc_set_cmos_data(s, 0x5d, val >> 16); =20 - object_property_add_link(OBJECT(pcms), "rtc_state", - TYPE_ISA_DEVICE, - (Object **)&x86ms->rtc, - object_property_allow_set_link, - OBJ_PROP_LINK_STRONG); - object_property_set_link(OBJECT(pcms), "rtc_state", OBJECT(s), - &error_abort); - set_boot_dev(pcms, s, MACHINE(pcms)->boot_config.order, &error_fatal); =20 val =3D 0; --=20 2.44.0 From nobody Mon Sep 16 19:29:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709492095; cv=none; d=zohomail.com; s=zohoarc; b=GExsj1NMRZ9B7xZfJzkVFVgNbdvVzh/mDa8Bar3Rq8GcM1a4wuiiy6OPNn6eXLpYKx74B81sCjbo+T+XEbM+7Dh0/kjw9/lEXgRRFKSDZrhKH4EYuvFmC3RtGfRZYLmPXCK2vcYUJdv2I4Y39fIqwM1lX/AIohcj6cD/rhlFCQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709492095; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UyJ9mxtdoxL+DYRUJvwUw3QhltHpzKE9QiB4/SHTQxQ=; b=JgNqaOko6C/oui0ft+F0KCRgHOGW8k9NbNfS5TQkVXBxGpKPevKBHb8WF9mEfmOJnab8QOeoRd6iDuTVJ7SorlPIJi9Rd2NrHhTGnkD68t9bspgWSnW5kWPn8lhrwANEEF9QZW/69b2Dj8zoHMVxqclqreXxEmVrwAO02oDBQf4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709492095256392.03709314258333; Sun, 3 Mar 2024 10:54:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqyG-0002ye-48; Sun, 03 Mar 2024 13:54:00 -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 1rgqy7-0002xr-G2 for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:55 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgqy5-0003y8-RE for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:51 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-412e14dac68so2667785e9.3 for ; Sun, 03 Mar 2024 10:53:48 -0800 (PST) Received: from archlinux.. (dynamic-092-224-118-014.92.224.pool.telefonica.de. [92.224.118.14]) by smtp.gmail.com with ESMTPSA id o17-20020a05600c4fd100b00412d68dbf75sm5259460wmq.35.2024.03.03.10.53.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709492026; x=1710096826; darn=nongnu.org; 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=UyJ9mxtdoxL+DYRUJvwUw3QhltHpzKE9QiB4/SHTQxQ=; b=eECQsyGFzyd8rdCTMZcQIKkJYe6cLuyPZ1xvqFITBBDS5WDsu3Fsdzeu3EhQO6/wt3 LtQmT5SQpUsIyVv/p+7Ecp2wjSIOrI1S12sRUCmy5C3JssY6Dnq6/XmxsgjEu8Ie4E98 y7JjdLuGdKJILpmHep1Fwqgh/042Wom02ITI0qp1oPwq0E3/VdOSaBJMqHigE5/yU/aT bz2UIo6dMTudc4q2Ob6h4I1HDZ6oLLr0gVHzxUPolbBRLSLoDTUvpJAZwyzG3Y9djf+d BUyrtPZeQxGglRk03emcfRJA+bjqVDzoWgf5fQz8CcmIc2H5+5oyD4j13SSk5PECzDgY nn+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709492026; x=1710096826; 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=UyJ9mxtdoxL+DYRUJvwUw3QhltHpzKE9QiB4/SHTQxQ=; b=rCwhOZPSkNAWm+uExs4TGNtGyN9+pmNO39qRFV1qv8nuOte3lUAG7JgQ5YB/e0xc1F oNlwKTbo94YIVPQYIUWdpmjls7ZwlF98GFEx6NyUGYE+b6j20GF+kswj+Gr/b63VObLi 3yxSfYEwRQfLfTttPf/BNC5ANk2L6zhj+DbiEGN1r1I7JjPLeYjmW0qxHVVE/rz6eh0O eRfGpWL/dU15Y+5VSh2l2/8a3fPTsun5W5earNc2Jojcfi3l2hV+fzCBLx2BUFdK7Vgz MjubGIZM0slvVZly4W+uR6jaKNgMidpYKg/f73yXMcqdvIGJsJzq33s+1ukpgOZk4Cke Ks+Q== X-Gm-Message-State: AOJu0YzzBsuuQLcahcYCz8NT4JzIR2EKsv1M3rB3kFXWPFhOT03uimMZ sXj7k85GZbmPsPv8Q+8y/vdAuzvedJWT5G5nUupwU9pkFjn8TZefqvs62O63 X-Google-Smtp-Source: AGHT+IH1S0OrL4jn7OQ4PakVvGTdXR6ROwHso0L8pFKW80UHTlRmgbI/AcEsg0eGOC8Ib2mm+rmu9w== X-Received: by 2002:a05:600c:4f0e:b0:412:77a4:d7c with SMTP id l14-20020a05600c4f0e00b0041277a40d7cmr6003705wmq.9.1709492026504; Sun, 03 Mar 2024 10:53:46 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Eduardo Habkost , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Sergio Lopez , Paul Durrant , David Woodhouse , Richard Henderson , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 2/4] hw/i386/pc: Avoid one use of the current_machine global Date: Sun, 3 Mar 2024 19:53:30 +0100 Message-ID: <20240303185332.1408-3-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240303185332.1408-1-shentey@gmail.com> References: <20240303185332.1408-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=shentey@gmail.com; helo=mail-wm1-x329.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709492095817100001 Content-Type: text/plain; charset="utf-8" The RTC can be accessed through the X86 machine instance, so rather than pa= ssing the RTC it's possible to pass the machine state instead. This avoids pc_boot_set() from having to access the current_machine global. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 63b7583af0..06ef278b34 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -425,9 +425,10 @@ static void set_boot_dev(PCMachineState *pcms, MC14681= 8RtcState *s, =20 static void pc_boot_set(void *opaque, const char *boot_device, Error **err= p) { - PCMachineState *pcms =3D PC_MACHINE(current_machine); + PCMachineState *pcms =3D opaque; + X86MachineState *x86ms =3D X86_MACHINE(pcms); =20 - set_boot_dev(pcms, opaque, boot_device, errp); + set_boot_dev(pcms, MC146818_RTC(x86ms->rtc), boot_device, errp); } =20 static void pc_cmos_init_floppy(MC146818RtcState *rtc_state, ISADevice *fl= oppy) @@ -1252,7 +1253,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, } #endif =20 - qemu_register_boot_set(pc_boot_set, rtc_state); + qemu_register_boot_set(pc_boot_set, pcms); =20 if (!xen_enabled() && (x86ms->pit =3D=3D ON_OFF_AUTO_AUTO || x86ms->pit =3D=3D ON_OFF_AU= TO_ON)) { --=20 2.44.0 From nobody Mon Sep 16 19:29:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709492084; cv=none; d=zohomail.com; s=zohoarc; b=GOcH+bmrT85sNJ7seQ9sox/p3mmVe4LUUMA2ZyOViMJZYvxDmT/wp4Y9N4yPC7l8Bn9Atq++flMurOIzZb7He2hHKoLk9tX4xHnY6o2m6jFEhH9OSg8K7fl5me2o7mWOCOP5hAZldgk/tIUiinyD33A+9T8QrvD4itxwRYaiifE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709492084; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6rvC2H6C2Wukg8u7UcsRKEckfeM9Uh0xCoR3xrUsp3g=; b=RM23ebmECELFf2JvpZxZQIhbNt3mQaZLhqYrauswaz39yZZx/PGkwRS/E/8ntvZ6PCD2L0f4ocbDiRRLvaSkRmEJFAa866TdADRFQ/umXLBDXGFztOfJYpXqbVJhOLSxmif5exkAUxsiJuerFef79JxPOT6JX35xBvKyx6BPZKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709492084320973.2817967165338; Sun, 3 Mar 2024 10:54:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqyG-0002z1-T0; Sun, 03 Mar 2024 13:54:00 -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 1rgqy7-0002xs-R1 for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:55 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgqy6-0003yI-9j for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:51 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d2509c66daso46718051fa.3 for ; Sun, 03 Mar 2024 10:53:49 -0800 (PST) Received: from archlinux.. (dynamic-092-224-118-014.92.224.pool.telefonica.de. [92.224.118.14]) by smtp.gmail.com with ESMTPSA id o17-20020a05600c4fd100b00412d68dbf75sm5259460wmq.35.2024.03.03.10.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:53:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709492028; x=1710096828; darn=nongnu.org; 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=6rvC2H6C2Wukg8u7UcsRKEckfeM9Uh0xCoR3xrUsp3g=; b=W9gkyfT8wkGDvNsFTLBKmX4PdJKVtgZrOvufuhqaBdlTI/UK4ivX7cRrUKfZi/mCKd Navj1peKsJgY5cCNXauhNLCDc1hx5p4ySQw52BUNf/cw1B9dS6LliFdXqkN/pdtxTpzx IwvNAd4MTnmmyVQyNThT+FofNnsMmg8pytQkp1vG3Ie9XSLtbiZxy8+Il5lxFKndPhDD ah/QCKHWLSmiVldcG4iJTDToT3G4S1/PCvR7sVZiU1D5OTEV9fWehicH/d8i44lgSfQS 1as5UD2Dzg7duf6RfZVeGv0//wUcPnlFKAE2Q/PYHc7VHhlNUI4nJMeiCSqi/221vSxW cmTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709492028; x=1710096828; 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=6rvC2H6C2Wukg8u7UcsRKEckfeM9Uh0xCoR3xrUsp3g=; b=uRYGnjFirw1LvxhvAavLfaOpzxeq1wpsxJ0XVrKubcDiB8JNbNyyT9n6u16d22FGYR vxX0I2yV0LhFLGB6rbDtlc/PX4011WW5Zae0mQGJMKhm5QHYMDxtUrvl/icFsz8uh5ey 7N0preZ1+88GIHxaQ9v/fQYA90+Ok4ANdJ67sF3Imr2q2OuwA2z5LpjMBSeqfZz2DaMu 17Jl/wR4rXZrqGQGfZf96jR69RJuQndcgnZ3JqHT6GM1EH2A1bH4Lon3x/cb3tEWsASk DKRTQoU2bTeuF+kUQGnlpJxtXijl14UfGLsB4ncwtVWElKsLZD8IhjGCTvsO9cEfBXl+ rwbA== X-Gm-Message-State: AOJu0Yz+745coRETV7NeH//OgrxapMNpyeIJv2YwqpAAoVB50foiP48b t0NdD0dDr4EY7EeO0+Wza88b6jLpEzjgscO8j+LxKavCA0HXbei19LuU/niV X-Google-Smtp-Source: AGHT+IEW5wf8oVE197xweQI8A8GKcmywEQnJPnvje6Vg4EM1fJeddU/BtZ7aGqakCwFsCwKDv/WgRA== X-Received: by 2002:a2e:9d85:0:b0:2d2:b518:3ccd with SMTP id c5-20020a2e9d85000000b002d2b5183ccdmr5211263ljj.11.1709492027971; Sun, 03 Mar 2024 10:53:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Eduardo Habkost , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Sergio Lopez , Paul Durrant , David Woodhouse , Richard Henderson , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 3/4] hw/i386/pc: Set "normal" boot device order in pc_basic_device_init() Date: Sun, 3 Mar 2024 19:53:31 +0100 Message-ID: <20240303185332.1408-4-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240303185332.1408-1-shentey@gmail.com> References: <20240303185332.1408-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=shentey@gmail.com; helo=mail-lj1-x232.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709492085866100003 Content-Type: text/plain; charset="utf-8" The boot device order may change during the lifetime of a VM. Usually, the "normal" order is set once during machine init(). However, if a user specif= ies `-boot once=3D...`, the "normal" order is overwritten by the "once" order j= ust before machine_done, and a reset handler is registered which restores the "normal" order during the next reset. In the next patch, pc_cmos_init() will be inlined into pc_cmos_init_late() = which runs during machine_done. This means that the "once" boot order would be overwritten again with the "normal" boot order -- which renders the user's choice ineffective. Fix this by setting the "normal" boot order in pc_basic_device_init() which already registers the boot_set() handler. Signed-off-by: Bernhard Beschow --- hw/i386/pc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 06ef278b34..7780d8d6dd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -614,8 +614,6 @@ void pc_cmos_init(PCMachineState *pcms, mc146818rtc_set_cmos_data(s, 0x5c, val >> 8); mc146818rtc_set_cmos_data(s, 0x5d, val >> 16); =20 - set_boot_dev(pcms, s, MACHINE(pcms)->boot_config.order, &error_fatal); - val =3D 0; val |=3D 0x02; /* FPU is there */ val |=3D 0x04; /* PS/2 mouse installed */ @@ -1254,6 +1252,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, #endif =20 qemu_register_boot_set(pc_boot_set, pcms); + set_boot_dev(pcms, MC146818_RTC(rtc_state), + MACHINE(pcms)->boot_config.order, &error_fatal); =20 if (!xen_enabled() && (x86ms->pit =3D=3D ON_OFF_AUTO_AUTO || x86ms->pit =3D=3D ON_OFF_AU= TO_ON)) { --=20 2.44.0 From nobody Mon Sep 16 19:29:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709492118; cv=none; d=zohomail.com; s=zohoarc; b=A5r2BmKY9wpQV1N7ann6Ma0Pbn3ohyuf33jUSYhtiHBnwJx/j/6KyErwLs+22+M0t9EJarQNIzMxPvMieSVio9BAEExxdGE06QpOrFc+EbzgeNPoc5UyV1cVuOryXmMHgQf7LutTZ4lVugGP3yMVbKm+na+JfFa971xytX8m+BQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709492118; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=YF4zxnr1CHaStiDCn6/x32KA/Aazi/GynIUtbypRWYcczogxyrger5YLl4M8PRBdqZlcWSbZVoxAWoBQiDfsFTW2fwgS2WwGErye9l9vxXCnAgQVwfiDrraCKkJqK14HFdQdAU/x5vo7FMMCPitniV6mAXdDifl61C5EE+UEtBY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709492118024448.0671825144856; Sun, 3 Mar 2024 10:55:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqyG-0002yx-LB; Sun, 03 Mar 2024 13:54:00 -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 1rgqyB-0002xt-0f for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:55 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgqy7-0003yQ-UA for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:53 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412e2dfa58eso1419405e9.0 for ; Sun, 03 Mar 2024 10:53:51 -0800 (PST) Received: from archlinux.. (dynamic-092-224-118-014.92.224.pool.telefonica.de. [92.224.118.14]) by smtp.gmail.com with ESMTPSA id o17-20020a05600c4fd100b00412d68dbf75sm5259460wmq.35.2024.03.03.10.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709492029; x=1710096829; darn=nongnu.org; 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=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=ggTdwN173rTdNhoCrb4/SDNIi/gwpFuTXUF+kPpZPSYwBioRMIShyvRvz1IVeGtobw pKp0cph+ejCAbcsmK9pk5C8Jrl+r7rDB8sB4Y5HPyAlA0DNK1kxNgKk5heHYNeKJ/PM1 5BzG+Ua9ohHXQSI4q4KI72n/1f3NKjaRozDCz29USHt7jTVEF40D6rScWx6zPaGQcr93 h11NkbHBTjbRmG6D9Y6ly8588ajZtaH0NvLAb5OR/OZSjj9EmRnq+LZaxhzKIa4SMzj2 AGWtx3+YW2/yMXh4FVdygmSm7K89i22agQwNoau9F3VUdIFvttDJh67HN45bj9soet+t 33uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709492029; x=1710096829; 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=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=falN2SQ/ScTv5i7IJ3pZCM1669qJT/NoHEpdLvx6DbYZi9rv4as1kMSiUOExOZIdf9 6MeVGrD4dlrQKDGalunm3Z0fX4Y41rSZ4f3XKBDJwu9jI+IC3bZ0RcFbTejNc8h+vmiy gmjiW7mbBjJpWgxD43qp+hUooLIwkHF1BdbNxD+llOWJdoJSZDtrmJ96TL8J/wHl2laH LvSzcR5Q/ZbKyex2w1ycmrlaejSvbkfBhc/e35AP9hUCNTlWDnKzAhBs5EA7uJmMZbhk B4xymdL8IFwDWFfX6rvawqE7JTxY+fEeeLIxK/nHlngnawhc6pn0mbWUHjaNOmzEL0KB 9hPQ== X-Gm-Message-State: AOJu0YwuATaVmJ+AbY+HwXkdOU+Vct6Z16tjHzXnvnLSg17ZB8myGWK6 Uxjg5usjnzakHz/ZKkpcDauNxqSPAxAZvUBU+Rir+DWIFpW37ssLf/xyklTJ X-Google-Smtp-Source: AGHT+IFUSo8u73blocfm9TEjjHLhAMJGhFpEbLyicahfaMZeqb3X3wML28HjU0iOzGputokKSewqag== X-Received: by 2002:a05:600c:3b94:b0:412:d1ee:dfa2 with SMTP id n20-20020a05600c3b9400b00412d1eedfa2mr3851295wms.0.1709492029404; Sun, 03 Mar 2024 10:53:49 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Eduardo Habkost , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Sergio Lopez , Paul Durrant , David Woodhouse , Richard Henderson , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 4/4] hw/i386/pc: Inline pc_cmos_init() into pc_cmos_init_late() and remove it Date: Sun, 3 Mar 2024 19:53:32 +0100 Message-ID: <20240303185332.1408-5-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240303185332.1408-1-shentey@gmail.com> References: <20240303185332.1408-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; helo=mail-wm1-x332.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709492120013100003 Content-Type: text/plain; charset="utf-8" Now that pc_cmos_init() doesn't populate the X86MachineState::rtc attribute= any longer, its duties can be merged into pc_cmos_init_late() which is called w= ithin machine_done notifier. This frees pc_piix and pc_q35 from explicit CMOS initialization. Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 10 ---------- hw/i386/pc_piix.c | 2 -- hw/i386/pc_q35.c | 2 -- 4 files changed, 16 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 5065590281..bfdcd64514 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -178,8 +178,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, ISADevice *rtc_state, bool create_fdctrl, uint32_t hpet_irqs); -void pc_cmos_init(PCMachineState *pcms, - ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); =20 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7780d8d6dd..69e134e141 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -570,14 +570,6 @@ static void pc_cmos_init_late(PCMachineState *pcms) mc146818rtc_set_cmos_data(s, 0x39, val); =20 pc_cmos_init_floppy(s, pc_find_fdc0()); -} - -void pc_cmos_init(PCMachineState *pcms, - ISADevice *rtc) -{ - int val; - X86MachineState *x86ms =3D X86_MACHINE(pcms); - MC146818RtcState *s =3D MC146818_RTC(rtc); =20 /* various important CMOS locations needed by PC/Bochs bios */ =20 @@ -618,8 +610,6 @@ void pc_cmos_init(PCMachineState *pcms, val |=3D 0x02; /* FPU is there */ val |=3D 0x04; /* PS/2 mouse installed */ mc146818rtc_set_cmos_data(s, REG_EQUIPMENT_BYTE, val); - - /* hard drives and FDC are handled by pc_cmos_init_late() */ } =20 static void handle_a20_line_change(void *opaque, int irq, int level) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ce6aad758d..637f4d38be 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -342,8 +342,6 @@ static void pc_init1(MachineState *machine, } #endif =20 - pc_cmos_init(pcms, x86ms->rtc); - if (piix4_pm) { smi_irq =3D qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 45a4102e75..bccd13d162 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -311,8 +311,6 @@ static void pc_q35_init(MachineState *machine) smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } =20 - pc_cmos_init(pcms, x86ms->rtc); - /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, pcms->pcibus); pc_nic_init(pcmc, isa_bus, pcms->pcibus); --=20 2.44.0