Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06814C83003 for ; Wed, 29 Apr 2020 09:22:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCCB020731 for ; Wed, 29 Apr 2020 09:22:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xen.org header.i=@xen.org header.b="S1/cXFGt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCCB020731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jTiuv-00007a-HO; Wed, 29 Apr 2020 09:22:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jTiuu-00007T-FG for xen-devel@lists.xenproject.org; Wed, 29 Apr 2020 09:22:08 +0000 X-Inumbo-ID: e59af8ac-89fa-11ea-9887-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e59af8ac-89fa-11ea-9887-bc764e2007e4; Wed, 29 Apr 2020 09:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IBvFVP9Y/af3Zy8vF1YUEhbF2HZkcqpnP3dwYHZKchE=; b=S1/cXFGtpTSdXGygCTxAMyksE8 i47m/LH3YPCH58pEGobUArtB2pGPfMv1+dxz6vlkG+QZJkTlTs6xdy1b819yXi3qBFYAnPKAxulBK nd2YS+2SqewTShQgmuYkUPfzrQphOw2eh/AkqZ/3YvoTgulZxAw7SN6t1VZuX9yUz7RU=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jTiuq-0005a6-Km; Wed, 29 Apr 2020 09:22:04 +0000 Received: from [54.239.6.187] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jTiuq-0008AH-Dl; Wed, 29 Apr 2020 09:22:04 +0000 Subject: Re: [PATCH] tools/xenstore: don't store domU's mfn of ring page in xensotred To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= , Julien Grall References: <20200428155144.8253-1-jgross@suse.com> From: Julien Grall Message-ID: <76ed29d6-e2fc-cd48-6de7-e0032daaa2e9@xen.org> Date: Wed, 29 Apr 2020 10:22:02 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel , "andrew.cooper3@citrix.com" , Ian Jackson , Wei Liu , Igor Druzhinin Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi Juergen, On 29/04/2020 06:51, Jürgen Groß wrote: > On 28.04.20 22:55, Julien Grall wrote: >> Hi Juergen, >> >> On Tue, 28 Apr 2020 at 16:53, Juergen Gross wrote: >>> >>> The XS_INTRODUCE command has two parameters: the mfn (or better: gfn) >>> of the domain's xenstore ring page and the event channel of the >>> domain for communicating with Xenstore. >>> >>> The gfn is not really needed. It is stored in the per-domain struct >>> in xenstored and in case of another XS_INTRODUCE for the domain it >>> is tested to match the original value. If it doesn't match the >>> command is aborted via EINVAL. >>> >>> Today there shouldn't be multiple XS_INTRODUCE requests for the same >>> domain issued, so the mfn/gfn can just be ignored and multiple >>> XS_INTRODUCE commands can be rejected without testing the mfn/gfn. >> >> So there is a comment in the else part: >> >> /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ >> >>  From the commit message this is not entirely clear why we want to >> prevent recreating the event-channel. Can you expand it? > > Recreating the event channel would be fine, but I don't see why it > would ever be needed. And XS_INTRODUCE is called only at domain creation > time today, so there is obviously no need for repeating this call. > > Maybe the idea was to do this after sending a XS_RESUME command, which > isn't used anywhere in Xen and is another part of Xenstore which doesn't > make any sense today. Commit f6cc37ea8ac71385b60507c034519f304da75f4c "tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored" added the exact same behavior in the OCaml XenStored last year. This was introduced 12 years after C XenStored, so surely someone think this is useful. We should check why this was introduced in OCaml XenStored (I have CCed the author of the patch). If we still think this is not useful, then you should add an explanation in the commit message why the two implementations diverge and possibly update the spec. Cheers, -- Julien Grall