From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 2267FC433DF for ; Thu, 30 Jul 2020 12:54:57 +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 E15362082E for ; Thu, 30 Jul 2020 12:54:56 +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="sHopNlrL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E15362082E 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 1k184g-0005x5-1L; Thu, 30 Jul 2020 12:54:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k184f-0005x0-0w for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 12:54:17 +0000 X-Inumbo-ID: c5eb2534-d263-11ea-aac1-12813bfff9fa Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c5eb2534-d263-11ea-aac1-12813bfff9fa; Thu, 30 Jul 2020 12:54:15 +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=nfEsaqFJybXnm2uijpMuL0CFKltBDOFIQNfLG42L75M=; b=sHopNlrLCXtxKL7FqPXeXDkFtN 5cuzhU8AbAOjvdX+f1vndFMN7JRDfb0gGl1cc+atAPCIobCnvoR9gp66nZMGDO0o9UxrYfntBzYUf RkiVF7oxCaT3ECi8KcGK0/fpnvdz/ncdNeVQr6/uoqLcN/oXJmPQSF2xBkPjXNx5cD5w=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k184X-0000L2-Pc; Thu, 30 Jul 2020 12:54:09 +0000 Received: from 54-240-197-226.amazon.com ([54.240.197.226] helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k184X-0007JG-EM; Thu, 30 Jul 2020 12:54:09 +0000 Subject: Re: [PATCH 4/5] xen/memory: Fix acquire_resource size semantics To: paul@xen.org, 'Andrew Cooper' , 'Xen-devel' References: <20200728113712.22966-1-andrew.cooper3@citrix.com> <20200728113712.22966-5-andrew.cooper3@citrix.com> <002b01d6664b$c7eb5f40$57c21dc0$@xen.org> From: Julien Grall Message-ID: Date: Thu, 30 Jul 2020 13:54:06 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <002b01d6664b$c7eb5f40$57c21dc0$@xen.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit 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: 'Stefano Stabellini' , 'Hubert Jasudowicz' , 'Wei Liu' , 'Konrad Rzeszutek Wilk' , 'George Dunlap' , =?UTF-8?B?J01pY2hhxYIgTGVzemN6ecWEc2tpJw==?= , 'Jan Beulich' , 'Ian Jackson' Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi Paul, On 30/07/2020 09:31, Paul Durrant wrote: >> diff --git a/xen/common/memory.c b/xen/common/memory.c >> index dc3a7248e3..21edabf9cc 100644 >> --- a/xen/common/memory.c >> +++ b/xen/common/memory.c >> @@ -1007,6 +1007,26 @@ static long xatp_permission_check(struct domain *d, unsigned int space) >> return xsm_add_to_physmap(XSM_TARGET, current->domain, d); >> } >> >> +/* >> + * Return 0 on any kind of error. Caller converts to -EINVAL. >> + * >> + * All nonzero values should be repeatable (i.e. derived from some fixed >> + * proerty of the domain), and describe the full resource (i.e. mapping the > > s/property/property > >> + * result of this call will be the entire resource). > > This precludes dynamically adding a resource to a running domain. Do we really want to bake in that restriction? AFAICT, this restriction is not documented in the ABI. In particular, it is written: " The size of a resource will never be zero, but a nonzero result doesn't guarentee that a subsequent mapping request will be successful. There are further type/id specific constraints which may change between the two calls. " So I think a domain couldn't rely on this behavior. Although, it might be good to clarify in the comment on top of resource_max_frames that this an implementation decision and not part of the ABI. Cheers, -- Julien Grall