Stefan Berger
2006-Apr-20 18:34 UTC
[Xen-devel] [PATCH] let set_phys_to_machine return the old entry
The attached patch makes set_phys_to_machine(pfn,mfn) return the old entry in the array, such that the old entry can be restored again using the same call. If the feature XENFEAT_auto_translate_physmap is not enabled, then these two calls will end up in no-op relative to changes to the phys_to_machine_mapping array. There''s currently only one occurrence where remembering the entry from the array is necessary and this is in the vTPM backend driver. This patch builds on top of the previously posted TPM backend patch. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-20 19:08 UTC
[Xen-devel] Re: [PATCH] let set_phys_to_machine return the old entry
On 20 Apr 2006, at 19:34, Stefan Berger wrote:> The attached patch makes set_phys_to_machine(pfn,mfn) return the old > entry in the array, such that the old entry can be restored again using > the same call. If the feature XENFEAT_auto_translate_physmap is not > enabled, then these two calls will end up in no-op relative to changes > to the phys_to_machine_mapping array. > > There''s currently only one occurrence where remembering the entry from > the array is necessary and this is in the vTPM backend driver. > > This patch builds on top of the previously posted TPM backend patch.Why do you need to mess with the phys_to_machine table at all? You install the mapping only for a very short time, to do a memcpy or copy_from_user: neither of which will use that p2m entry. Even if you really do want to set the p2m entry properly you know that its old value must be INVALID_P2M_ENTRY because you obtained that kernel virtual address via balloon_alloc_empty_page_range(). You should probably just delete the p2m code from that copy routine. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2006-Apr-21 03:09 UTC
Re: [Xen-devel] Re: [PATCH] let set_phys_to_machine return the old entry
xen-devel-bounces@lists.xensource.com wrote on 04/20/2006 03:08:08 PM:> > On 20 Apr 2006, at 19:34, Stefan Berger wrote: > > > The attached patch makes set_phys_to_machine(pfn,mfn) return the old > > entry in the array, such that the old entry can be restored againusing> > the same call. If the feature XENFEAT_auto_translate_physmap is not > > enabled, then these two calls will end up in no-op relative to changes > > to the phys_to_machine_mapping array. > > > > There''s currently only one occurrence where remembering the entry from > > the array is necessary and this is in the vTPM backend driver. > > > > This patch builds on top of the previously posted TPM backend patch. > > Why do you need to mess with the phys_to_machine table at all? You > install the mapping only for a very short time, to do a memcpy or > copy_from_user: neither of which will use that p2m entry. Even if you > really do want to set the p2m entry properly you know that its old > value must be INVALID_P2M_ENTRY because you obtained that kernel > virtual address via balloon_alloc_empty_page_range(). > > You should probably just delete the p2m code from that copy routine.Going to do that and will repost. Stefan> > -- Keir > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel