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)
commitf020e2905166e12f9a8f109fe968cb5a9db887e9
treede519deb292f099369dc81e65401227016139a94
parent8e3e99918b9ccd6bc2369ddbcd74056f8796e1e0
privcmd: MMAPBATCH: Fix error handling/reporting

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>
drivers/xen/xenfs/privcmd.c