[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 1/6] dom0: replace explict zero checks
- To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 2 Aug 2023 09:46:54 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0s7bvAesuRkdCPN/OC5YevGNnXHQrUja18fb/4dflmA=; b=FNFWm3tGa+78Z9xxF2YxFGAniUXeSPIfCfnVcjNgtTcCzxJy1Kc6eFE9Z1e+00bjisR/zF2tbEgv4sNckDSYTCh7H5zPtg4HL5c6Za+GcJYO4CtyMGix4QFMKAI5kx4JOFj0vQvCpc62qC1I9Wo9N4Fnfq3zrUyMA3SVipuMMTdOjHZU/uFOMifGsD2HjMBaRJzfNLhkIhR2eojXvsSjuem7qt+Nu98oUpZRRRTORzibfDj81cETRIHavXfUju1/+Fyv4AlOsYqxEmHJZlE5AaK1bx+LAEyhwpqNMnYHb5ynI7jxVy5gexemJb8XtppmQmasI4Sjsbpk6JOr4eSWIw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I0zPL0yEK4l8cgjLTQPuk4pjf15gYTy5TbwXnN6F/gCxAdhtWOPuqnLjDeeDeoPsucIsaOkOU4yLpH8t/moUotEbl35FsQYUXGpYSEIwx0HcE+7n7VtfLrW1DhU56rWIJ1A8M8uvZdhAEkjqLVrtmg1wQwcHKfJtBMiQ9mDZN8YLiGirCf73MFUSFeMaU/mDUbTxrkrXq8dfYcGLfjdlqdGXgszEtzqSw9XFq3nsj8YfMW4Sr+XbX2NckI1rS1+JaZjGPS1Nrac/rqbk/xj/ctCsgLTX+FShtGfvsfpIsUXxeyODSNW9NvYOyLaUEvL9zSyD1Fd+lDtbqLSFIjR64w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Nathan Studer <nathan.studer@xxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxx
- Delivery-date: Wed, 02 Aug 2023 07:47:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 01.08.2023 22:20, Daniel P. Smith wrote:
> A legacy concept is that the initial domain will have a domain id of zero. As
> a
> result there are places where a check that a domain is the inital domain is
> determined by an explicit check that the domid is zero.
It might help if you at least outlined here why/how this is going to
change.
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -1058,6 +1058,13 @@ void scheduler_disable(void);
> void watchdog_domain_init(struct domain *d);
> void watchdog_domain_destroy(struct domain *d);
>
> +static always_inline bool is_initial_domain(const struct domain *d)
> +{
> + static int init_domain_id = 0;
This may then also help with the question on why you use a static
variable here. (In any event the type of this variable wants to
be correct; plain int isn't appropriate ...
> + return d->domain_id == init_domain_id;
... for this comparison.)
Jan
|