privcmd: MMAPBATCH: Fix error handling/reporting
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 May 2009 14:42:14 +0000 (15:42 +0100)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 20 Oct 2010 23:22:33 +0000 (16:22 -0700)
On error IOCTL_PRIVCMD_MMAPBATCH is expected to set the top nibble of
the effected MFN and return 0. Currently it leaves the MFN unmodified
and returns the number of failures. Therefore:

- reimplement remap_domain_mfn_range() using direct
  HYPERVISOR_mmu_update() calls and small batches. The xen_set_domain_pte()
  interface does not report errors and since some failures are
  expected/normal using the multicall infrastructure is too noisy.
- return 0 as expected
- writeback the updated MFN list to mmapbatch->arr not over mmapbatch,
  smashing the caller's stack.
- remap_domain_mfn_range can be static.

With this change I am able to start an HVM domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

No differences found