From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v2 1/2] altp2m: Merge p2m_set_altp2m_mem_access and p2m_set_mem_access Date: Mon, 01 Feb 2016 10:03:40 -0700 Message-ID: <56AF9DFC02000078000CD256@prv-mh.provo.novell.com> References: <1454014688-25060-1-git-send-email-tlengyel@novetta.com> <56AB552202000078000CC5E5@prv-mh.provo.novell.com> <56AB9F3102000078000CC78F@prv-mh.provo.novell.com> <56ABA5CA02000078000CC820@prv-mh.provo.novell.com> <1454337922.28781.102.camel@citrix.com> <22191.30790.516507.496745@mariner.uk.xensource.com> <56AF985A02000078000CD1FA@prv-mh.provo.novell.com> <22191.36554.310417.255788@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQHtE-0003xd-Mq for xen-devel@lists.xenproject.org; Mon, 01 Feb 2016 17:03:48 +0000 In-Reply-To: <22191.36554.310417.255788@mariner.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Wei Liu , Ian Campbell , Razvan Cojocaru , StefanoStabellini , George Dunlap , Andrew Cooper , Stefano Stabellini , Tamas Lengyel , xen-devel@lists.xenproject.org, KeirFraser List-Id: xen-devel@lists.xenproject.org >>> On 01.02.16 at 17:58, wrote: > Jan Beulich writes ("Re: [PATCH v2 1/2] altp2m: Merge > p2m_set_altp2m_mem_access and p2m_set_mem_access"): >> On 01.02.16 at 16:22, wrote: >> > It's not like we're short of memory op values. >> >> Are we not? They need to fit in 6 bits (unless we want to play tricks), >> and numbers up to 27 are already in use. > > Maybe I am confused. It's hard to make sense of the actual ABI which > doesn't seem to be documented yet. > > ... > > I have just read the docs some more and found this: > > /* > * To allow safe resume of do_memory_op() after preemption, we need > * to know at what point in the page list to resume. For this > * purpose I steal the high-order bits of the @cmd parameter, which > * are otherwise unused and zero. > * > * Note that both of these values are effectively part of the ABI, > * even if we don't need to make them a formal part of it: A guest > * suspended for migration in the middle of a continuation would > * fail to work if resumed on a hypervisor using different values. > */ > #define MEMOP_EXTENT_SHIFT 6 /* cmd[:6] == start_extent */ > #define MEMOP_CMD_MASK ((1 << MEMOP_EXTENT_SHIFT) - 1) > > Urrrrggh! No-one said this is nice. And we had an issue already when this once got widened from (iirc) 4 to 6 bits. > If we run out of memory_op numbers, can't we just invent a new > hypercall ? I suppose we would need to, yes. Jan