diff options
author | Xiantao Zhang <xiantao.zhang@intel.com> | 2008-10-03 02:58:09 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-10-15 08:25:37 -0400 |
commit | 1cbea809c400661eecb538e0dd0bc4f3660f0a35 (patch) | |
tree | ad67d040d76dab80ca548665da48e99fe93f1bd4 /arch | |
parent | 2f7497719179a9f3270b05434be989d21f9fdc09 (diff) |
KVM: ia64: Make pmt table be able to hold physical mmio entries.
Don't try to do put_page once the entries are mmio.
Set the tag to indicate the mmio space for vmm setting
TLB's memory attribute.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index a6cf719811b7..800a4f2e917e 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1437,17 +1437,24 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
1437 | int user_alloc) | 1437 | int user_alloc) |
1438 | { | 1438 | { |
1439 | unsigned long i; | 1439 | unsigned long i; |
1440 | struct page *page; | 1440 | unsigned long pfn; |
1441 | int npages = mem->memory_size >> PAGE_SHIFT; | 1441 | int npages = mem->memory_size >> PAGE_SHIFT; |
1442 | struct kvm_memory_slot *memslot = &kvm->memslots[mem->slot]; | 1442 | struct kvm_memory_slot *memslot = &kvm->memslots[mem->slot]; |
1443 | unsigned long base_gfn = memslot->base_gfn; | 1443 | unsigned long base_gfn = memslot->base_gfn; |
1444 | 1444 | ||
1445 | for (i = 0; i < npages; i++) { | 1445 | for (i = 0; i < npages; i++) { |
1446 | page = gfn_to_page(kvm, base_gfn + i); | 1446 | pfn = gfn_to_pfn(kvm, base_gfn + i); |
1447 | kvm_set_pmt_entry(kvm, base_gfn + i, | 1447 | if (!kvm_is_mmio_pfn(pfn)) { |
1448 | page_to_pfn(page) << PAGE_SHIFT, | 1448 | kvm_set_pmt_entry(kvm, base_gfn + i, |
1449 | _PAGE_AR_RWX|_PAGE_MA_WB); | 1449 | pfn << PAGE_SHIFT, |
1450 | memslot->rmap[i] = (unsigned long)page; | 1450 | _PAGE_MA_WB); |
1451 | memslot->rmap[i] = (unsigned long)pfn_to_page(pfn); | ||
1452 | } else { | ||
1453 | kvm_set_pmt_entry(kvm, base_gfn + i, | ||
1454 | GPFN_LOW_MMIO | (pfn << PAGE_SHIFT), | ||
1455 | _PAGE_MA_UC); | ||
1456 | memslot->rmap[i] = 0; | ||
1457 | } | ||
1451 | } | 1458 | } |
1452 | 1459 | ||
1453 | return 0; | 1460 | return 0; |