View | Details | Raw Unified | Return to bug 559047
Collapse All | Expand All

(-)11.2-2009-11-12.orig/drivers/xen/balloon/balloon.c (+8 lines)
Lines 623-628 static int dealloc_pte_fn( Link Here
623
}
623
}
624
#endif
624
#endif
625
625
626
#include <linux/kallsyms.h>//temp
626
struct page **alloc_empty_pages_and_pagevec(int nr_pages)
627
struct page **alloc_empty_pages_and_pagevec(int nr_pages)
627
{
628
{
628
	unsigned long flags;
629
	unsigned long flags;
Lines 630-635 struct page **alloc_empty_pages_and_page Link Here
630
	struct page *page, **pagevec;
631
	struct page *page, **pagevec;
631
	int i, ret;
632
	int i, ret;
632
633
634
print_symbol("aep&p: %s\n", _RET_IP_);//temp
633
	pagevec = kmalloc(sizeof(page) * nr_pages, GFP_KERNEL);
635
	pagevec = kmalloc(sizeof(page) * nr_pages, GFP_KERNEL);
634
	if (pagevec == NULL)
636
	if (pagevec == NULL)
635
		return NULL;
637
		return NULL;
Lines 642-647 struct page **alloc_empty_pages_and_page Link Here
642
		v = page_address(page);
644
		v = page_address(page);
643
		scrub_pages(v, 1);
645
		scrub_pages(v, 1);
644
646
647
printk("aep&p: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
645
		balloon_lock(flags);
648
		balloon_lock(flags);
646
649
647
		if (xen_feature(XENFEAT_auto_translated_physmap)) {
650
		if (xen_feature(XENFEAT_auto_translated_physmap)) {
Lines 707-712 static void _free_empty_pages_and_pageve Link Here
707
	if (pagevec == NULL)
710
	if (pagevec == NULL)
708
		return;
711
		return;
709
712
713
print_symbol("fep&p: %s\n", _RET_IP_);//temp
714
for(i = 0; i < nr_pages; ++i)//temp
715
 printk("fep&p: %lx(%lx)\n", page_to_pfn(pagevec[i]), pagevec[i]->flags);//temp
710
	balloon_lock(flags);
716
	balloon_lock(flags);
711
	for (i = 0; i < nr_pages; i++) {
717
	for (i = 0; i < nr_pages; i++) {
712
		BUG_ON(page_count(pagevec[i]) != 1);
718
		BUG_ON(page_count(pagevec[i]) != 1);
Lines 736-741 void balloon_release_driver_page(struct Link Here
736
{
742
{
737
	unsigned long flags;
743
	unsigned long flags;
738
744
745
print_symbol("brdp: %s\n", _RET_IP_);//temp
746
printk("brdp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
739
	balloon_lock(flags);
747
	balloon_lock(flags);
740
	balloon_append(page, 1);
748
	balloon_append(page, 1);
741
	bs.driver_pages--;
749
	bs.driver_pages--;
(-)11.2-2009-11-12.orig/drivers/xen/core/gnttab.c (+4 lines)
Lines 511-516 static int gnttab_map(unsigned int start Link Here
511
static void gnttab_page_free(struct page *page, unsigned int order)
511
static void gnttab_page_free(struct page *page, unsigned int order)
512
{
512
{
513
	BUG_ON(order);
513
	BUG_ON(order);
514
printk("gpf: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
514
	ClearPageForeign(page);
515
	ClearPageForeign(page);
515
	gnttab_reset_grant_page(page);
516
	gnttab_reset_grant_page(page);
516
	put_page(page);
517
	put_page(page);
Lines 577-582 int gnttab_copy_grant_page(grant_ref_t r Link Here
577
	BUG_ON(unmap.status);
578
	BUG_ON(unmap.status);
578
579
579
	write_sequnlock(&gnttab_dma_lock);
580
	write_sequnlock(&gnttab_dma_lock);
581
printk("gcgp: %lx/%lx(%lx) -> %lx/%lx\n",
582
       (unsigned long)pfn, (unsigned long)mfn, page->flags,
583
       page_to_pfn(new_page), (unsigned long)new_mfn);//temp
580
584
581
	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
585
	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
582
		set_phys_to_machine(page_to_pfn(new_page), INVALID_P2M_ENTRY);
586
		set_phys_to_machine(page_to_pfn(new_page), INVALID_P2M_ENTRY);
(-)11.2-2009-11-12.orig/lib/swiotlb-xen.c (+44 lines)
Lines 431-436 found: Link Here
431
	 * This is needed when we sync the memory.  Then we sync the buffer if
431
	 * This is needed when we sync the memory.  Then we sync the buffer if
432
	 * needed.
432
	 * needed.
433
	 */
433
	 */
434
WARN_ON(!phys);//temp
434
	for (i = 0; i < nslots; i++)
435
	for (i = 0; i < nslots; i++)
435
		io_tlb_orig_addr[index+i] = phys + (i << IO_TLB_SHIFT);
436
		io_tlb_orig_addr[index+i] = phys + (i << IO_TLB_SHIFT);
436
	if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
437
	if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
Lines 450-455 do_unmap_single(struct device *hwdev, ch Link Here
450
	int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
451
	int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
451
	phys_addr_t phys = io_tlb_orig_addr[index];
452
	phys_addr_t phys = io_tlb_orig_addr[index];
452
453
454
for(i = 1, count = 0; i < nslots; ++i) {//temp
455
 if((phys + (i << IO_TLB_SHIFT)) != io_tlb_orig_addr[index + i]) {
456
  printk("dus[%d]: %Lx %Lx\n", index, (unsigned long long)io_tlb_orig_addr[index + i], (unsigned long long)phys + (i << IO_TLB_SHIFT));
457
  ++count;
458
 }
459
 WARN_ON(count);
460
}
453
	/*
461
	/*
454
	 * First, sync the memory before unmapping the entry
462
	 * First, sync the memory before unmapping the entry
455
	 */
463
	 */
Lines 543-549 dma_addr_t swiotlb_map_page(struct devic Link Here
543
	 */
551
	 */
544
	if (!address_needs_mapping(dev, dev_addr, size) &&
552
	if (!address_needs_mapping(dev, dev_addr, size) &&
545
	    !range_needs_mapping(phys, size))
553
	    !range_needs_mapping(phys, size))
554
{//temp
555
 int f = 0;
556
 for(size += offset; size > PAGE_SIZE; size -= PAGE_SIZE) {
557
  ++page;
558
  if(PageForeign(page)) {
559
   printk("smp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
560
   ++f;
561
  }
562
 }
563
 WARN_ON(f);
546
		return dev_addr;
564
		return dev_addr;
565
}
547
566
548
	/*
567
	/*
549
	 * Oh well, have to allocate and map a bounce buffer.
568
	 * Oh well, have to allocate and map a bounce buffer.
Lines 676-681 swiotlb_map_sg_attrs(struct device *hwde Link Here
676
		phys_addr_t paddr = page_to_pseudophys(sg_page(sg))
695
		phys_addr_t paddr = page_to_pseudophys(sg_page(sg))
677
				   + sg->offset;
696
				   + sg->offset;
678
697
698
if(dir != DMA_TO_DEVICE && sg->offset + sg->length > PAGE_SIZE) {//temp
699
 u8*p = page_address(sg_page(sg));
700
 long offs = sg->offset + sg->length - 1;
701
 WARN((sg->offset | sg->length) & 0x1ff,
702
      "sg%d@%p[%d/%d] v=%p+%x:%x\n", dir, sgl, i, nelems, p, sg->offset, sg->length);
703
#ifndef CONFIG_HIGHMEM
704
 do {
705
  __asm__ __volatile__("lock orb $0, %0" : : "m" (p[offs]));
706
  offs -= PAGE_SIZE;
707
 } while(offs >= (long)sg->offset);
708
#endif
709
}
679
		if (range_needs_mapping(paddr, sg->length)
710
		if (range_needs_mapping(paddr, sg->length)
680
		    || address_needs_mapping(hwdev, dev_addr, sg->length)) {
711
		    || address_needs_mapping(hwdev, dev_addr, sg->length)) {
681
			void *map;
712
			void *map;
Lines 694-700 swiotlb_map_sg_attrs(struct device *hwde Link Here
694
			}
725
			}
695
			sg->dma_address = swiotlb_virt_to_bus(hwdev, map);
726
			sg->dma_address = swiotlb_virt_to_bus(hwdev, map);
696
		} else
727
		} else
728
{//temp
729
 int f = 0;
730
 size_t size = sg->offset + sg->length;
731
 struct page *page = sg_page(sg);
732
 for(; size > PAGE_SIZE; size -= PAGE_SIZE) {
733
  ++page;
734
  if(PageForeign(page)) {
735
   printk("smsa: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
736
   ++f;
737
  }
738
 }
739
 WARN_ON(f);
697
			sg->dma_address = dev_addr;
740
			sg->dma_address = dev_addr;
741
}
698
		sg->dma_length = sg->length;
742
		sg->dma_length = sg->length;
699
	}
743
	}
700
	return nelems;
744
	return nelems;
(-)11.2-2009-11-12.orig/mm/page_alloc.c (+31 lines)
Lines 256-261 static void bad_page(struct page *page) Link Here
256
256
257
	printk(KERN_ALERT "BUG: Bad page state in process %s  pfn:%05lx\n",
257
	printk(KERN_ALERT "BUG: Bad page state in process %s  pfn:%05lx\n",
258
		current->comm, page_to_pfn(page));
258
		current->comm, page_to_pfn(page));
259
#ifdef CONFIG_XEN//temp
260
{
261
 unsigned long mfn = pfn_to_mfn(page_to_pfn(page));
262
 printk(KERN_ALERT "mfn:%lx pfn:%lx/%lx\n", mfn, mfn_to_pfn(mfn), mfn_to_local_pfn(mfn));
263
}
264
#endif
259
	printk(KERN_ALERT
265
	printk(KERN_ALERT
260
		"page:%p flags:%p count:%d mapcount:%d mapping:%p index:%lx\n",
266
		"page:%p flags:%p count:%d mapcount:%d mapping:%p index:%lx\n",
261
		page, (void *)page->flags, page_count(page),
267
		page, (void *)page->flags, page_count(page),
Lines 311-316 static int destroy_compound_page(struct Link Here
311
	int bad = 0;
317
	int bad = 0;
312
318
313
	if (unlikely(compound_order(page) != order) ||
319
	if (unlikely(compound_order(page) != order) ||
320
#ifdef CONFIG_XEN//temp
321
({//temp
322
 int f = 0, x = 0;
323
 unsigned long pfn = page_to_pfn(page);
324
 for(i = 0; i < nr_pages; ++i, ++pfn) {
325
  f += WARN(PageForeign(page + i), "dcp: %lx(%lx)\n", pfn, page[i].flags);
326
  x += (pfn != mfn_to_pfn(pfn_to_mfn(pfn)) || pfn != mfn_to_local_pfn(pfn_to_mfn(pfn)));
327
 }
328
 f | x;
329
}) ||
330
#endif
314
	    unlikely(!PageHead(page))) {
331
	    unlikely(!PageHead(page))) {
315
		bad_page(page);
332
		bad_page(page);
316
		bad++;
333
		bad++;
Lines 500-505 static inline int free_pages_check(struc Link Here
500
	if (unlikely(page_mapcount(page) |
517
	if (unlikely(page_mapcount(page) |
501
		(page->mapping != NULL)  |
518
		(page->mapping != NULL)  |
502
		(atomic_read(&page->_count) != 0) |
519
		(atomic_read(&page->_count) != 0) |
520
#ifdef CONFIG_XEN//temp
521
({
522
  unsigned long pfn = page_to_pfn(page);
523
  unsigned long mfn = pfn_to_mfn(pfn);
524
  (pfn ^ mfn_to_pfn(mfn)) | (pfn ^ mfn_to_local_pfn(mfn));
525
}) |
526
#endif
503
		(page->flags & PAGE_FLAGS_CHECK_AT_FREE))) {
527
		(page->flags & PAGE_FLAGS_CHECK_AT_FREE))) {
504
		bad_page(page);
528
		bad_page(page);
505
		return 1;
529
		return 1;
Lines 659-664 static int prep_new_page(struct page *pa Link Here
659
	if (unlikely(page_mapcount(page) |
683
	if (unlikely(page_mapcount(page) |
660
		(page->mapping != NULL)  |
684
		(page->mapping != NULL)  |
661
		(atomic_read(&page->_count) != 0)  |
685
		(atomic_read(&page->_count) != 0)  |
686
#ifdef CONFIG_XEN//temp
687
({
688
  unsigned long pfn = page_to_pfn(page);
689
  unsigned long mfn = pfn_to_mfn(pfn);
690
  (pfn ^ mfn_to_pfn(mfn)) | (pfn ^ mfn_to_local_pfn(mfn));
691
}) |
692
#endif
662
		(page->flags & PAGE_FLAGS_CHECK_AT_PREP))) {
693
		(page->flags & PAGE_FLAGS_CHECK_AT_PREP))) {
663
		bad_page(page);
694
		bad_page(page);
664
		return 1;
695
		return 1;

Return to bug 559047