[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cxenstored: wait until after reset to notify dom0less domains


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Oct 2023 09:06:42 +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=uKdDwI2hzVwx/kUhrO3TgG3tpZjsIQYiZp1FPIOF9Mg=; b=jCRzvl3U7Tjq/79XC0X0yiP1kghSc4DTBn77USB4wehkzG94KaYXQf4X9IAUlvtv7HNTluqa73uio9M+RN4sZjALqZSnRnLK1P0l4ncFMblTja/j9K43+pygGtXYupfobTcSvAOvPNrrPZiCp72HF0PTespuDIqgmwCJFTFP/h4gYcHphRJS1Orc31I2+G3EH3//vasHqcrbyOZAZQrAi14ggb0TfTQAxf5fX2QYCs/HEjmW3L8vZnZz85/xH1gs4uz0XsiVuznHU3lBaYoQ+kM2Smm5aO8mWAR2kykqD/mYO3F9Btczjx1cHyVG9wPi2dv1QxyoRCfW+dKNVvkLZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y+ZWTC6ChlcDy3pbTyPWJ9VtA+uaKdRSsJdS6bJo3VhokhLOV/1JwfSNqjQW5bs/vX40FtReBBrS4iYN/mzwr1SHdbZzVWuAAae3ofiB/3COiN95BsLxV4tK1Obxgatkfx8jZGzwNzmxEx8ZDvHVG9qrbt0NfIg/+sLtlCZ2go8GJTFTN+bKkvKSg4R3r31sz5NfkUClZMWqs7it5vtS7kM5Cldyo1mfLuahdXvTLyd7ZG5UVGTyN1T8103owu9QJgQPJD+fP7OwkdKXhMY45iMMzZREkvpUTdyUA2pmEQfzC7ahZIOI8s8iJrOSNjhDUWcW8QbkCkydtNMW0lfuWw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, jgross@xxxxxxxx, julien@xxxxxxx, wl@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 Oct 2023 07:07:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.10.2023 01:06, Stefano Stabellini wrote:
> From: George Dunlap <george.dunlap@xxxxxxxxx>
> 
> Commit fc2b57c9a ("xenstored: send an evtchn notification on
> introduce_domain") introduced the sending of an event channel to the
> guest when first introduced, so that dom0less domains waiting for the
> connection would know that xenstore was ready to use.
> 
> Unfortunately, it was introduced in introduce_domain(), which 1) is
> called by other functions, where such functionality is unneeded, and
> 2) after the main XS_INTRODUCE call, calls domain_conn_reset().  This
> introduces a race condition, whereby if xenstored is delayed, a domain
> can wake up, send messages to the buffer, only to have them deleted by
> xenstore before finishing its processing of the XS_INTRODUCE message.
> 
> Move the connect-and-notfy call into do_introduce() instead, after the
> domain_conn_rest(); predicated on the state being in the
> XENSTORE_RECONNECT state.
> 
> (We don't need to check for "restoring", since that value is always
> passed as "false" from do_domain_introduce()).
> 
> Also take the opportunity to add a missing wmb barrier after resetting
> the indexes of the ring in domain_conn_reset.
> 
> This change will also remove an extra event channel notification for
> dom0 (because the notification is now done by do_introduce which is not
> called for dom0.) The extra dom0 event channel notification was only
> introduced by fc2b57c9a and was never present before. It is not needed
> because dom0 is the one to tell xenstored the connection parameters, so
> dom0 has to know that the ring page is setup correctly by the time
> xenstored starts looking at it. It is dom0 that performs the ring page
> init.
> 
> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxx>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>

Should this have had a Fixes: tag thus marking it to pick up for
backport?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.