From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1uI5S3-0002h7-JW for mharc-qemu-rust@gnu.org; Thu, 22 May 2025 08:55:12 -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 1uI0bg-0005m7-1Z; Thu, 22 May 2025 03:44:48 -0400 Received: from mgamail.intel.com ([198.175.65.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uI0bc-0000II-GU; Thu, 22 May 2025 03:44:46 -0400 X-CSE-ConnectionGUID: byn5qMoPR6GQLy+Pvv6M7A== X-CSE-MsgGUID: DdP8dZ9VRRW0vCr89p39vg== X-IronPort-AV: E=McAfee;i="6700,10204,11439"; a="49648576" X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="49648576" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2025 00:13:49 -0700 X-CSE-ConnectionGUID: 6wiW2drYR/6IzEoiq/Go2g== X-CSE-MsgGUID: FeWAS7M9Q3iN2VY90+lShg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="140997796" Received: from liuzhao-optiplex-7080.sh.intel.com (HELO localhost) ([10.239.160.39]) by fmviesa009.fm.intel.com with ESMTP; 21 May 2025 00:13:47 -0700 Date: Wed, 21 May 2025 15:34:54 +0800 From: Zhao Liu To: Paolo Bonzini Cc: Zhao Liu , qemu-devel@nongnu.org, qemu-rust@nongnu.org, Dapeng Mi Subject: Re: [PATCH 2/5] hw/timer/hpet: Adjust num_timers in hpet_init() Message-ID: References: <20250520152750.2542612-1-zhao1.liu@intel.com> <20250520152750.2542612-3-zhao1.liu@intel.com> <20486914-1752-4710-b000-52ee04d4106d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20486914-1752-4710-b000-52ee04d4106d@redhat.com> Received-SPF: none client-ip=198.175.65.19; envelope-from=zhao1.liu@intel.comg; helo=mgamail.intel.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_NXDOMAIN=0.9, NO_DNS_FOR_FROM=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 22 May 2025 08:55:08 -0400 X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2025 07:44:49 -0000 On Tue, May 20, 2025 at 05:16:22PM +0200, Paolo Bonzini wrote: > Date: Tue, 20 May 2025 17:16:22 +0200 > From: Paolo Bonzini > Subject: Re: [PATCH 2/5] hw/timer/hpet: Adjust num_timers in hpet_init() > > On 5/20/25 17:27, Zhao Liu wrote: > > Currently, HPET adjusts num_timers in hpet_realize(), and doesn't change > > it in any other place. And this field is initialized as a property. > > Properties are initialized *after* hpet_init. For hw/timer/hpet you can > check s->num_timers and return an error if it's out of bounds, but for the > Rust version we don't have Error** support yet. :( Oops, yes. (Note for myself,) the default property value is set before hpet_init(), but the subsequent adjustments to property (via object_property_set_uint8()) need to take boundaries into account, which is why the num_timers adjustment is placed in realize(). > Queued 1-4-5 for now. Thanks! Zhao