[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] x86/mem_sharing: make fork_reset more configurable
- To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 24 Mar 2022 17:03:39 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=w00+vhwkz7fVWxJnF+7uzRkfpfCsrkT3eJtQM+05+5A=; b=cGeGA7phN7olsL79Z4q111LNxQ5D9hd0hL/XbKjdkid8kbpHOB2hVy46v5l7nQynzah6Tfpd6o+zkQLxheFie1wEOrz5TubqbpWgILXZhRsd15EPmOA7sxpy8v95lpKkZfOp27FfYVz7J6P4aqp/gTYEoNbt6VZPPMVrnHcYNk/oOAjkOo6JqyuVPwgXNd84DH03Hyzdu67Riea4ttpD2Qo+uS9Wh6BSDabynOByso6cBK6HDOIOrswRRdIuR6I40rYkqtNkRP+HaWKP5bNy8J/5To0xY0Kqt/+TP9cMrx49+dMAeenoL0Al4PBX9upSI6e5Jc+Bs7wRG7LTn2sTVw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNkJnap8zEGtcKIxOaYdaQKO5tziKh6eHwZlHBjcZWKK4BN70XveIbi+HHXkie5B2/D154h6Q6UBgkrOnosOSj7sScOYN40RVPTzjiqVFG/ce28S2yJJajzRIkyM0lWErBxjlqs31U55TNfICnnU5FzKagqzloKx7gjv9iHRKnc2ClpAM51JNpp9NRtA5H35cZ7a8ZqTe3WXesRfBcnQnjXMa9tDHnIzhyIttjez189dh1yj+wSiqyG6qFjDN7xjKlOs8GJCx+jVgKaaVGTwKukKMWUKNE3b8JkcU3OgqE7MIoVIo1g+mg3qqUWTojuRvY0V62JC9c+w+Eeesjskag==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <JGross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>
- Delivery-date: Thu, 24 Mar 2022 16:03:57 +0000
- Ironport-data: A9a23:1rpXqqkaikyBr6+ECEoSUq/o5gwpJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJKWWnQP/bfNmPzcot/YNmwpxgC78Dcx4dhS1RqrCswESMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EoLd9IR2NYy24DiWV/V4 7senuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYdzkTJLLtsvomXRBgKjtDGoJDqKHlLi3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNFbZ3bvwme/lDLk37iggBJCD0Ic3oHZvwCufFf87aZvCX7/L9ZlT2zJYasVmQ6mCN 5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1rwYPcegpUdAZ0+4QMHfkLqQcfnghOXNWLu v52iIRzADQBkj/I/7LTkUtbqzmnZnmhZjmaRkJC1oO7xSPtyqh7PrfHwKD1hkTfjtTyfN6mF K12TDR1+GGibWW2xXc32jc49B/n8bg8MJKAIiphtIOIjvhpw60bMBKWqGEvhoyvOazgWxa2+ XkklMFBYBe+nnRdma6rV/E3BTh6i8n7zvYxVqRkRLY0LvEbQN/L/AEqZNScxPf5UZllsp7yr h302WQsIcSJQ/cnQzmjuK4GC1Cpw6Rmz4PgOQTh3tQXc81c7lKt7ES+0tTDdMpAD/60oY6C+ NjZfusqMq+SWnqLkwxg1MfgOBFBh8Ib1S7qwk5y4GoOgFt7T5EJxBy/r1cop8CnKhNP6Wsqd 60d5iAr4s+PfP+XZgNdNvpfvHHeFAlYSi8Rl56cm6XXZ3uBRr22uvKCfMOlaWXRKA=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Mar 24, 2022 at 11:52:38AM -0400, Tamas K Lengyel wrote:
> On Thu, Mar 24, 2022 at 11:46 AM Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> >
> > On Tue, Mar 22, 2022 at 01:41:39PM -0400, Tamas K Lengyel wrote:
> > > diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
> > > index 208d8dcbd9..30ce23c5a7 100644
> > > --- a/xen/include/public/memory.h
> > > +++ b/xen/include/public/memory.h
> > > @@ -541,12 +541,14 @@ struct xen_mem_sharing_op {
> > > uint32_t gref; /* IN: gref to debug */
> > > } u;
> > > } debug;
> > > - struct mem_sharing_op_fork { /* OP_FORK */
> > > + struct mem_sharing_op_fork { /* OP_FORK/_RESET */
> > > domid_t parent_domain; /* IN: parent's domain id */
> > > /* These flags only makes sense for short-lived forks */
> > > #define XENMEM_FORK_WITH_IOMMU_ALLOWED (1u << 0)
> > > #define XENMEM_FORK_BLOCK_INTERRUPTS (1u << 1)
> > > #define XENMEM_FORK_SKIP_SPECIAL_PAGES (1u << 2)
> > > +#define XENMEM_FORK_RESET_STATE (1u << 3)
> > > +#define XENMEM_FORK_RESET_MEMORY (1u << 4)
> > > uint16_t flags; /* IN: optional settings */
> > > uint32_t pad; /* Must be set to 0 */
> > > } fork;
> > > diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
> > > index bb003d21d0..81c2ee28cc 100644
> > > --- a/xen/include/public/vm_event.h
> > > +++ b/xen/include/public/vm_event.h
> > > @@ -127,6 +127,14 @@
> > > * Reset the vmtrace buffer (if vmtrace is enabled)
> > > */
> > > #define VM_EVENT_FLAG_RESET_VMTRACE (1 << 13)
> > > +/*
> > > + * Reset the VM state (if VM is fork)
> > > + */
> > > +#define VM_EVENT_FLAG_RESET_FORK_STATE (1 << 14)
> > > +/*
> > > + * Remove unshared entried from physmap (if VM is fork)
> > > + */
> > > +#define VM_EVENT_FLAG_RESET_FORK_MEMORY (1 << 15)
> >
> > I'm confused about why two different interfaces are added to do this
> > kind of selective resets, one to vm_event and one to xenmem_fork?
> >
> > I thin k the natural place for the option to live would be
> > XENMEM_FORK?
>
> Yes, that's the natural place for it. But we are adding it to both for
> a reason. In our use-case the reset operation will happen after a
> vm_event is received to which we already must send a reply. Setting
> the flag on the vm_event reply saves us having to issue an extra memop
> hypercall afterwards.
Can you do a multicall and batch both operations in a single
hypercall?
That would seem more natural than adding duplicated interfaces.
Thanks, Roger.
|