Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
fix spinlock recursion in hvc_console
stop_machine: remove unused variable
modules: extend initcall_debug functionality to the module loader
export virtio_rng.h
lguest: use get_user_pages_fast() instead of get_user_pages()
mm: Make generic weak get_user_pages_fast and EXPORT_GPL it
lguest: don't set MAC address for guest unless specified

+35 -74
+1 -22
Documentation/lguest/lguest.c
··· 1447 1447 err(1, "Bringing interface %s up", tapif); 1448 1448 } 1449 1449 1450 - static void get_mac(int fd, const char *tapif, unsigned char hwaddr[6]) 1451 - { 1452 - struct ifreq ifr; 1453 - 1454 - memset(&ifr, 0, sizeof(ifr)); 1455 - strcpy(ifr.ifr_name, tapif); 1456 - 1457 - /* SIOC stands for Socket I/O Control. G means Get (vs S for Set 1458 - * above). IF means Interface, and HWADDR is hardware address. 1459 - * Simple! */ 1460 - if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0) 1461 - err(1, "getting hw address for %s", tapif); 1462 - memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6); 1463 - } 1464 - 1465 1450 static int get_tun_device(char tapif[IFNAMSIZ]) 1466 1451 { 1467 1452 struct ifreq ifr; ··· 1516 1531 p = strchr(arg, ':'); 1517 1532 if (p) { 1518 1533 str2mac(p+1, conf.mac); 1534 + add_feature(dev, VIRTIO_NET_F_MAC); 1519 1535 *p = '\0'; 1520 - } else { 1521 - p = arg + strlen(arg); 1522 - /* None supplied; query the randomly assigned mac. */ 1523 - get_mac(ipfd, tapif, conf.mac); 1524 1536 } 1525 1537 1526 1538 /* arg is now either an IP address or a bridge name */ ··· 1529 1547 /* Set up the tun device. */ 1530 1548 configure_device(ipfd, tapif, ip); 1531 1549 1532 - /* Tell Guest what MAC address to use. */ 1533 - add_feature(dev, VIRTIO_NET_F_MAC); 1534 1550 add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); 1535 1551 /* Expect Guest to handle everything except UFO */ 1536 1552 add_feature(dev, VIRTIO_NET_F_CSUM); 1537 1553 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); 1538 - add_feature(dev, VIRTIO_NET_F_MAC); 1539 1554 add_feature(dev, VIRTIO_NET_F_GUEST_TSO4); 1540 1555 add_feature(dev, VIRTIO_NET_F_GUEST_TSO6); 1541 1556 add_feature(dev, VIRTIO_NET_F_GUEST_ECN);
-3
arch/powerpc/Kconfig
··· 42 42 bool 43 43 default y 44 44 45 - config HAVE_GET_USER_PAGES_FAST 46 - def_bool PPC64 47 - 48 45 config HAVE_SETUP_PER_CPU_AREA 49 46 def_bool PPC64 50 47
-1
arch/x86/Kconfig
··· 22 22 select HAVE_IDE 23 23 select HAVE_OPROFILE 24 24 select HAVE_IOREMAP_PROT 25 - select HAVE_GET_USER_PAGES_FAST 26 25 select HAVE_KPROBES 27 26 select ARCH_WANT_OPTIONAL_GPIOLIB 28 27 select HAVE_KRETPROBES
+1 -2
arch/x86/mm/Makefile
··· 1 1 obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ 2 - pat.o pgtable.o 2 + pat.o pgtable.o gup.o 3 3 4 - obj-$(CONFIG_HAVE_GET_USER_PAGES_FAST) += gup.o 5 4 obj-$(CONFIG_X86_32) += pgtable_32.o 6 5 7 6 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
+2 -3
drivers/char/hvc_console.c
··· 322 322 323 323 hp->tty = tty; 324 324 325 - if (hp->ops->notifier_add) 326 - rc = hp->ops->notifier_add(hp, hp->data); 327 - 328 325 spin_unlock_irqrestore(&hp->lock, flags); 329 326 327 + if (hp->ops->notifier_add) 328 + rc = hp->ops->notifier_add(hp, hp->data); 330 329 331 330 /* 332 331 * If the notifier fails we return an error. The tty layer
+9 -16
drivers/lguest/page_tables.c
··· 108 108 } 109 109 /*:*/ 110 110 111 - /*M:014 get_pfn is slow; it takes the mmap sem and calls get_user_pages. We 112 - * could probably try to grab batches of pages here as an optimization 113 - * (ie. pre-faulting). :*/ 111 + /*M:014 get_pfn is slow: we could probably try to grab batches of pages here as 112 + * an optimization (ie. pre-faulting). :*/ 114 113 115 114 /*H:350 This routine takes a page number given by the Guest and converts it to 116 115 * an actual, physical page number. It can fail for several reasons: the ··· 122 123 static unsigned long get_pfn(unsigned long virtpfn, int write) 123 124 { 124 125 struct page *page; 125 - /* This value indicates failure. */ 126 - unsigned long ret = -1UL; 127 126 128 - /* get_user_pages() is a complex interface: it gets the "struct 129 - * vm_area_struct" and "struct page" assocated with a range of pages. 130 - * It also needs the task's mmap_sem held, and is not very quick. 131 - * It returns the number of pages it got. */ 132 - down_read(&current->mm->mmap_sem); 133 - if (get_user_pages(current, current->mm, virtpfn << PAGE_SHIFT, 134 - 1, write, 1, &page, NULL) == 1) 135 - ret = page_to_pfn(page); 136 - up_read(&current->mm->mmap_sem); 137 - return ret; 127 + /* gup me one page at this address please! */ 128 + if (get_user_pages_fast(virtpfn << PAGE_SHIFT, 1, write, &page) == 1) 129 + return page_to_pfn(page); 130 + 131 + /* This value indicates failure. */ 132 + return -1UL; 138 133 } 139 134 140 135 /*H:340 Converting a Guest page table entry to a shadow (ie. real) page table ··· 167 174 /*H:460 And to complete the chain, release_pte() looks like this: */ 168 175 static void release_pte(pte_t pte) 169 176 { 170 - /* Remember that get_user_pages() took a reference to the page, in 177 + /* Remember that get_user_pages_fast() took a reference to the page, in 171 178 * get_pfn()? We have to put it back now. */ 172 179 if (pte_flags(pte) & _PAGE_PRESENT) 173 180 put_page(pfn_to_page(pte_pfn(pte)));
+1
include/linux/Kbuild
··· 356 356 unifdef-y += virtio_console.h 357 357 unifdef-y += virtio_pci.h 358 358 unifdef-y += virtio_ring.h 359 + unifdef-y += virtio_rng.h 359 360 unifdef-y += vt.h 360 361 unifdef-y += wait.h 361 362 unifdef-y += wanrouter.h
+1
include/linux/init.h
··· 139 139 extern initcall_t __security_initcall_start[], __security_initcall_end[]; 140 140 141 141 /* Defined in init/main.c */ 142 + extern int do_one_initcall(initcall_t fn); 142 143 extern char __initdata boot_command_line[]; 143 144 extern char *saved_command_line; 144 145 extern unsigned int reset_devices;
-20
include/linux/mm.h
··· 834 834 struct vm_area_struct **pprev, unsigned long start, 835 835 unsigned long end, unsigned long newflags); 836 836 837 - #ifdef CONFIG_HAVE_GET_USER_PAGES_FAST 838 837 /* 839 838 * get_user_pages_fast provides equivalent functionality to get_user_pages, 840 839 * operating on current and current->mm (force=0 and doesn't return any vmas). ··· 846 847 */ 847 848 int get_user_pages_fast(unsigned long start, int nr_pages, int write, 848 849 struct page **pages); 849 - 850 - #else 851 - /* 852 - * Should probably be moved to asm-generic, and architectures can include it if 853 - * they don't implement their own get_user_pages_fast. 854 - */ 855 - #define get_user_pages_fast(start, nr_pages, write, pages) \ 856 - ({ \ 857 - struct mm_struct *mm = current->mm; \ 858 - int ret; \ 859 - \ 860 - down_read(&mm->mmap_sem); \ 861 - ret = get_user_pages(current, mm, start, nr_pages, \ 862 - write, 0, pages, NULL); \ 863 - up_read(&mm->mmap_sem); \ 864 - \ 865 - ret; \ 866 - }) 867 - #endif 868 850 869 851 /* 870 852 * A callback you can register to apply pressure to ageable caches.
+4 -2
init/main.c
··· 691 691 rest_init(); 692 692 } 693 693 694 - static int __initdata initcall_debug; 694 + static int initcall_debug; 695 695 696 696 static int __init initcall_debug_setup(char *str) 697 697 { ··· 700 700 } 701 701 __setup("initcall_debug", initcall_debug_setup); 702 702 703 - static void __init do_one_initcall(initcall_t fn) 703 + int do_one_initcall(initcall_t fn) 704 704 { 705 705 int count = preempt_count(); 706 706 ktime_t t0, t1, delta; ··· 740 740 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn); 741 741 printk(" returned with %s\n", msgbuf); 742 742 } 743 + 744 + return result; 743 745 } 744 746 745 747
+1 -1
kernel/module.c
··· 2288 2288 2289 2289 /* Start the module */ 2290 2290 if (mod->init != NULL) 2291 - ret = mod->init(); 2291 + ret = do_one_initcall(mod->init); 2292 2292 if (ret < 0) { 2293 2293 /* Init routine failed: abort. Try to protect us from 2294 2294 buggy refcounters. */
-1
kernel/stop_machine.c
··· 65 65 static int stop_cpu(struct stop_machine_data *smdata) 66 66 { 67 67 enum stopmachine_state curstate = STOPMACHINE_NONE; 68 - int uninitialized_var(ret); 69 68 70 69 /* Simple state machine */ 71 70 do {
-3
mm/Kconfig
··· 77 77 def_bool y 78 78 depends on !SPARSEMEM 79 79 80 - config HAVE_GET_USER_PAGES_FAST 81 - bool 82 - 83 80 # 84 81 # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's 85 82 # to represent different areas of memory. This variable allows
+15
mm/util.c
··· 171 171 mm->unmap_area = arch_unmap_area; 172 172 } 173 173 #endif 174 + 175 + int __attribute__((weak)) get_user_pages_fast(unsigned long start, 176 + int nr_pages, int write, struct page **pages) 177 + { 178 + struct mm_struct *mm = current->mm; 179 + int ret; 180 + 181 + down_read(&mm->mmap_sem); 182 + ret = get_user_pages(current, mm, start, nr_pages, 183 + write, 0, pages, NULL); 184 + up_read(&mm->mmap_sem); 185 + 186 + return ret; 187 + } 188 + EXPORT_SYMBOL_GPL(get_user_pages_fast);