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 (+37 lines)
Lines 450-455 do_unmap_single(struct device *hwdev, ch Link Here
450
	int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
450
	int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
451
	phys_addr_t phys = io_tlb_orig_addr[index];
451
	phys_addr_t phys = io_tlb_orig_addr[index];
452
452
453
for(i = 1; i < nslots; ++i) {//temp
454
 BUG_ON((phys ^ io_tlb_orig_addr[index + i]) & ((1 << IO_TLB_SHIFT) - 1));
455
}
453
	/*
456
	/*
454
	 * First, sync the memory before unmapping the entry
457
	 * First, sync the memory before unmapping the entry
455
	 */
458
	 */
Lines 543-549 dma_addr_t swiotlb_map_page(struct devic Link Here
543
	 */
546
	 */
544
	if (!address_needs_mapping(dev, dev_addr, size) &&
547
	if (!address_needs_mapping(dev, dev_addr, size) &&
545
	    !range_needs_mapping(phys, size))
548
	    !range_needs_mapping(phys, size))
549
{//temp
550
 int f = 0;
551
 for(size += offset; size > PAGE_SIZE; size -= PAGE_SIZE) {
552
  ++page;
553
  if(PageForeign(page)) {
554
   printk("smp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
555
   ++f;
556
  }
557
 }
558
 WARN_ON(f);
546
		return dev_addr;
559
		return dev_addr;
560
}
547
561
548
	/*
562
	/*
549
	 * Oh well, have to allocate and map a bounce buffer.
563
	 * 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))
690
		phys_addr_t paddr = page_to_pseudophys(sg_page(sg))
677
				   + sg->offset;
691
				   + sg->offset;
678
692
693
if(dir != DMA_TO_DEVICE && sg->offset + sg->length > PAGE_SIZE) {//temp
694
 u8*p = page_address(sg_page(sg));
695
 long offs = sg->offset + sg->length - 1;
696
 WARN((sg->offset | sg->length) & 0x1ff,
697
      "sg%d@%p[%d/%d] v=%p+%x:%x\n", dir, sgl, i, nelems, p, sg->offset, sg->length);
698
 do {
699
  __asm__ __volatile__("lock orb $0, %0" : : "m" (p[offs]));
700
  offs -= PAGE_SIZE;
701
 } while(offs >= (long)sg->offset);
702
}
679
		if (range_needs_mapping(paddr, sg->length)
703
		if (range_needs_mapping(paddr, sg->length)
680
		    || address_needs_mapping(hwdev, dev_addr, sg->length)) {
704
		    || address_needs_mapping(hwdev, dev_addr, sg->length)) {
681
			void *map;
705
			void *map;
Lines 694-700 swiotlb_map_sg_attrs(struct device *hwde Link Here
694
			}
718
			}
695
			sg->dma_address = swiotlb_virt_to_bus(hwdev, map);
719
			sg->dma_address = swiotlb_virt_to_bus(hwdev, map);
696
		} else
720
		} else
721
{//temp
722
 int f = 0;
723
 size_t size = sg->offset + sg->length;
724
 struct page *page = sg_page(sg);
725
 for(; size > PAGE_SIZE; size -= PAGE_SIZE) {
726
  ++page;
727
  if(PageForeign(page)) {
728
   printk("smp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp
729
   ++f;
730
  }
731
 }
732
 WARN_ON(f);
697
			sg->dma_address = dev_addr;
733
			sg->dma_address = dev_addr;
734
}
698
		sg->dma_length = sg->length;
735
		sg->dma_length = sg->length;
699
	}
736
	}
700
	return nelems;
737
	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