rpms/kernel-xen-2.6/devel linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch, NONE, 1.1 linux-2.6-net-8139-pio-modparam.patch, NONE, 1.1 linux-2.6-net-8139-pio-oqo2.patch, NONE, 1.1 linux-2.6-selinux-deffered-context-mapping-no-sleep.patch, NONE, 1.1 linux-2.6-selinux-deffered-context-mapping.patch, NONE, 1.1 linux-2.6-selinux-generic-ioctl.patch, NONE, 1.1 linux-2.6-selinux-get-invalid-xattrs.patch, NONE, 1.1 linux-2.6-selinux-new-proc-checks.patch, NONE, 1.1 linux-2.6-silence-fbcon-logo.patch, NONE, 1.1 linux-2.6-silence-x86-decompressor.patch, NONE, 1.1 linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch, NONE, 1.1 linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch, NONE, 1.1 linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch, NONE, 1.1 linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch, NONE, 1.1 linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch, NONE, 1.1 linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch, NONE, 1.1 linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch, NONE, 1.1 linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, NONE, 1.1 linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, NONE, 1.1 linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch, NONE, 1.1 linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch, NONE, 1.1 linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch, NONE, 1.1 linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch, NONE, 1.1 linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch, NONE, 1.1 linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch, NONE, 1.1 linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch, NONE, 1.1 linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch, NONE, 1.1 linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch, NONE, 1.1 linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch, NONE, 1.1 linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch, NONE, 1.1 linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch, NONE, 1.1 linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch, NONE, 1.1 linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch, NONE, 1.1 linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch, NONE, 1.1 linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch, NONE, 1.1 linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch, NONE, 1.1 linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch, NONE, 1.1 linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch, NONE, 1.1 linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch, NONE, 1.1 linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch, NONE, 1.1 linux-2.6-xen-0034-More-chainsaw-ifdefs.patch, NONE, 1.1 linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch, NONE, 1.1 linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch, NONE, 1.1 linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch, NONE, 1.1 linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch, NONE, 1.1 linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch, NONE, 1.1 linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch, NONE, 1.1 linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch, NONE, 1.1 linux-2.6-xen-0042-Disable-early_printk-by-default.patch, NONE, 1.1 linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch, NONE, 1.1 linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch, NONE, 1.1 linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch, NONE, 1.1 linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch, NONE, 1.1 linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch, NONE, 1.1 linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch, NONE, 1.1 linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch, NONE, 1.1 linux-2.6-xen-0050-Lots-of-unrelated-changes.patch, NONE, 1.1 linux-2.6-xen-0051-Hack-disable-vsmp.patch, NONE, 1.1 linux-2.6-xen-0052-Export-early_make_page_readonly.patch, NONE, 1.1 linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch, NONE, 1.1 linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch, NONE, 1.1 linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch, NONE, 1.1 linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch, NONE, 1.1 linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch, NONE, 1.1 linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch, NONE, 1.1 linux-2.6-xen-0059-Comment-debugging-msgs.patch, NONE, 1.1 linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch, NONE, 1.1 linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch, NONE, 1.1 linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch, NONE, 1.1 linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch, NONE, 1.1 linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch, NONE, 1.1 linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch, NONE, 1.1 linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch, NONE, 1.1 linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch, NONE, 1.1 linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch, NONE, 1.1 linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch, NONE, 1.1 linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch, NONE, 1.1 linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch, NONE, 1.1 linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch, NONE, 1.1 linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch, NONE, 1.1 linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch, NONE, 1.1 linux-2.6-xen-0077-Implement-asm-xen_iret.patch, NONE, 1.1 linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch, NONE, 1.1 linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch, NONE, 1.1 linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch, NONE, 1.1 linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch, NONE, 1.1 linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch, NONE, 1.1 linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch, NONE, 1.1 linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch, NONE, 1.1 linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch, NONE, 1.1 linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch, NONE, 1.1 linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch, NONE, 1.1 linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch, NONE, 1.1 linux-2.6-xen-0089-Debugging-printk-s.patch, NONE, 1.1 linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch, NONE, 1.1 linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch, NONE, 1.1 linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch, NONE, 1.1 linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch, NONE, 1.1 linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch, NONE, 1.1 linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch, NONE, 1.1 linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch, NONE, 1.1 linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch, NONE, 1.1 linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch, NONE, 1.1 linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch, NONE, 1.1 linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch, NONE, 1.1 linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch, NONE, 1.1 linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch, NONE, 1.1 linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch, NONE, 1.1 linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch, NONE, 1.1 linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch, NONE, 1.1 linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch, NONE, 1.1 linux-2.6-xen-0108-Make-xen_start_info-read-only.patch, NONE, 1.1 linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch, NONE, 1.1 linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch, NONE, 1.1 linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch, NONE, 1.1 linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch, NONE, 1.1 linux-2.6-xen-0114-Xen-missing-includes.patch, NONE, 1.1 linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch, NONE, 1.1 linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch, NONE, 1.1 linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch, NONE, 1.1 linux-2.6-xen-0118-Missing-Xen-include.patch, NONE, 1.1 linux-2.6-xen-0119-un-static-ipi_to_irq.patch, NONE, 1.1 linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch, NONE, 1.1 linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch, NONE, 1.1 linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch, NONE, 1.1 linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch, NONE, 1.1 linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch, NONE, 1.1 linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch, NONE, 1.1 linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch, NONE, 1.1 linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch, NONE, 1.1 linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch, NONE, 1.1 linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch, NONE, 1.1 linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch, NONE, 1.1 linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch, NONE, 1.1 linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch, NONE, 1.1 linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch, NONE, 1.1 linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch, NONE, 1.1 linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch, NONE, 1.1 linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch, NONE, 1.1 linux-2.6-xen-0137-DEBUG-slab-debugging.patch, NONE, 1.1 linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch, NONE, 1.1 linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch, NONE, 1.1 linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch, NONE, 1.1 linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch, NONE, 1.1 linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch, NONE, 1.1 linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch, NONE, 1.1 linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch, NONE, 1.1 linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch, NONE, 1.1 linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch, NONE, 1.1 linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch, NONE, 1.1 linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch, NONE, 1.1 linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch, NONE, 1.1 linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch, NONE, 1.1 linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch, NONE, 1.1 linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch, NONE, 1.1 linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch, NONE, 1.1 linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch, NONE, 1.1 linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch, NONE, 1.1 linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch, NONE, 1.1 linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch, NONE, 1.1 linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch, NONE, 1.1 linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch, NONE, 1.1 linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch, NONE, 1.1 linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch, NONE, 1.1 patch-2.6.26-rc6-git2.bz2.sign, NONE, 1.1 patch-2.6.26-rc6.bz2.sign, NONE, 1.1 .cvsignore, 1.17, 1.18 .gitignore, 1.7, 1.8 Makefile, 1.22, 1.23 Makefile.config, 1.22, 1.23 config-debug, 1.4, 1.5 config-generic, 1.8, 1.9 config-ia64-generic, 1.3, 1.4 config-nodebug, 1.5, 1.6 config-powerpc-generic, 1.4, 1.5 config-powerpc32-generic, 1.4, 1.5 config-powerpc64, 1.4, 1.5 config-s390x, 1.3, 1.4 config-sparc64-generic, 1.4, 1.5 config-x86-generic, 1.4, 1.5 config-x86_64-generic, 1.6, 1.7 config-xen-generic, 1.3, 1.4 kernel.spec, 1.45, 1.46 linux-2.6-alsa-kill-annoying-messages.patch, 1.1, 1.2 linux-2.6-at76.patch, 1.2, 1.3 linux-2.6-compile-fixes.patch, 1.5, 1.6 linux-2.6-e1000-ich9.patch, 1.2, 1.3 linux-2.6-execshield.patch, 1.4, 1.5 linux-2.6-lirc.patch, 1.2, 1.3 linux-2.6-silence-noise.patch, 1.5, 1.6 linux-2.6-utrace.patch, 1.4, 1.5 linux-2.6-wireless-pending.patch, 1.7, 1.8 linux-2.6-wireless.patch, 1.7, 1.8 linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch, 1.7, 1.8 linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch, 1.7, 1.8 linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch, 1.7, 1.8 sources, 1.17, 1.18 upstream, 1.7, 1.8 linux-2.6-25.3-queue.patch, 1.1, NONE linux-2.6-acpi-eeepc-hotkey.patch, 1.2, NONE linux-2.6-debug-no-quiet.patch, 1.3, NONE linux-2.6-devmem.patch, 1.4, NONE linux-2.6-ext4-stable-queue.patch, 1.2, NONE linux-2.6-firewire-git-pending.patch, 1.4, NONE linux-2.6-firewire-git-update.patch, 1.5, NONE linux-2.6-libata-ata_piix-check-sidpr.patch, 1.1, NONE linux-2.6-md-fix-oops-in-rdev_attr_store.patch, 1.1, NONE linux-2.6-ppc-rtc.patch, 1.2, NONE linux-2.6-rt2x00-configure_filter.patch, 1.1, NONE linux-2.6-smp-boot-delay.patch, 1.1, NONE linux-2.6-windfarm-pm121-fix.patch, 1.1, NONE linux-2.6-windfarm-pm121.patch, 1.1, NONE linux-2.6-wireless-pending-too.patch, 1.4, NONE linux-2.6-xen-0004-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch, 1.6, NONE linux-2.6-xen-0005-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch, 1.3, NONE linux-2.6-xen-0006-xen-Enable-Xen-console-by-default-in-domU.patch, 1.3, NONE linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.10, NONE linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.10, NONE linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.9, NONE linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch, 1.9, NONE linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch, 1.9, NONE linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch, 1.9, NONE linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch, 1.9, NONE linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch, 1.9, NONE linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.9, NONE linux-2.6-xen-0016-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.3, NONE linux-2.6-xen-0017-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, 1.3, NONE linux-2.6-xen-0018-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch, 1.4, NONE linux-2.6-xen-0019-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch, 1.4, NONE linux-2.6-xen-0020-x86_64-Expose-set_pte_vaddr.patch, 1.4, NONE linux-2.6-xen-0021-x86_64-Split-set_pte_vaddr.patch, 1.4, NONE linux-2.6-xen-0022-x86_64-Add-clear_fixmap.patch, 1.4, NONE linux-2.6-xen-0023-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch, 1.4, NONE linux-2.6-xen-0024-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch, 1.4, NONE linux-2.6-xen-0025-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch, 1.4, NONE linux-2.6-xen-0026-DMI-Define-dmi_scan_machine-as-no-op-if-CONFIG_DM.patch, 1.4, NONE linux-2.6-xen-0027-ACPI-thermal-Compile-without-CONFIG_DMI.patch, 1.4, NONE linux-2.6-xen-0028-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch, 1.4, NONE linux-2.6-xen-0029-xen-x86_64-Add-update_va_mapping-64-bit-code.patch, 1.4, NONE linux-2.6-xen-0030-x86_64-Add-sync_cmpxchg.patch, 1.4, NONE linux-2.6-xen-0031-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch, 1.4, NONE linux-2.6-xen-0032-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch, 1.4, NONE linux-2.6-xen-0033-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch, 1.4, NONE linux-2.6-xen-0034-Better-implementation-of-pte-functions.patch, 1.4, NONE linux-2.6-xen-0035-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch, 1.4, NONE linux-2.6-xen-0036-Add-gate_offset-and-gate_segment-macros.patch, 1.4, NONE linux-2.6-xen-0037-xen_write_idt_entry-and-cvt_gate_to_trap.patch, 1.4, NONE linux-2.6-xen-0038-typedefs-for-pte_val-and-friends.patch, 1.4, NONE linux-2.6-xen-0039-x86_64-implementation-of-some-page.h-macros.patch, 1.4, NONE linux-2.6-xen-0040-Chainsaw-style-ifdefs.patch, 1.4, NONE linux-2.6-xen-0041-xen-Make-xen_pte_val-generic.patch, 1.4, NONE linux-2.6-xen-0042-More-chainsaw-ifdefs.patch, 1.4, NONE linux-2.6-xen-0043-Chainsaw-ifdefs-on-assembly-percpu-handling.patch, 1.4, NONE linux-2.6-xen-0044-x86_64-percpu-assembly-macros.patch, 1.4, NONE linux-2.6-xen-0045-Some-xen-asm.S-x86_64-code.patch, 1.4, NONE linux-2.6-xen-0046-Chainsaw-party-SPLITME.patch, 1.4, NONE linux-2.6-xen-0047-xen-asm.S-x86_64-notes.patch, 1.4, NONE linux-2.6-xen-0048-xen-x86_64-Make-hypercall-assembly-code-work.patch, 1.4, NONE linux-2.6-xen-0049-xen-x86_64-pda-initialization.patch, 1.4, NONE linux-2.6-xen-0050-Disable-discover_ebda-under-paravirt.patch, 1.4, NONE linux-2.6-xen-0051-Disable-early_printk-by-default.patch, 1.4, NONE linux-2.6-xen-0052-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch, 1.4, NONE linux-2.6-xen-0053-Set-__PAGE_OFFSET-as-required-by-Xen.patch, 1.4, NONE linux-2.6-xen-0054-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch, 1.4, NONE linux-2.6-xen-0055-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch, 1.4, NONE linux-2.6-xen-0056-Use-__pgd-on-mk_kernel_pgd.patch, 1.5, NONE linux-2.6-xen-0057-Include-user-page-tables-on-head_64.S.patch, 1.5, NONE linux-2.6-xen-0058-Avoid-using-mk_unsigned_long.patch, 1.5, NONE linux-2.6-xen-0059-Lots-of-unrelated-changes.patch, 1.5, NONE linux-2.6-xen-0060-Hack-disable-vsmp.patch, 1.5, NONE linux-2.6-xen-0061-Export-early_make_page_readonly.patch, 1.5, NONE linux-2.6-xen-0062-Disable-multicalls.c-too-verbose-debugging.patch, 1.5, NONE linux-2.6-xen-0063-Xen-64-bit-ready-MMU-operations.patch, 1.5, NONE linux-2.6-xen-0064-Some-xen-mmu-pv-ops-implemented.patch, 1.5, NONE linux-2.6-xen-0065-Trying-to-make-the-pagetable-initialization-code-wor.patch, 1.5, NONE linux-2.6-xen-0066-Xen-specific-find_early_table_space-FIXME.patch, 1.5, NONE linux-2.6-xen-0067-Xen-call-e820_print_map-when-setting-up-memory.patch, 1.5, NONE linux-2.6-xen-0068-Comment-debugging-msgs.patch, 1.5, NONE linux-2.6-xen-0069-Try-to-make-pagetables-read-only.patch, 1.5, NONE linux-2.6-xen-0070-Debug-dump-pgtables-on-make_page_readonly.patch, 1.5, NONE linux-2.6-xen-0071-Disable-apic-at-compile-time-FIXME.patch, 1.5, NONE linux-2.6-xen-0072-Parse-early-params-after-init_memory_mapping.patch, 1.5, NONE linux-2.6-xen-0073-xen-Move-addr_to_page-to-init.h.patch, 1.5, NONE linux-2.6-xen-0074-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch, 1.5, NONE linux-2.6-xen-0075-Pull-xen_finish_init_mappin-from-XS-upstream.patch, 1.5, NONE linux-2.6-xen-0076-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch, 1.5, NONE linux-2.6-xen-0077-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch, 1.5, NONE linux-2.6-xen-0078-New-enum-fixed_addresses-values-REVIEWME.patch, 1.5, NONE linux-2.6-xen-0079-Reserve-bootmem-areas-used-by-Xen-FIXME.patch, 1.5, NONE linux-2.6-xen-0080-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch, 1.5, NONE linux-2.6-xen-0081-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch, 1.5, NONE linux-2.6-xen-0082-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch, 1.5, NONE linux-2.6-xen-0083-Handle-Xen-exception-stack-it-is-different-from-bar.patch, 1.5, NONE linux-2.6-xen-0084-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch, 1.3, NONE linux-2.6-xen-0085-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch, 1.3, NONE linux-2.6-xen-0086-Implement-asm-xen_iret.patch, 1.3, NONE linux-2.6-xen-0087-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch, 1.3, NONE linux-2.6-xen-0088-Implement-xen_irqenable_syscall_ret.patch, 1.3, NONE linux-2.6-xen-0089-DEBUG-xen_iret-always-return-through-the-hyperviso.patch, 1.3, NONE linux-2.6-xen-0090-Implement-some-xen-callbacks-on-xen-entry_64.S.patch, 1.3, NONE linux-2.6-xen-0091-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch, 1.3, NONE linux-2.6-xen-0092-Disable-syscall32-code-temporarily-FIXME.patch, 1.3, NONE linux-2.6-xen-0093-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch, 1.3, NONE linux-2.6-xen-0094-Use-apic_xen-on-genapic-by-default-FIXME.patch, 1.3, NONE linux-2.6-xen-0095-irq-vector-ifdef-chainsaw-FIXME.patch, 1.3, NONE linux-2.6-xen-0096-ifdef-chainsaw-on-syscall_init-FIXME.patch, 1.3, NONE linux-2.6-xen-0097-Pull-xen-genapic-implementation-from-upstream-Xen.patch, 1.3, NONE linux-2.6-xen-0098-Debugging-printk-s.patch, 1.3, NONE linux-2.6-xen-0099-Leave-lazy_cpu_mode-on-__switch_to.patch, 1.3, NONE linux-2.6-xen-0100-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch, 1.3, NONE linux-2.6-xen-0101-Disable-vcpu_info_placement-temporarily-FIXME.patch, 1.3, NONE linux-2.6-xen-0102-Fix-typo-on-ifdef-again.patch, 1.3, NONE linux-2.6-xen-0103-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch, 1.3, NONE linux-2.6-xen-0104-Make-load_gs_index-a-paravirt-operation.patch, 1.3, NONE linux-2.6-xen-0105-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch, 1.3, NONE linux-2.6-xen-0106-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch, 1.3, NONE linux-2.6-xen-0107-xen-pgd_walk-accept-start-parameter.patch, 1.3, NONE linux-2.6-xen-0108-xen-64-reserve_bootmem-xen_start_info-area.patch, 1.3, NONE linux-2.6-xen-0109-pvops-64-call-paravirt_post_allocator_init-on-set.patch, 1.3, NONE linux-2.6-xen-0110-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch, 1.3, NONE linux-2.6-xen-0111-xen-64-implement-xen_load_gs_index.patch, 1.3, NONE linux-2.6-xen-0112-include-asm-x86-pgalloc_64.h-pvops-hacks-SPLITME.patch, 1.3, NONE linux-2.6-xen-0113-Multi-pagetable-write_cr3-implementation-FIXME.patch, 1.3, NONE linux-2.6-xen-0114-Disable-the-weird-count-loop-on-kcons_write_dom0.patch, 1.3, NONE linux-2.6-xen-0115-Make-xen_start_info-read-only.patch, 1.3, NONE linux-2.6-xen-0116-Hack-to-implement-return-to-userspace-without-SWAPGS.patch, 1.3, NONE linux-2.6-xen-0117-Xen-SEGBASE_-defines.patch, 1.3, NONE linux-2.6-xen-0118-Xen-HYPERVISOR_set_segment_base-implementation.patch, 1.3, NONE linux-2.6-xen-0119-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch, 1.3, NONE linux-2.6-xen-0120-Comment-e820_print_map-call-TEMPORARY.patch, 1.3, NONE linux-2.6-xen-0121-Xen-missing-includes.patch, 1.3, NONE linux-2.6-xen-0122-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch, 1.3, NONE linux-2.6-xen-0123-asm-x86-pgtable.h-include-asm-page.h.patch, 1.3, NONE linux-2.6-xen-0124-fix-pxxval_t-usage-on-mm-init_64.c.patch, 1.3, NONE linux-2.6-xen-0125-Missing-Xen-include.patch, 1.3, NONE linux-2.6-xen-0126-un-static-ipi_to_irq.patch, 1.3, NONE linux-2.6-xen-0127-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch, 1.3, NONE linux-2.6-xen-0128-Trying-to-organize-the-xen-bootmem-allocation-mess.patch, 1.3, NONE linux-2.6-xen-0129-Xen-reserve_bootmem-xenstore-and-console-interfac.patch, 1.3, NONE linux-2.6-xen-0130-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch, 1.3, NONE linux-2.6-xen-0131-Xen-64-bit-support-on-xen_pgd_pin.patch, 1.3, NONE linux-2.6-xen-0132-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch, 1.3, NONE linux-2.6-xen-0133-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.patch, 1.3, NONE linux-2.6-xen-0134-Xen-Add-a-order-parameter-to-pgd_walk.patch, 1.3, NONE linux-2.6-xen-0135-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch, 1.3, NONE linux-2.6-xen-0136-Use-un-pin_page-when-un-pinning-pgd.patch, 1.3, NONE linux-2.6-xen-0137-Allow-enabling-Xen-on-x86_64.patch, 1.3, NONE linux-2.6-xen-0138-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch, 1.3, NONE linux-2.6-xen-0139-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch, 1.3, NONE linux-2.6-xen-0140-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch, 1.3, NONE linux-2.6-xen-0141-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch, 1.3, NONE linux-2.6-xen-0142-Create-xen-specific-syscall-entry.patch, 1.3, NONE linux-2.6-xen-0143-syscall-related-Xen-ifdefs-FIXME.patch, 1.3, NONE linux-2.6-xen-0144-Point-set_pte-to-xen_set_pte-since-the-beginning.patch, 1.3, NONE linux-2.6-xen-0145-DEBUG-slab-debugging.patch, 1.3, NONE linux-2.6-xen-0146-pvops-64-Include-rsi-on-the-register-clobber-list.patch, 1.3, NONE linux-2.6-xen-0147-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch, 1.3, NONE linux-2.6-xen-0148-Add-missing-acpi-include-to-xen-setup.c.patch, 1.3, NONE linux-2.6-xen-0149-Don-t-use-FIX_VDSO-on-64-bit.patch, 1.3, NONE linux-2.6-xen-0150-Mark-init-pages-read-write-again-on-free_init_pages.patch, 1.3, NONE linux-2.6-xen-0151-reserve_early-kernel-text-and-data-segments.patch, 1.3, NONE linux-2.6-xen-0152-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch, 1.3, NONE linux-2.6-xen-0153-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch, 1.2, NONE linux-2.6-xen-0154-Pull-xen_failsafe_callback-implementation-from-XenSo.patch, 1.1, NONE linux-2.6-xen-0155-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch, 1.1, NONE linux-2.6-xen-0156-xen-64-Clear-fs-on-xen_load_tls.patch, 1.1, NONE linux-2.6-xen-0157-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch, 1.1, NONE linux-2.6-xen-0158-Introduce-xen_ia32_syscall.patch, 1.1, NONE linux-2.6-xen-0159-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch, 1.1, NONE linux-2.6-xen-0160-Make-the-int80-and-syscall-vdso32-implementations-se.patch, 1.1, NONE linux-2.6-xen-0161-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch, 1.1, NONE linux-2.6-xen-0162-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch, 1.1, NONE linux-2.6-xen-0163-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch, 1.1, NONE linux-2.6.25-sparc64-semctl.patch, 1.1, NONE patch-2.6.25.2.bz2.sign, 1.1, NONE

Mark McLoughlin (markmc) fedora-extras-commits at redhat.com
Mon Jun 16 10:20:20 UTC 2008


Author: markmc

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32197

Modified Files:
	.cvsignore .gitignore Makefile Makefile.config config-debug 
	config-generic config-ia64-generic config-nodebug 
	config-powerpc-generic config-powerpc32-generic 
	config-powerpc64 config-s390x config-sparc64-generic 
	config-x86-generic config-x86_64-generic config-xen-generic 
	kernel.spec linux-2.6-alsa-kill-annoying-messages.patch 
	linux-2.6-at76.patch linux-2.6-compile-fixes.patch 
	linux-2.6-e1000-ich9.patch linux-2.6-execshield.patch 
	linux-2.6-lirc.patch linux-2.6-silence-noise.patch 
	linux-2.6-utrace.patch linux-2.6-wireless-pending.patch 
	linux-2.6-wireless.patch 
	linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch 
	linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch 
	linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch 
	sources upstream 
Added Files:
	linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch 
	linux-2.6-net-8139-pio-modparam.patch 
	linux-2.6-net-8139-pio-oqo2.patch 
	linux-2.6-selinux-deffered-context-mapping-no-sleep.patch 
	linux-2.6-selinux-deffered-context-mapping.patch 
	linux-2.6-selinux-generic-ioctl.patch 
	linux-2.6-selinux-get-invalid-xattrs.patch 
	linux-2.6-selinux-new-proc-checks.patch 
	linux-2.6-silence-fbcon-logo.patch 
	linux-2.6-silence-x86-decompressor.patch 
	linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch 
	linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch 
	linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch 
	linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch 
	linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch 
	linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch 
	linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch 
	linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch 
	linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch 
	linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch 
	linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch 
	linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch 
	linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch 
	linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch 
	linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch 
	linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch 
	linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch 
	linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch 
	linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch 
	linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch 
	linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch 
	linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch 
	linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch 
	linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch 
	linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch 
	linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch 
	linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch 
	linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch 
	linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch 
	linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch 
	linux-2.6-xen-0034-More-chainsaw-ifdefs.patch 
	linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch 
	linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch 
	linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch 
	linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch 
	linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch 
	linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch 
	linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch 
	linux-2.6-xen-0042-Disable-early_printk-by-default.patch 
	linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch 
	linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch 
	linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch 
	linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch 
	linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch 
	linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch 
	linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch 
	linux-2.6-xen-0050-Lots-of-unrelated-changes.patch 
	linux-2.6-xen-0051-Hack-disable-vsmp.patch 
	linux-2.6-xen-0052-Export-early_make_page_readonly.patch 
	linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch 
	linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch 
	linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch 
	linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch 
	linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch 
	linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch 
	linux-2.6-xen-0059-Comment-debugging-msgs.patch 
	linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch 
	linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch 
	linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch 
	linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch 
	linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch 
	linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch 
	linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch 
	linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch 
	linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch 
	linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch 
	linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch 
	linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch 
	linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch 
	linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch 
	linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch 
	linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch 
	linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch 
	linux-2.6-xen-0077-Implement-asm-xen_iret.patch 
	linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch 
	linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch 
	linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch 
	linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch 
	linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch 
	linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch 
	linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch 
	linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch 
	linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch 
	linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch 
	linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch 
	linux-2.6-xen-0089-Debugging-printk-s.patch 
	linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch 
	linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch 
	linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch 
	linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch 
	linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch 
	linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch 
	linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch 
	linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch 
	linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch 
	linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch 
	linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch 
	linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch 
	linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch 
	linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch 
	linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch 
	linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch 
	linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch 
	linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch 
	linux-2.6-xen-0108-Make-xen_start_info-read-only.patch 
	linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch 
	linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch 
	linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch 
	linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch 
	linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch 
	linux-2.6-xen-0114-Xen-missing-includes.patch 
	linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch 
	linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch 
	linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch 
	linux-2.6-xen-0118-Missing-Xen-include.patch 
	linux-2.6-xen-0119-un-static-ipi_to_irq.patch 
	linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch 
	linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch 
	linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch 
	linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch 
	linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch 
	linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch 
	linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch 
	linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch 
	linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch 
	linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch 
	linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch 
	linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch 
	linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch 
	linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch 
	linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch 
	linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch 
	linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch 
	linux-2.6-xen-0137-DEBUG-slab-debugging.patch 
	linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch 
	linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch 
	linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch 
	linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch 
	linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch 
	linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch 
	linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch 
	linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch 
	linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch 
	linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch 
	linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch 
	linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch 
	linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch 
	linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch 
	linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch 
	linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch 
	linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch 
	linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch 
	linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch 
	linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch 
	linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch 
	linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch 
	linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch 
	linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch 
	linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch 
	patch-2.6.26-rc6-git2.bz2.sign patch-2.6.26-rc6.bz2.sign 
Removed Files:
	linux-2.6-25.3-queue.patch linux-2.6-acpi-eeepc-hotkey.patch 
	linux-2.6-debug-no-quiet.patch linux-2.6-devmem.patch 
	linux-2.6-ext4-stable-queue.patch 
	linux-2.6-firewire-git-pending.patch 
	linux-2.6-firewire-git-update.patch 
	linux-2.6-libata-ata_piix-check-sidpr.patch 
	linux-2.6-md-fix-oops-in-rdev_attr_store.patch 
	linux-2.6-ppc-rtc.patch 
	linux-2.6-rt2x00-configure_filter.patch 
	linux-2.6-smp-boot-delay.patch 
	linux-2.6-windfarm-pm121-fix.patch 
	linux-2.6-windfarm-pm121.patch 
	linux-2.6-wireless-pending-too.patch 
	linux-2.6-xen-0004-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch 
	linux-2.6-xen-0005-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch 
	linux-2.6-xen-0006-xen-Enable-Xen-console-by-default-in-domU.patch 
	linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch 
	linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch 
	linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch 
	linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch 
	linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch 
	linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch 
	linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch 
	linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch 
	linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch 
	linux-2.6-xen-0016-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch 
	linux-2.6-xen-0017-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch 
	linux-2.6-xen-0018-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch 
	linux-2.6-xen-0019-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch 
	linux-2.6-xen-0020-x86_64-Expose-set_pte_vaddr.patch 
	linux-2.6-xen-0021-x86_64-Split-set_pte_vaddr.patch 
	linux-2.6-xen-0022-x86_64-Add-clear_fixmap.patch 
	linux-2.6-xen-0023-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch 
	linux-2.6-xen-0024-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch 
	linux-2.6-xen-0025-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch 
	linux-2.6-xen-0026-DMI-Define-dmi_scan_machine-as-no-op-if-CONFIG_DM.patch 
	linux-2.6-xen-0027-ACPI-thermal-Compile-without-CONFIG_DMI.patch 
	linux-2.6-xen-0028-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch 
	linux-2.6-xen-0029-xen-x86_64-Add-update_va_mapping-64-bit-code.patch 
	linux-2.6-xen-0030-x86_64-Add-sync_cmpxchg.patch 
	linux-2.6-xen-0031-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch 
	linux-2.6-xen-0032-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch 
	linux-2.6-xen-0033-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch 
	linux-2.6-xen-0034-Better-implementation-of-pte-functions.patch 
	linux-2.6-xen-0035-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch 
	linux-2.6-xen-0036-Add-gate_offset-and-gate_segment-macros.patch 
	linux-2.6-xen-0037-xen_write_idt_entry-and-cvt_gate_to_trap.patch 
	linux-2.6-xen-0038-typedefs-for-pte_val-and-friends.patch 
	linux-2.6-xen-0039-x86_64-implementation-of-some-page.h-macros.patch 
	linux-2.6-xen-0040-Chainsaw-style-ifdefs.patch 
	linux-2.6-xen-0041-xen-Make-xen_pte_val-generic.patch 
	linux-2.6-xen-0042-More-chainsaw-ifdefs.patch 
	linux-2.6-xen-0043-Chainsaw-ifdefs-on-assembly-percpu-handling.patch 
	linux-2.6-xen-0044-x86_64-percpu-assembly-macros.patch 
	linux-2.6-xen-0045-Some-xen-asm.S-x86_64-code.patch 
	linux-2.6-xen-0046-Chainsaw-party-SPLITME.patch 
	linux-2.6-xen-0047-xen-asm.S-x86_64-notes.patch 
	linux-2.6-xen-0048-xen-x86_64-Make-hypercall-assembly-code-work.patch 
	linux-2.6-xen-0049-xen-x86_64-pda-initialization.patch 
	linux-2.6-xen-0050-Disable-discover_ebda-under-paravirt.patch 
	linux-2.6-xen-0051-Disable-early_printk-by-default.patch 
	linux-2.6-xen-0052-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch 
	linux-2.6-xen-0053-Set-__PAGE_OFFSET-as-required-by-Xen.patch 
	linux-2.6-xen-0054-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch 
	linux-2.6-xen-0055-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch 
	linux-2.6-xen-0056-Use-__pgd-on-mk_kernel_pgd.patch 
	linux-2.6-xen-0057-Include-user-page-tables-on-head_64.S.patch 
	linux-2.6-xen-0058-Avoid-using-mk_unsigned_long.patch 
	linux-2.6-xen-0059-Lots-of-unrelated-changes.patch 
	linux-2.6-xen-0060-Hack-disable-vsmp.patch 
	linux-2.6-xen-0061-Export-early_make_page_readonly.patch 
	linux-2.6-xen-0062-Disable-multicalls.c-too-verbose-debugging.patch 
	linux-2.6-xen-0063-Xen-64-bit-ready-MMU-operations.patch 
	linux-2.6-xen-0064-Some-xen-mmu-pv-ops-implemented.patch 
	linux-2.6-xen-0065-Trying-to-make-the-pagetable-initialization-code-wor.patch 
	linux-2.6-xen-0066-Xen-specific-find_early_table_space-FIXME.patch 
	linux-2.6-xen-0067-Xen-call-e820_print_map-when-setting-up-memory.patch 
	linux-2.6-xen-0068-Comment-debugging-msgs.patch 
	linux-2.6-xen-0069-Try-to-make-pagetables-read-only.patch 
	linux-2.6-xen-0070-Debug-dump-pgtables-on-make_page_readonly.patch 
	linux-2.6-xen-0071-Disable-apic-at-compile-time-FIXME.patch 
	linux-2.6-xen-0072-Parse-early-params-after-init_memory_mapping.patch 
	linux-2.6-xen-0073-xen-Move-addr_to_page-to-init.h.patch 
	linux-2.6-xen-0074-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch 
	linux-2.6-xen-0075-Pull-xen_finish_init_mappin-from-XS-upstream.patch 
	linux-2.6-xen-0076-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch 
	linux-2.6-xen-0077-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch 
	linux-2.6-xen-0078-New-enum-fixed_addresses-values-REVIEWME.patch 
	linux-2.6-xen-0079-Reserve-bootmem-areas-used-by-Xen-FIXME.patch 
	linux-2.6-xen-0080-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch 
	linux-2.6-xen-0081-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch 
	linux-2.6-xen-0082-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch 
	linux-2.6-xen-0083-Handle-Xen-exception-stack-it-is-different-from-bar.patch 
	linux-2.6-xen-0084-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch 
	linux-2.6-xen-0085-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch 
	linux-2.6-xen-0086-Implement-asm-xen_iret.patch 
	linux-2.6-xen-0087-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch 
	linux-2.6-xen-0088-Implement-xen_irqenable_syscall_ret.patch 
	linux-2.6-xen-0089-DEBUG-xen_iret-always-return-through-the-hyperviso.patch 
	linux-2.6-xen-0090-Implement-some-xen-callbacks-on-xen-entry_64.S.patch 
	linux-2.6-xen-0091-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch 
	linux-2.6-xen-0092-Disable-syscall32-code-temporarily-FIXME.patch 
	linux-2.6-xen-0093-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch 
	linux-2.6-xen-0094-Use-apic_xen-on-genapic-by-default-FIXME.patch 
	linux-2.6-xen-0095-irq-vector-ifdef-chainsaw-FIXME.patch 
	linux-2.6-xen-0096-ifdef-chainsaw-on-syscall_init-FIXME.patch 
	linux-2.6-xen-0097-Pull-xen-genapic-implementation-from-upstream-Xen.patch 
	linux-2.6-xen-0098-Debugging-printk-s.patch 
	linux-2.6-xen-0099-Leave-lazy_cpu_mode-on-__switch_to.patch 
	linux-2.6-xen-0100-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch 
	linux-2.6-xen-0101-Disable-vcpu_info_placement-temporarily-FIXME.patch 
	linux-2.6-xen-0102-Fix-typo-on-ifdef-again.patch 
	linux-2.6-xen-0103-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch 
	linux-2.6-xen-0104-Make-load_gs_index-a-paravirt-operation.patch 
	linux-2.6-xen-0105-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch 
	linux-2.6-xen-0106-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch 
	linux-2.6-xen-0107-xen-pgd_walk-accept-start-parameter.patch 
	linux-2.6-xen-0108-xen-64-reserve_bootmem-xen_start_info-area.patch 
	linux-2.6-xen-0109-pvops-64-call-paravirt_post_allocator_init-on-set.patch 
	linux-2.6-xen-0110-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch 
	linux-2.6-xen-0111-xen-64-implement-xen_load_gs_index.patch 
	linux-2.6-xen-0112-include-asm-x86-pgalloc_64.h-pvops-hacks-SPLITME.patch 
	linux-2.6-xen-0113-Multi-pagetable-write_cr3-implementation-FIXME.patch 
	linux-2.6-xen-0114-Disable-the-weird-count-loop-on-kcons_write_dom0.patch 
	linux-2.6-xen-0115-Make-xen_start_info-read-only.patch 
	linux-2.6-xen-0116-Hack-to-implement-return-to-userspace-without-SWAPGS.patch 
	linux-2.6-xen-0117-Xen-SEGBASE_-defines.patch 
	linux-2.6-xen-0118-Xen-HYPERVISOR_set_segment_base-implementation.patch 
	linux-2.6-xen-0119-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch 
	linux-2.6-xen-0120-Comment-e820_print_map-call-TEMPORARY.patch 
	linux-2.6-xen-0121-Xen-missing-includes.patch 
	linux-2.6-xen-0122-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch 
	linux-2.6-xen-0123-asm-x86-pgtable.h-include-asm-page.h.patch 
	linux-2.6-xen-0124-fix-pxxval_t-usage-on-mm-init_64.c.patch 
	linux-2.6-xen-0125-Missing-Xen-include.patch 
	linux-2.6-xen-0126-un-static-ipi_to_irq.patch 
	linux-2.6-xen-0127-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch 
	linux-2.6-xen-0128-Trying-to-organize-the-xen-bootmem-allocation-mess.patch 
	linux-2.6-xen-0129-Xen-reserve_bootmem-xenstore-and-console-interfac.patch 
	linux-2.6-xen-0130-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch 
	linux-2.6-xen-0131-Xen-64-bit-support-on-xen_pgd_pin.patch 
	linux-2.6-xen-0132-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch 
	linux-2.6-xen-0133-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.patch 
	linux-2.6-xen-0134-Xen-Add-a-order-parameter-to-pgd_walk.patch 
	linux-2.6-xen-0135-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch 
	linux-2.6-xen-0136-Use-un-pin_page-when-un-pinning-pgd.patch 
	linux-2.6-xen-0137-Allow-enabling-Xen-on-x86_64.patch 
	linux-2.6-xen-0138-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch 
	linux-2.6-xen-0139-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch 
	linux-2.6-xen-0140-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch 
	linux-2.6-xen-0141-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch 
	linux-2.6-xen-0142-Create-xen-specific-syscall-entry.patch 
	linux-2.6-xen-0143-syscall-related-Xen-ifdefs-FIXME.patch 
	linux-2.6-xen-0144-Point-set_pte-to-xen_set_pte-since-the-beginning.patch 
	linux-2.6-xen-0145-DEBUG-slab-debugging.patch 
	linux-2.6-xen-0146-pvops-64-Include-rsi-on-the-register-clobber-list.patch 
	linux-2.6-xen-0147-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch 
	linux-2.6-xen-0148-Add-missing-acpi-include-to-xen-setup.c.patch 
	linux-2.6-xen-0149-Don-t-use-FIX_VDSO-on-64-bit.patch 
	linux-2.6-xen-0150-Mark-init-pages-read-write-again-on-free_init_pages.patch 
	linux-2.6-xen-0151-reserve_early-kernel-text-and-data-segments.patch 
	linux-2.6-xen-0152-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch 
	linux-2.6-xen-0153-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch 
	linux-2.6-xen-0154-Pull-xen_failsafe_callback-implementation-from-XenSo.patch 
	linux-2.6-xen-0155-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch 
	linux-2.6-xen-0156-xen-64-Clear-fs-on-xen_load_tls.patch 
	linux-2.6-xen-0157-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch 
	linux-2.6-xen-0158-Introduce-xen_ia32_syscall.patch 
	linux-2.6-xen-0159-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch 
	linux-2.6-xen-0160-Make-the-int80-and-syscall-vdso32-implementations-se.patch 
	linux-2.6-xen-0161-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch 
	linux-2.6-xen-0162-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch 
	linux-2.6-xen-0163-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch 
	linux-2.6.25-sparc64-semctl.patch patch-2.6.25.2.bz2.sign 
Log Message:
* Mon Jun 16 2008 Mark McLoughlin <markmc at redhat.com>
- Rebase to kernel-2_6_26-0_72_rc6_git2_fc10


linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch:

--- NEW FILE linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch ---
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e5ac9e1..3a006d0 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -285,6 +285,7 @@ struct azx_dev {
 	u32 *posbuf;		/* position buffer pointer */
 
 	unsigned int bufsize;	/* size of the play buffer in bytes */
+	unsigned int period_bytes; /* size of the period in bytes */
 	unsigned int frags;	/* number for period in the play buffer */
 	unsigned int fifo_size;	/* FIFO size */
 
@@ -301,11 +302,10 @@ struct azx_dev {
 					 */
 	unsigned char stream_tag;	/* assigned stream */
 	unsigned char index;		/* stream index */
-	/* for sanity check of position buffer */
-	unsigned int period_intr;
 
 	unsigned int opened :1;
 	unsigned int running :1;
+	unsigned int irq_pending: 1;
 };
 
 /* CORB/RIRB */
@@ -369,6 +369,9 @@ struct azx {
 
 	/* for debugging */
 	unsigned int last_cmd;	/* last issued command (to sync) */
+
+	/* for pending irqs */
+	struct work_struct irq_pending_work;
 };
 
 /* driver types */
@@ -908,6 +911,8 @@ static void azx_init_pci(struct azx *chip)
 }
 
 
+static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
+
 /*
  * interrupt handler
  */
@@ -930,11 +935,18 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
 		azx_dev = &chip->azx_dev[i];
 		if (status & azx_dev->sd_int_sta_mask) {
 			azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK);
-			if (azx_dev->substream && azx_dev->running) {
-				azx_dev->period_intr++;
+			if (!azx_dev->substream || !azx_dev->running)
+				continue;
+			/* check whether this IRQ is really acceptable */
+			if (azx_position_ok(chip, azx_dev)) {
+				azx_dev->irq_pending = 0;
 				spin_unlock(&chip->reg_lock);
 				snd_pcm_period_elapsed(azx_dev->substream);
 				spin_lock(&chip->reg_lock);
+			} else {
+				/* bogus IRQ, process it later */
+				azx_dev->irq_pending = 1;
+				schedule_work(&chip->irq_pending_work);
 			}
 		}
 	}
@@ -973,6 +985,7 @@ static int azx_setup_periods(struct snd_pcm_substream *substream,
 	azx_sd_writel(azx_dev, SD_BDLPU, 0);
 
 	period_bytes = snd_pcm_lib_period_bytes(substream);
+	azx_dev->period_bytes = period_bytes;
 	periods = azx_dev->bufsize / period_bytes;
 
 	/* program the initial BDL entries */
@@ -1421,27 +1434,16 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 	return 0;
 }
 
-static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream)
+static unsigned int azx_get_position(struct azx *chip,
+				     struct azx_dev *azx_dev)
 {
-	struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
-	struct azx *chip = apcm->chip;
-	struct azx_dev *azx_dev = get_azx_dev(substream);
 	unsigned int pos;
 
 	if (chip->position_fix == POS_FIX_POSBUF ||
 	    chip->position_fix == POS_FIX_AUTO) {
 		/* use the position buffer */
 		pos = le32_to_cpu(*azx_dev->posbuf);
-		if (chip->position_fix == POS_FIX_AUTO &&
-		    azx_dev->period_intr == 1 && !pos) {
-			printk(KERN_WARNING
-			       "hda-intel: Invalid position buffer, "
-			       "using LPIB read method instead.\n");
-			chip->position_fix = POS_FIX_NONE;
-			goto read_lpib;
-		}
 	} else {
-	read_lpib:
 		/* read LPIB */
 		pos = azx_sd_readl(azx_dev, SD_LPIB);
 		if (chip->position_fix == POS_FIX_FIFO)
@@ -1449,7 +1451,90 @@ static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream)
 	}
 	if (pos >= azx_dev->bufsize)
 		pos = 0;
-	return bytes_to_frames(substream->runtime, pos);
+	return pos;
+}
+
+static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream)
+{
+	struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
+	struct azx *chip = apcm->chip;
+	struct azx_dev *azx_dev = get_azx_dev(substream);
+	return bytes_to_frames(substream->runtime,
+			       azx_get_position(chip, azx_dev));
+}
+
+/*
+ * Check whether the current DMA position is acceptable for updating
+ * periods.  Returns non-zero if it's OK.
+ *
+ * Many HD-audio controllers appear pretty inaccurate about
+ * the update-IRQ timing.  The IRQ is issued before actually the
+ * data is processed.  So, we need to process it afterwords in a
+ * workqueue.
+ */
+static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
+{
+	unsigned int pos;
+
+	pos = azx_get_position(chip, azx_dev);
+	if (chip->position_fix == POS_FIX_AUTO) {
+		if (!pos) {
+			printk(KERN_WARNING
+			       "hda-intel: Invalid position buffer, "
+			       "using LPIB read method instead.\n");
+			chip->position_fix = POS_FIX_NONE;
+			pos = azx_get_position(chip, azx_dev);
+		} else
+			chip->position_fix = POS_FIX_POSBUF;
+	}
+
+	if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2)
+		return 0; /* NG - it's below the period boundary */
+	return 1; /* OK, it's fine */
+}
+
+/*
+ * The work for pending PCM period updates.
+ */
+static void azx_irq_pending_work(struct work_struct *work)
+{
+	struct azx *chip = container_of(work, struct azx, irq_pending_work);
+	int i, pending;
+
+	for (;;) {
+		pending = 0;
+		spin_lock_irq(&chip->reg_lock);
+		for (i = 0; i < chip->num_streams; i++) {
+			struct azx_dev *azx_dev = &chip->azx_dev[i];
+			if (!azx_dev->irq_pending ||
+			    !azx_dev->substream ||
+			    !azx_dev->running)
+				continue;
+			if (azx_position_ok(chip, azx_dev)) {
+				azx_dev->irq_pending = 0;
+				spin_unlock(&chip->reg_lock);
+				snd_pcm_period_elapsed(azx_dev->substream);
+				spin_lock(&chip->reg_lock);
+			} else
+				pending++;
+		}
+		spin_unlock_irq(&chip->reg_lock);
+		if (!pending)
+			return;
+		cond_resched();
+	}
+}
+
+/* clear irq_pending flags and assure no on-going workq */
+static void azx_clear_irq_pending(struct azx *chip)
+{
+	int i;
+
+	spin_lock_irq(&chip->reg_lock);
+	for (i = 0; i < chip->num_streams; i++)
+		chip->azx_dev[i].irq_pending = 0;
+	spin_unlock_irq(&chip->reg_lock);
+	flush_scheduled_work();
 }
 
 static struct snd_pcm_ops azx_pcm_ops = {
@@ -1678,6 +1763,7 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
 	int i;
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	azx_clear_irq_pending(chip);
 	for (i = 0; i < AZX_MAX_PCMS; i++)
 		snd_pcm_suspend_all(chip->pcm[i]);
 	if (chip->initialized)
@@ -1734,6 +1820,7 @@ static int azx_free(struct azx *chip)
 	int i;
 
 	if (chip->initialized) {
+		azx_clear_irq_pending(chip);
 		for (i = 0; i < chip->num_streams; i++)
 			azx_stream_stop(chip, &chip->azx_dev[i]);
 		azx_stop_chip(chip);
@@ -1859,6 +1946,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
 	chip->irq = -1;
 	chip->driver_type = driver_type;
 	chip->msi = enable_msi;
+	INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work);
 
 	chip->position_fix = check_position_fix(chip, position_fix[dev]);
 	check_probe_mask(chip, dev);

linux-2.6-net-8139-pio-modparam.patch:

--- NEW FILE linux-2.6-net-8139-pio-modparam.patch ---
Make PIO/MMIO a runtime thing via a module parameter.
This is needed to support devices that only work with PIO
without penalising devices that work fine with MMIO in
distro kernels.

Signed-off-by: Dave Jones <davej at redhat.com>

diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 53bd903..09ace39 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -120,11 +120,6 @@
                                  NETIF_MSG_LINK)
 
 
-/* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
-#ifdef CONFIG_8139TOO_PIO
-#define USE_IO_OPS 1
-#endif
-
 /* define to 1, 2 or 3 to enable copious debugging info */
 #define RTL8139_DEBUG 0
 
@@ -156,6 +151,9 @@
 static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
+/* Whether to use MMIO or PIO. Default to MMIO. */
+static int use_pio;
+
 /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
    The RTL chips use a 64 element hash table based on the Ethernet CRC.  */
 static int multicast_filter_limit = 32;
@@ -615,6 +613,7 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 
+module_param(use_pio, int, 0);
 module_param(multicast_filter_limit, int, 0);
 module_param_array(media, int, NULL, 0);
 module_param_array(full_duplex, int, NULL, 0);
@@ -710,14 +709,13 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
 	assert (tp->pci_dev != NULL);
 	pdev = tp->pci_dev;
 
-#ifdef USE_IO_OPS
-	if (tp->mmio_addr)
-		ioport_unmap (tp->mmio_addr);
-#else
-	if (tp->mmio_addr)
-		pci_iounmap (pdev, tp->mmio_addr);
-#endif /* USE_IO_OPS */
-
+	if (use_pio) {
+		if (tp->mmio_addr)
+			ioport_unmap (tp->mmio_addr);
+	} else {
+		if (tp->mmio_addr)
+			pci_iounmap (pdev, tp->mmio_addr);
+	}
 	/* it's ok to call this even if we have no regions to free */
 	pci_release_regions (pdev);
 
@@ -791,32 +789,32 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 	DPRINTK("PIO region size == 0x%02X\n", pio_len);
 	DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
 
-#ifdef USE_IO_OPS
-	/* make sure PCI base addr 0 is PIO */
-	if (!(pio_flags & IORESOURCE_IO)) {
-		dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
-		rc = -ENODEV;
-		goto err_out;
-	}
-	/* check for weird/broken PCI region reporting */
-	if (pio_len < RTL_MIN_IO_SIZE) {
-		dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
-		rc = -ENODEV;
-		goto err_out;
-	}
-#else
-	/* make sure PCI base addr 1 is MMIO */
-	if (!(mmio_flags & IORESOURCE_MEM)) {
-		dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
-		rc = -ENODEV;
-		goto err_out;
-	}
-	if (mmio_len < RTL_MIN_IO_SIZE) {
-		dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
-		rc = -ENODEV;
-		goto err_out;
+	if (use_pio) {
+		/* make sure PCI base addr 0 is PIO */
+		if (!(pio_flags & IORESOURCE_IO)) {
+			dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
+			rc = -ENODEV;
+			goto err_out;
+		}
+		/* check for weird/broken PCI region reporting */
+		if (pio_len < RTL_MIN_IO_SIZE) {
+			dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
+			rc = -ENODEV;
+			goto err_out;
+		}
+	} else {
+		/* make sure PCI base addr 1 is MMIO */
+		if (!(mmio_flags & IORESOURCE_MEM)) {
+			dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
+			rc = -ENODEV;
+			goto err_out;
+		}
+		if (mmio_len < RTL_MIN_IO_SIZE) {
+			dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
+			rc = -ENODEV;
+			goto err_out;
+		}
 	}
-#endif
 
 	rc = pci_request_regions (pdev, DRV_NAME);
 	if (rc)
@@ -826,28 +824,28 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 	/* enable PCI bus-mastering */
 	pci_set_master (pdev);
 
-#ifdef USE_IO_OPS
-	ioaddr = ioport_map(pio_start, pio_len);
-	if (!ioaddr) {
-		dev_err(&pdev->dev, "cannot map PIO, aborting\n");
-		rc = -EIO;
-		goto err_out;
-	}
-	dev->base_addr = pio_start;
-	tp->mmio_addr = ioaddr;
-	tp->regs_len = pio_len;
-#else
-	/* ioremap MMIO region */
-	ioaddr = pci_iomap(pdev, 1, 0);
-	if (ioaddr == NULL) {
-		dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
-		rc = -EIO;
-		goto err_out;
+	if (use_pio) {
+		ioaddr = ioport_map(pio_start, pio_len);
+		if (!ioaddr) {
+			dev_err(&pdev->dev, "cannot map PIO, aborting\n");
+			rc = -EIO;
+			goto err_out;
+		}
+		dev->base_addr = pio_start;
+		tp->mmio_addr = ioaddr;
+		tp->regs_len = pio_len;
+	} else {
+		/* ioremap MMIO region */
+		ioaddr = pci_iomap(pdev, 1, 0);
+		if (ioaddr == NULL) {
+			dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
+			rc = -EIO;
+			goto err_out;
+		}
+		dev->base_addr = (long) ioaddr;
+		tp->mmio_addr = ioaddr;
+		tp->regs_len = mmio_len;
 	}
-	dev->base_addr = (long) ioaddr;
-	tp->mmio_addr = ioaddr;
-	tp->regs_len = mmio_len;
-#endif /* USE_IO_OPS */
 
 	/* Bring old chips out of low-power mode. */
 	RTL_W8 (HltClk, 'R');
@@ -2383,20 +2381,24 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
 	np->msg_enable = datum;
 }
 
-/* TODO: we are too slack to do reg dumping for pio, for now */
-#ifdef CONFIG_8139TOO_PIO
-#define rtl8139_get_regs_len	NULL
-#define rtl8139_get_regs	NULL
-#else
 static int rtl8139_get_regs_len(struct net_device *dev)
 {
-	struct rtl8139_private *np = netdev_priv(dev);
+	struct rtl8139_private *np;
+	/* TODO: we are too slack to do reg dumping for pio, for now */
+	if (use_pio)
+		return 0;
+	np = netdev_priv(dev);
 	return np->regs_len;
 }
 
 static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf)
 {
-	struct rtl8139_private *np = netdev_priv(dev);
+	struct rtl8139_private *np;
+
+	/* TODO: we are too slack to do reg dumping for pio, for now */
+	if (use_pio)
+		return;
+	np = netdev_priv(dev);
 
 	regs->version = RTL_REGS_VER;
 
@@ -2404,7 +2406,6 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 	memcpy_fromio(regbuf, np->mmio_addr, regs->len);
 	spin_unlock_irq(&np->lock);
 }
-#endif /* CONFIG_8139TOO_MMIO */
 
 static int rtl8139_get_sset_count(struct net_device *dev, int sset)
 {
@@ -2610,6 +2611,11 @@ static int __init rtl8139_init_module (void)
 	printk (KERN_INFO RTL8139_DRIVER_NAME "\n");
 #endif
 
+	/* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
+#ifdef CONFIG_8139TOO_PIO
+	use_pio = 1;
+#endif
+
 	return pci_register_driver(&rtl8139_pci_driver);
 }
 

linux-2.6-net-8139-pio-oqo2.patch:

--- NEW FILE linux-2.6-net-8139-pio-oqo2.patch ---
The OQO model 2 has an RTL8139 from Atheros that doesn't like MMIO.
Force it to always use polled IO.

Signed-off-by: Dave Jones <davej at redhat.com>

--- linux-2.6.25.noarch/drivers/net/8139too.c~	2008-05-28 21:07:36.000000000 -0400
+++ linux-2.6.25.noarch/drivers/net/8139too.c	2008-05-28 21:19:57.000000000 -0400
@@ -951,6 +951,14 @@ static int __devinit rtl8139_init_one (s
 			   "Use the \"8139cp\" driver for improved performance and stability.\n");
 	}
 
+	if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
+	    pdev->device == PCI_DEVICE_ID_REALTEK_8139 &&
+	    pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS &&
+	    pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) {
+		printk(KERN_INFO "8139too: OQO Model 2 detected. Forcing PIO\n");
+		use_pio = 1;
+	}
+
 	i = rtl8139_init_board (pdev, &dev);
 	if (i < 0)
 		return i;

linux-2.6-selinux-deffered-context-mapping-no-sleep.patch:

--- NEW FILE linux-2.6-selinux-deffered-context-mapping-no-sleep.patch ---
From: Stephen Smalley <sds at tycho.nsa.gov>
Date: Wed, 14 May 2008 14:33:55 +0000 (-0400)
Subject: SELinux: fix sleeping allocation in security_context_to_sid
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjmorris%2Fselinux-2.6.git;a=commitdiff_plain;h=0bf1adea75e09dccbd3b92c700b72230bf25456d

SELinux: fix sleeping allocation in security_context_to_sid

Fix a sleeping function called from invalid context bug by moving allocation
to the callers prior to taking the policy rdlock.

Signed-off-by:  Stephen Smalley <sds at tycho.nsa.gov>
Signed-off-by: James Morris <jmorris at namei.org>
---

diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index b86ac9d..2d5e5a3 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -730,15 +730,16 @@ int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len)
 	return security_sid_to_context_core(sid, scontext, scontext_len, 1);
 }
 
+/*
+ * Caveat:  Mutates scontext.
+ */
 static int string_to_context_struct(struct policydb *pol,
 				    struct sidtab *sidtabp,
-				    const char *scontext,
+				    char *scontext,
 				    u32 scontext_len,
 				    struct context *ctx,
-				    u32 def_sid,
-				    gfp_t gfp_flags)
+				    u32 def_sid)
 {
-	char *scontext2 = NULL;
 	struct role_datum *role;
 	struct type_datum *typdatum;
 	struct user_datum *usrdatum;
@@ -747,19 +748,10 @@ static int string_to_context_struct(struct policydb *pol,
 
 	context_init(ctx);
 
-	/* Copy the string so that we can modify the copy as we parse it. */
-	scontext2 = kmalloc(scontext_len+1, gfp_flags);
-	if (!scontext2) {
-		rc = -ENOMEM;
-		goto out;
-	}
-	memcpy(scontext2, scontext, scontext_len);
-	scontext2[scontext_len] = 0;
-
 	/* Parse the security context. */
 
 	rc = -EINVAL;
-	scontextp = (char *) scontext2;
+	scontextp = (char *) scontext;
 
 	/* Extract the user. */
 	p = scontextp;
@@ -809,7 +801,7 @@ static int string_to_context_struct(struct policydb *pol,
 	if (rc)
 		goto out;
 
-	if ((p - scontext2) < scontext_len) {
+	if ((p - scontext) < scontext_len) {
 		rc = -EINVAL;
 		goto out;
 	}
@@ -822,7 +814,6 @@ static int string_to_context_struct(struct policydb *pol,
 	}
 	rc = 0;
 out:
-	kfree(scontext2);
 	return rc;
 }
 
@@ -830,6 +821,7 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 					u32 *sid, u32 def_sid, gfp_t gfp_flags,
 					int force)
 {
+	char *scontext2, *str = NULL;
 	struct context context;
 	int rc = 0;
 
@@ -839,27 +831,38 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 		for (i = 1; i < SECINITSID_NUM; i++) {
 			if (!strcmp(initial_sid_to_string[i], scontext)) {
 				*sid = i;
-				goto out;
+				return 0;
 			}
 		}
 		*sid = SECINITSID_KERNEL;
-		goto out;
+		return 0;
 	}
 	*sid = SECSID_NULL;
 
+	/* Copy the string so that we can modify the copy as we parse it. */
+	scontext2 = kmalloc(scontext_len+1, gfp_flags);
+	if (!scontext2)
+		return -ENOMEM;
+	memcpy(scontext2, scontext, scontext_len);
+	scontext2[scontext_len] = 0;
+
+	if (force) {
+		/* Save another copy for storing in uninterpreted form */
+		str = kstrdup(scontext2, gfp_flags);
+		if (!str) {
+			kfree(scontext2);
+			return -ENOMEM;
+		}
+	}
+
 	POLICY_RDLOCK;
 	rc = string_to_context_struct(&policydb, &sidtab,
-				      scontext, scontext_len,
-				      &context, def_sid, gfp_flags);
+				      scontext2, scontext_len,
+				      &context, def_sid);
 	if (rc == -EINVAL && force) {
-		context.str = kmalloc(scontext_len+1, gfp_flags);
-		if (!context.str) {
-			rc = -ENOMEM;
-			goto out;
-		}
-		memcpy(context.str, scontext, scontext_len);
-		context.str[scontext_len] = 0;
+		context.str = str;
 		context.len = scontext_len;
+		str = NULL;
 	} else if (rc)
 		goto out;
 	rc = sidtab_context_to_sid(&sidtab, &context, sid);
@@ -867,6 +870,8 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 		context_destroy(&context);
 out:
 	POLICY_RDUNLOCK;
+	kfree(scontext2);
+	kfree(str);
 	return rc;
 }
 
@@ -1339,9 +1344,14 @@ static int convert_context(u32 key,
 
 	if (c->str) {
 		struct context ctx;
-		rc = string_to_context_struct(args->newp, NULL, c->str,
-					      c->len, &ctx, SECSID_NULL,
-					      GFP_KERNEL);
+		s = kstrdup(c->str, GFP_KERNEL);
+		if (!s) {
+			rc = -ENOMEM;
+			goto out;
+		}
+		rc = string_to_context_struct(args->newp, NULL, s,
+					      c->len, &ctx, SECSID_NULL);
+		kfree(s);
 		if (!rc) {
 			printk(KERN_INFO
 		       "SELinux:  Context %s became valid (mapped).\n",

linux-2.6-selinux-deffered-context-mapping.patch:

--- NEW FILE linux-2.6-selinux-deffered-context-mapping.patch ---
From: Stephen Smalley <sds at tycho.nsa.gov>
Date: Wed, 7 May 2008 17:03:20 +0000 (-0400)
Subject: selinux: support deferred mapping of contexts
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjmorris%2Fselinux-2.6.git;a=commitdiff_plain;h=32be3351abdc2a073d98d40029ae3e126287e736

selinux: support deferred mapping of contexts

Introduce SELinux support for deferred mapping of security contexts in
the SID table upon policy reload, and use this support for inode
security contexts when the context is not yet valid under the current
policy.  Only processes with CAP_MAC_ADMIN + mac_admin permission in
policy can set undefined security contexts on inodes.  Inodes with
such undefined contexts are treated as having the unlabeled context
until the context becomes valid upon a policy reload that defines the
context.  Context invalidation upon policy reload also uses this
support to save the context information in the SID table and later
recover it upon a subsequent policy reload that defines the context
again.

This support is to enable package managers and similar programs to set
down file contexts unknown to the system policy at the time the file
is created in order to better support placing loadable policy modules
in packages and to support build systems that need to create images of
different distro releases with different policies w/o requiring all of
the contexts to be defined or legal in the build host policy.

With this patch applied, the following sequence is possible, although
in practice it is recommended that this permission only be allowed to
specific program domains such as the package manager.

# rmdir baz
# rm bar
# touch bar
# chcon -t foo_exec_t bar # foo_exec_t is not yet defined
chcon: failed to change context of `bar' to `system_u:object_r:foo_exec_t': Invalid argument
# mkdir -Z system_u:object_r:foo_exec_t baz
mkdir: failed to set default file creation context to `system_u:object_r:foo_exec_t': Invalid argument
# cat setundefined.te
policy_module(setundefined, 1.0)
require {
	type unconfined_t;
	type unlabeled_t;
}
files_type(unlabeled_t)
allow unconfined_t self:capability2 mac_admin;
# make -f /usr/share/selinux/devel/Makefile setundefined.pp
# semodule -i setundefined.pp
# chcon -t foo_exec_t bar # foo_exec_t is not yet defined
# mkdir -Z system_u:object_r:foo_exec_t baz
# ls -Zd bar baz
-rw-r--r--  root root system_u:object_r:unlabeled_t    bar
drwxr-xr-x  root root system_u:object_r:unlabeled_t    baz
# cat foo.te
policy_module(foo, 1.0)
type foo_exec_t;
files_type(foo_exec_t)
# make -f /usr/share/selinux/devel/Makefile foo.pp
# semodule -i foo.pp # defines foo_exec_t
# ls -Zd bar baz
-rw-r--r--  root root user_u:object_r:foo_exec_t       bar
drwxr-xr-x  root root system_u:object_r:foo_exec_t    baz
# semodule -r foo
# ls -Zd bar baz
-rw-r--r--  root root system_u:object_r:unlabeled_t    bar
drwxr-xr-x  root root system_u:object_r:unlabeled_t    baz
# semodule -i foo.pp
# ls -Zd bar baz
-rw-r--r--  root root user_u:object_r:foo_exec_t       bar
drwxr-xr-x  root root system_u:object_r:foo_exec_t    baz
# semodule -r setundefined foo
# chcon -t foo_exec_t bar # no longer defined and not allowed
chcon: failed to change context of `bar' to `system_u:object_r:foo_exec_t': Invalid argument
# rmdir baz
# mkdir -Z system_u:object_r:foo_exec_t baz
mkdir: failed to set default file creation context to `system_u:object_r:foo_exec_t': Invalid argument

Signed-off-by: Stephen Smalley <sds at tycho.nsa.gov>
Signed-off-by: James Morris <jmorris at namei.org>
---

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 1c864c0..59c6e98 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2495,7 +2495,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
 	}
 
 	if (value && len) {
-		rc = security_sid_to_context(newsid, &context, &clen);
+		rc = security_sid_to_context_force(newsid, &context, &clen);
 		if (rc) {
 			kfree(namep);
 			return rc;
@@ -2669,6 +2669,11 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name,
 		return rc;
 
 	rc = security_context_to_sid(value, size, &newsid);
+	if (rc == -EINVAL) {
+		if (!capable(CAP_MAC_ADMIN))
+			return rc;
+		rc = security_context_to_sid_force(value, size, &newsid);
+	}
 	if (rc)
 		return rc;
 
@@ -2703,10 +2708,11 @@ static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name,
 		return;
 	}
 
-	rc = security_context_to_sid(value, size, &newsid);
+	rc = security_context_to_sid_force(value, size, &newsid);
 	if (rc) {
-		printk(KERN_WARNING "%s:  unable to obtain SID for context "
-		       "%s, rc=%d\n", __func__, (char *)value, -rc);
+		printk(KERN_ERR "SELinux:  unable to map context to SID"
+		       "for (%s, %lu), rc=%d\n",
+		       inode->i_sb->s_id, inode->i_ino, -rc);
 		return;
 	}
 
@@ -5153,6 +5159,12 @@ static int selinux_setprocattr(struct task_struct *p,
 			size--;
 		}
 		error = security_context_to_sid(value, size, &sid);
+		if (error == -EINVAL && !strcmp(name, "fscreate")) {
+			if (!capable(CAP_MAC_ADMIN))
+				return error;
+			error = security_context_to_sid_force(value, size,
+							      &sid);
+		}
 		if (error)
 			return error;
 	}
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index ad30ac4..7c54300 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -93,12 +93,17 @@ int security_change_sid(u32 ssid, u32 tsid,
 int security_sid_to_context(u32 sid, char **scontext,
 	u32 *scontext_len);
 
+int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len);
+
 int security_context_to_sid(const char *scontext, u32 scontext_len,
 	u32 *out_sid);
 
 int security_context_to_sid_default(const char *scontext, u32 scontext_len,
 				    u32 *out_sid, u32 def_sid, gfp_t gfp_flags);
 
+int security_context_to_sid_force(const char *scontext, u32 scontext_len,
+				  u32 *sid);
+
 int security_get_user_sids(u32 callsid, char *username,
 			   u32 **sids, u32 *nel);
 
diff --git a/security/selinux/ss/context.h b/security/selinux/ss/context.h
index b9a6f7f..658c2bd 100644
--- a/security/selinux/ss/context.h
+++ b/security/selinux/ss/context.h
@@ -28,6 +28,8 @@ struct context {
 	u32 role;
 	u32 type;
 	struct mls_range range;
+	char *str;	/* string representation if context cannot be mapped. */
+	u32 len;        /* length of string in bytes */
 };
 
 static inline void mls_context_init(struct context *c)
@@ -106,20 +108,43 @@ static inline void context_init(struct context *c)
 
 static inline int context_cpy(struct context *dst, struct context *src)
 {
+	int rc;
+
 	dst->user = src->user;
 	dst->role = src->role;
 	dst->type = src->type;
-	return mls_context_cpy(dst, src);
+	if (src->str) {
+		dst->str = kstrdup(src->str, GFP_ATOMIC);
+		if (!dst->str)
+			return -ENOMEM;
+		dst->len = src->len;
+	} else {
+		dst->str = NULL;
+		dst->len = 0;
+	}
+	rc = mls_context_cpy(dst, src);
+	if (rc) {
+		kfree(dst->str);
+		return rc;
+	}
+	return 0;
 }
 
 static inline void context_destroy(struct context *c)
 {
 	c->user = c->role = c->type = 0;
+	kfree(c->str);
+	c->str = NULL;
+	c->len = 0;
 	mls_context_destroy(c);
 }
 
 static inline int context_cmp(struct context *c1, struct context *c2)
 {
+	if (c1->len && c2->len)
+		return (c1->len == c2->len && !strcmp(c1->str, c2->str));
+	if (c1->len || c2->len)
+		return 0;
 	return ((c1->user == c2->user) &&
 		(c1->role == c2->role) &&
 		(c1->type == c2->type) &&
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index 8b1706b..a6ca058 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -239,7 +239,8 @@ int mls_context_isvalid(struct policydb *p, struct context *c)
  * Policy read-lock must be held for sidtab lookup.
  *
  */
-int mls_context_to_sid(char oldc,
+int mls_context_to_sid(struct policydb *pol,
+		       char oldc,
 		       char **scontext,
 		       struct context *context,
 		       struct sidtab *s,
@@ -286,7 +287,7 @@ int mls_context_to_sid(char oldc,
 		*p++ = 0;
 
 	for (l = 0; l < 2; l++) {
-		levdatum = hashtab_search(policydb.p_levels.table, scontextp);
+		levdatum = hashtab_search(pol->p_levels.table, scontextp);
 		if (!levdatum) {
 			rc = -EINVAL;
 			goto out;
@@ -311,7 +312,7 @@ int mls_context_to_sid(char oldc,
 					*rngptr++ = 0;
 				}
 
-				catdatum = hashtab_search(policydb.p_cats.table,
+				catdatum = hashtab_search(pol->p_cats.table,
 							  scontextp);
 				if (!catdatum) {
 					rc = -EINVAL;
@@ -327,7 +328,7 @@ int mls_context_to_sid(char oldc,
 				if (rngptr) {
 					int i;
 
-					rngdatum = hashtab_search(policydb.p_cats.table, rngptr);
+					rngdatum = hashtab_search(pol->p_cats.table, rngptr);
 					if (!rngdatum) {
 						rc = -EINVAL;
 						goto out;
@@ -395,7 +396,7 @@ int mls_from_string(char *str, struct context *context, gfp_t gfp_mask)
 	if (!tmpstr) {
 		rc = -ENOMEM;
 	} else {
-		rc = mls_context_to_sid(':', &tmpstr, context,
+		rc = mls_context_to_sid(&policydb, ':', &tmpstr, context,
 					NULL, SECSID_NULL);
 		kfree(freestr);
 	}
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h
index 0fdf625..1276715 100644
--- a/security/selinux/ss/mls.h
+++ b/security/selinux/ss/mls.h
@@ -30,7 +30,8 @@ int mls_context_isvalid(struct policydb *p, struct context *c);
 int mls_range_isvalid(struct policydb *p, struct mls_range *r);
 int mls_level_isvalid(struct policydb *p, struct mls_level *l);
 
-int mls_context_to_sid(char oldc,
+int mls_context_to_sid(struct policydb *p,
+		       char oldc,
 		       char **scontext,
 		       struct context *context,
 		       struct sidtab *s,
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index dcc2e1c..b86ac9d 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -616,6 +616,14 @@ static int context_struct_to_string(struct context *context, char **scontext, u3
 	*scontext = NULL;
 	*scontext_len = 0;
 
+	if (context->len) {
+		*scontext_len = context->len;
+		*scontext = kstrdup(context->str, GFP_ATOMIC);
+		if (!(*scontext))
+			return -ENOMEM;
+		return 0;
+	}
+
 	/* Compute the size of the context. */
 	*scontext_len += strlen(policydb.p_user_val_to_name[context->user - 1]) + 1;
 	*scontext_len += strlen(policydb.p_role_val_to_name[context->role - 1]) + 1;
@@ -655,17 +663,8 @@ const char *security_get_initial_sid_context(u32 sid)
 	return initial_sid_to_string[sid];
 }
 
-/**
- * security_sid_to_context - Obtain a context for a given SID.
- * @sid: security identifier, SID
- * @scontext: security context
- * @scontext_len: length in bytes
- *
- * Write the string representation of the context associated with @sid
- * into a dynamically allocated string of the correct size.  Set @scontext
- * to point to this string and set @scontext_len to the length of the string.
- */
-int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
+static int security_sid_to_context_core(u32 sid, char **scontext,
+					u32 *scontext_len, int force)
 {
 	struct context *context;
 	int rc = 0;
@@ -693,7 +692,10 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
 		goto out;
 	}
 	POLICY_RDLOCK;
-	context = sidtab_search(&sidtab, sid);
+	if (force)
+		context = sidtab_search_force(&sidtab, sid);
+	else
+		context = sidtab_search(&sidtab, sid);
 	if (!context) {
 		printk(KERN_ERR "SELinux: %s:  unrecognized SID %d\n",
 			__func__, sid);
@@ -708,36 +710,44 @@ out:
 
 }
 
-static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
-					u32 *sid, u32 def_sid, gfp_t gfp_flags)
+/**
+ * security_sid_to_context - Obtain a context for a given SID.
+ * @sid: security identifier, SID
+ * @scontext: security context
+ * @scontext_len: length in bytes
+ *
+ * Write the string representation of the context associated with @sid
+ * into a dynamically allocated string of the correct size.  Set @scontext
+ * to point to this string and set @scontext_len to the length of the string.
+ */
+int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
 {
-	char *scontext2;
-	struct context context;
+	return security_sid_to_context_core(sid, scontext, scontext_len, 0);
+}
+
+int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len)
+{
+	return security_sid_to_context_core(sid, scontext, scontext_len, 1);
+}
+
+static int string_to_context_struct(struct policydb *pol,
+				    struct sidtab *sidtabp,
+				    const char *scontext,
+				    u32 scontext_len,
+				    struct context *ctx,
+				    u32 def_sid,
+				    gfp_t gfp_flags)
+{
+	char *scontext2 = NULL;
 	struct role_datum *role;
 	struct type_datum *typdatum;
 	struct user_datum *usrdatum;
 	char *scontextp, *p, oldc;
 	int rc = 0;
 
-	if (!ss_initialized) {
-		int i;
+	context_init(ctx);
 
-		for (i = 1; i < SECINITSID_NUM; i++) {
-			if (!strcmp(initial_sid_to_string[i], scontext)) {
-				*sid = i;
-				goto out;
-			}
-		}
-		*sid = SECINITSID_KERNEL;
-		goto out;
-	}
-	*sid = SECSID_NULL;
-
-	/* Copy the string so that we can modify the copy as we parse it.
-	   The string should already by null terminated, but we append a
-	   null suffix to the copy to avoid problems with the existing
-	   attr package, which doesn't view the null terminator as part
-	   of the attribute value. */
+	/* Copy the string so that we can modify the copy as we parse it. */
 	scontext2 = kmalloc(scontext_len+1, gfp_flags);
 	if (!scontext2) {
 		rc = -ENOMEM;
@@ -746,11 +756,6 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 	memcpy(scontext2, scontext, scontext_len);
 	scontext2[scontext_len] = 0;
 
-	context_init(&context);
-	*sid = SECSID_NULL;
-
-	POLICY_RDLOCK;
-
 	/* Parse the security context. */
 
 	rc = -EINVAL;
@@ -762,15 +767,15 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 		p++;
 
 	if (*p == 0)
-		goto out_unlock;
+		goto out;
 
 	*p++ = 0;
 
-	usrdatum = hashtab_search(policydb.p_users.table, scontextp);
+	usrdatum = hashtab_search(pol->p_users.table, scontextp);
 	if (!usrdatum)
-		goto out_unlock;
+		goto out;
 
-	context.user = usrdatum->value;
+	ctx->user = usrdatum->value;
 
 	/* Extract role. */
 	scontextp = p;
@@ -778,14 +783,14 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 		p++;
 
 	if (*p == 0)
-		goto out_unlock;
+		goto out;
 
 	*p++ = 0;
 
-	role = hashtab_search(policydb.p_roles.table, scontextp);
+	role = hashtab_search(pol->p_roles.table, scontextp);
 	if (!role)
-		goto out_unlock;
-	context.role = role->value;
+		goto out;
+	ctx->role = role->value;
 
 	/* Extract type. */
 	scontextp = p;
@@ -794,33 +799,74 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
 	oldc = *p;
 	*p++ = 0;
 
-	typdatum = hashtab_search(policydb.p_types.table, scontextp);
+	typdatum = hashtab_search(pol->p_types.table, scontextp);
 	if (!typdatum)
-		goto out_unlock;
+		goto out;
 
-	context.type = typdatum->value;
+	ctx->type = typdatum->value;
 
-	rc = mls_context_to_sid(oldc, &p, &context, &sidtab, def_sid);
+	rc = mls_context_to_sid(pol, oldc, &p, ctx, sidtabp, def_sid);
 	if (rc)
-		goto out_unlock;
+		goto out;
 
 	if ((p - scontext2) < scontext_len) {
 		rc = -EINVAL;
-		goto out_unlock;
+		goto out;
 	}
 
 	/* Check the validity of the new context. */
-	if (!policydb_context_isvalid(&policydb, &context)) {
+	if (!policydb_context_isvalid(pol, ctx)) {
 		rc = -EINVAL;
-		goto out_unlock;
+		context_destroy(ctx);
+		goto out;
 	}
-	/* Obtain the new sid. */
-	rc = sidtab_context_to_sid(&sidtab, &context, sid);
-out_unlock:
-	POLICY_RDUNLOCK;
-	context_destroy(&context);
+	rc = 0;
+out:
 	kfree(scontext2);
+	return rc;
+}
+
+static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
+					u32 *sid, u32 def_sid, gfp_t gfp_flags,
+					int force)
+{
+	struct context context;
+	int rc = 0;
+
+	if (!ss_initialized) {
+		int i;
+
+		for (i = 1; i < SECINITSID_NUM; i++) {
+			if (!strcmp(initial_sid_to_string[i], scontext)) {
+				*sid = i;
+				goto out;
+			}
+		}
+		*sid = SECINITSID_KERNEL;
+		goto out;
+	}
+	*sid = SECSID_NULL;
+
+	POLICY_RDLOCK;
+	rc = string_to_context_struct(&policydb, &sidtab,
+				      scontext, scontext_len,
+				      &context, def_sid, gfp_flags);
+	if (rc == -EINVAL && force) {
+		context.str = kmalloc(scontext_len+1, gfp_flags);
+		if (!context.str) {
+			rc = -ENOMEM;
+			goto out;
+		}
+		memcpy(context.str, scontext, scontext_len);
+		context.str[scontext_len] = 0;
+		context.len = scontext_len;
+	} else if (rc)
+		goto out;
+	rc = sidtab_context_to_sid(&sidtab, &context, sid);
+	if (rc)
+		context_destroy(&context);
 out:
+	POLICY_RDUNLOCK;
 	return rc;
 }
 
@@ -838,7 +884,7 @@ out:
 int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid)
 {
 	return security_context_to_sid_core(scontext, scontext_len,
-					    sid, SECSID_NULL, GFP_KERNEL);
+					    sid, SECSID_NULL, GFP_KERNEL, 0);
 }
 
 /**
@@ -855,6 +901,7 @@ int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid)
  * The default SID is passed to the MLS layer to be used to allow
  * kernel labeling of the MLS field if the MLS field is not present
  * (for upgrading to MLS without full relabel).
+ * Implicitly forces adding of the context even if it cannot be mapped yet.
  * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient
  * memory is available, or 0 on success.
  */
@@ -862,7 +909,14 @@ int security_context_to_sid_default(const char *scontext, u32 scontext_len,
 				    u32 *sid, u32 def_sid, gfp_t gfp_flags)
 {
 	return security_context_to_sid_core(scontext, scontext_len,
-					    sid, def_sid, gfp_flags);
+					    sid, def_sid, gfp_flags, 1);
+}
+
+int security_context_to_sid_force(const char *scontext, u32 scontext_len,
+				  u32 *sid)
+{
+	return security_context_to_sid_core(scontext, scontext_len,
+					    sid, SECSID_NULL, GFP_KERNEL, 1);
 }
 
 static int compute_sid_handle_invalid_context(
@@ -1246,9 +1300,12 @@ static inline int convert_context_handle_invalid_context(struct context *context
 		char *s;
 		u32 len;
 
-		context_struct_to_string(context, &s, &len);
-		printk(KERN_ERR "SELinux:  context %s is invalid\n", s);
-		kfree(s);
+		if (!context_struct_to_string(context, &s, &len)) {
+			printk(KERN_WARNING
+		       "SELinux:  Context %s would be invalid if enforcing\n",
+			       s);
+			kfree(s);
+		}
 	}
 	return rc;
 }
@@ -1280,6 +1337,32 @@ static int convert_context(u32 key,
 
 	args = p;
 
+	if (c->str) {
+		struct context ctx;
+		rc = string_to_context_struct(args->newp, NULL, c->str,
+					      c->len, &ctx, SECSID_NULL,
+					      GFP_KERNEL);
+		if (!rc) {
+			printk(KERN_INFO
+		       "SELinux:  Context %s became valid (mapped).\n",
+			       c->str);
+			/* Replace string with mapped representation. */
+			kfree(c->str);
+			memcpy(c, &ctx, sizeof(*c));
+			goto out;
+		} else if (rc == -EINVAL) {
+			/* Retain string representation for later mapping. */
+			rc = 0;
+			goto out;
+		} else {
+			/* Other error condition, e.g. ENOMEM. */
+			printk(KERN_ERR
+		       "SELinux:   Unable to map context %s, rc = %d.\n",
+			       c->str, -rc);
+			goto out;
+		}
+	}
+
 	rc = context_cpy(&oldc, c);
 	if (rc)
 		goto out;
@@ -1319,13 +1402,21 @@ static int convert_context(u32 key,
 	}
 
 	context_destroy(&oldc);
+	rc = 0;
 out:
 	return rc;
 bad:
-	context_struct_to_string(&oldc, &s, &len);
+	/* Map old representation to string and save it. */
+	if (context_struct_to_string(&oldc, &s, &len))
+		return -ENOMEM;
 	context_destroy(&oldc);
-	printk(KERN_ERR "SELinux:  invalidating context %s\n", s);
-	kfree(s);
+	context_destroy(c);
+	c->str = s;
+	c->len = len;
+	printk(KERN_INFO
+	       "SELinux:  Context %s became invalid (unmapped).\n",
+	       c->str);
+	rc = 0;
 	goto out;
 }
 
@@ -1406,7 +1497,11 @@ int security_load_policy(void *data, size_t len)
 		return -EINVAL;
 	}
 
-	sidtab_init(&newsidtab);
+	if (sidtab_init(&newsidtab)) {
+		LOAD_UNLOCK;
+		policydb_destroy(&newpolicydb);
+		return -ENOMEM;
+	}
 
 	/* Verify that the kernel defined classes are correct. */
 	if (validate_classes(&newpolicydb)) {
@@ -1429,11 +1524,15 @@ int security_load_policy(void *data, size_t len)
 		goto err;
 	}
 
-	/* Convert the internal representations of contexts
-	   in the new SID table and remove invalid SIDs. */
+	/*
+	 * Convert the internal representations of contexts
+	 * in the new SID table.
+	 */
 	args.oldp = &policydb;
 	args.newp = &newpolicydb;
-	sidtab_map_remove_on_error(&newsidtab, convert_context, &args);
+	rc = sidtab_map(&newsidtab, convert_context, &args);
+	if (rc)
+		goto err;
 
 	/* Save the old policydb and SID table to free later. */
 	memcpy(&oldpolicydb, &policydb, sizeof policydb);
@@ -1673,6 +1772,8 @@ int security_get_user_sids(u32 fromsid,
 
 	POLICY_RDLOCK;
 
+	context_init(&usercon);
+
 	fromcon = sidtab_search(&sidtab, fromsid);
 	if (!fromcon) {
 		rc = -EINVAL;
diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c
index 4a516ff..ba35416 100644
--- a/security/selinux/ss/sidtab.c
+++ b/security/selinux/ss/sidtab.c
@@ -86,7 +86,7 @@ out:
 	return rc;
 }
 
-struct context *sidtab_search(struct sidtab *s, u32 sid)
+static struct context *sidtab_search_core(struct sidtab *s, u32 sid, int force)
 {
 	int hvalue;
 	struct sidtab_node *cur;
@@ -99,7 +99,10 @@ struct context *sidtab_search(struct sidtab *s, u32 sid)
 	while (cur != NULL && sid > cur->sid)
 		cur = cur->next;
 
-	if (cur == NULL || sid != cur->sid) {
+	if (force && cur && sid == cur->sid && cur->context.len)
+		return &cur->context;
+
+	if (cur == NULL || sid != cur->sid || cur->context.len) {
 		/* Remap invalid SIDs to the unlabeled SID. */
 		sid = SECINITSID_UNLABELED;
 		hvalue = SIDTAB_HASH(sid);
@@ -113,6 +116,16 @@ struct context *sidtab_search(struct sidtab *s, u32 sid)
 	return &cur->context;
 }
 
+struct context *sidtab_search(struct sidtab *s, u32 sid)
+{
+	return sidtab_search_core(s, sid, 0);
+}
+
+struct context *sidtab_search_force(struct sidtab *s, u32 sid)
+{
+	return sidtab_search_core(s, sid, 1);
+}
+
 int sidtab_map(struct sidtab *s,
 	       int (*apply) (u32 sid,
 			     struct context *context,
@@ -138,43 +151,6 @@ out:
 	return rc;
 }
 
-void sidtab_map_remove_on_error(struct sidtab *s,
-				int (*apply) (u32 sid,
-					      struct context *context,
-					      void *args),
-				void *args)
-{
-	int i, ret;
-	struct sidtab_node *last, *cur, *temp;
-
-	if (!s)
-		return;
-
-	for (i = 0; i < SIDTAB_SIZE; i++) {
-		last = NULL;
-		cur = s->htable[i];
-		while (cur != NULL) {
-			ret = apply(cur->sid, &cur->context, args);
-			if (ret) {
-				if (last)
-					last->next = cur->next;
-				else
-					s->htable[i] = cur->next;
-				temp = cur;
-				cur = cur->next;
-				context_destroy(&temp->context);
-				kfree(temp);
-				s->nel--;
-			} else {
-				last = cur;
-				cur = cur->next;
-			}
-		}
-	}
-
-	return;
-}
-
 static inline u32 sidtab_search_context(struct sidtab *s,
 						  struct context *context)
 {
@@ -215,6 +191,10 @@ int sidtab_context_to_sid(struct sidtab *s,
 			goto unlock_out;
 		}
 		sid = s->next_sid++;
+		if (context->len)
+			printk(KERN_INFO
+		       "SELinux:  Context %s is not valid (left unmapped).\n",
+			       context->str);
 		ret = sidtab_insert(s, sid, context);
 		if (ret)
 			s->next_sid--;
diff --git a/security/selinux/ss/sidtab.h b/security/selinux/ss/sidtab.h
index 2fe9dfa..64ea5b1 100644
--- a/security/selinux/ss/sidtab.h
+++ b/security/selinux/ss/sidtab.h
@@ -32,6 +32,7 @@ struct sidtab {
 int sidtab_init(struct sidtab *s);
 int sidtab_insert(struct sidtab *s, u32 sid, struct context *context);
 struct context *sidtab_search(struct sidtab *s, u32 sid);
+struct context *sidtab_search_force(struct sidtab *s, u32 sid);
 
 int sidtab_map(struct sidtab *s,
 	       int (*apply) (u32 sid,
@@ -39,12 +40,6 @@ int sidtab_map(struct sidtab *s,
 			     void *args),
 	       void *args);
 
-void sidtab_map_remove_on_error(struct sidtab *s,
-				int (*apply) (u32 sid,
-					      struct context *context,
-					      void *args),
-				void *args);
-
 int sidtab_context_to_sid(struct sidtab *s,
 			  struct context *context,
 			  u32 *sid);

linux-2.6-selinux-generic-ioctl.patch:

--- NEW FILE linux-2.6-selinux-generic-ioctl.patch ---
From: Stephen Smalley <sds at tycho.nsa.gov>

This is an RFC for changing the SELinux ioctl checking.  There have been
prior discussions and patches for this in the past, but they've never
been brought to conclusion.  This does yield a change in behavior, but
I'm hoping to avoid having to introduce yet another policy capability or
compatibility knob for it unless we find that it actually yields
breakage with existing policies.  I was able to boot and login with this
patch applied without any denials, both as an unconfined_u user and as a
user_u user.  

A few comments on the patch:
1) It completely removes all knowledge of individual ioctl commands.
Alternatively, we could retain specific knowledge of the vfs layer
generic ioctl commands while dropping the specific driver and filesystem
ioctl commands (which represent a layering/encapsulation violation
presently).  But I'm not sure we want to deal with tracking any
individual ioctls vs. just using the IOC_DIR for everything.

2) It uses read vs. write permissions rather than getattr vs. setattr
permissions.  With the prior patches, we found that mapping IOC_WRITE to
SETATTR caused real breakage with existing policies as we tend to be
stingy with setattr permission in policy to specifically limit
chmod/chown and friends, and not everything marked with IOC_WRITE truly
corresponds to a SETATTR.  If we feel we need SETATTR checking on
specific ioctl commands, then I think we need to introduce
security_inode_setattr() hook calls in the corresponding driver and/or
filesystem code rather than trying to catch them here since we are
otherwise violating layering.

3) It removes ext2-specific handling that is a legacy of the original
SELinux kernel patches that was never updated to cover ext3 ioctls.  Yet
another reason for doing it the general way instead.

4) It removes the special checking of KDSKBENT/KDSKBSENT that was
introduced into SELinux a long time ago.  I believe that checking
CAP_SYS_TTY_CONFIG was added to the vt code (see
drivers/char/vt_ioctl.c) a while back for those ioctls, such that the
SELinux check is now redundant.  Also another example of a layering
violation.

5) If the ioctl command access mode bits are clear, then it still falls
through to checking the IOCTL permission. So all operations remain
mediated.

Review and wider testing requested.

---<snip>---

Simplify and improve the robustness of the SELinux ioctl checking by 
using the "access mode" bits of the ioctl command to determine the 
permission check rather than dealing with individual command values.
This removes any knowledge of specific ioctl commands from SELinux
and follows the same guidance we gave to Smack earlier.

---

 security/selinux/hooks.c |   48 +++++++----------------------------------------
 1 file changed, 8 insertions(+), 40 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 59c6e98..88ddb46 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -42,9 +42,7 @@
 #include <linux/fdtable.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
-#include <linux/ext2_fs.h>
 #include <linux/proc_fs.h>
-#include <linux/kd.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_ipv6.h>
 #include <linux/tty.h>
@@ -2871,46 +2869,16 @@ static void selinux_file_free_security(struct file *file)
 static int selinux_file_ioctl(struct file *file, unsigned int cmd,
 			      unsigned long arg)
 {
-	int error = 0;
-
-	switch (cmd) {
-	case FIONREAD:
-	/* fall through */
-	case FIBMAP:
-	/* fall through */
-	case FIGETBSZ:
-	/* fall through */
-	case EXT2_IOC_GETFLAGS:
-	/* fall through */
-	case EXT2_IOC_GETVERSION:
-		error = file_has_perm(current, file, FILE__GETATTR);
-		break;
-
-	case EXT2_IOC_SETFLAGS:
-	/* fall through */
-	case EXT2_IOC_SETVERSION:
-		error = file_has_perm(current, file, FILE__SETATTR);
-		break;
-
-	/* sys_ioctl() checks */
-	case FIONBIO:
-	/* fall through */
-	case FIOASYNC:
-		error = file_has_perm(current, file, 0);
-		break;
+	u32 av = 0;
 
-	case KDSKBENT:
-	case KDSKBSENT:
-		error = task_has_capability(current, CAP_SYS_TTY_CONFIG);
-		break;
+	if (_IOC_DIR(cmd) & _IOC_WRITE)
+		av |= FILE__WRITE;
+	if (_IOC_DIR(cmd) & _IOC_READ)
+		av |= FILE__READ;
+	if (!av)
+		av = FILE__IOCTL;
 
-	/* default case assumes that the command will go
-	 * to the file's ioctl() function.
-	 */
-	default:
-		error = file_has_perm(current, file, FILE__IOCTL);
-	}
-	return error;
+	return file_has_perm(current, file, av);
 }
 
 static int file_map_prot_check(struct file *file, unsigned long prot, int shared)

-- 
Stephen Smalley
National Security Agency


linux-2.6-selinux-get-invalid-xattrs.patch:

--- NEW FILE linux-2.6-selinux-get-invalid-xattrs.patch ---
Enable processes with CAP_MAC_ADMIN + mac_admin permission in policy
to get undefined contexts on inodes.  This extends the support for
deferred mapping of security contexts in order to permit restorecon
and similar programs to see the raw file contexts unknown to the
system policy in order to check them.


Signed-off-by: Stephen Smalley <sds at tycho.nsa.gov>

---

 security/selinux/hooks.c |   27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 4be1563..91b666a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2754,9 +2754,7 @@ static int selinux_inode_removexattr(struct dentry *dentry, const char *name)
 }
 
 /*
- * Copy the in-core inode security context value to the user.  If the
- * getxattr() prior to this succeeded, check to see if we need to
- * canonicalize the value to be finally returned to the user.
+ * Copy the inode security context value to the user.
  *
  * Permission check is handled by selinux_inode_getxattr hook.
  */
@@ -2765,12 +2763,33 @@ static int selinux_inode_getsecurity(const struct inode *inode, const char *name
 	u32 size;
 	int error;
 	char *context = NULL;
+	struct task_security_struct *tsec = current->security;
 	struct inode_security_struct *isec = inode->i_security;
 
 	if (strcmp(name, XATTR_SELINUX_SUFFIX))
 		return -EOPNOTSUPP;
 
-	error = security_sid_to_context(isec->sid, &context, &size);
+	/*
+	 * If the caller has CAP_MAC_ADMIN, then get the raw context
+	 * value even if it is not defined by current policy; otherwise,
+	 * use the in-core value under current policy.
+	 * Use the non-auditing forms of the permission checks since
+	 * getxattr may be called by unprivileged processes commonly
+	 * and lack of permission just means that we fall back to the
+	 * in-core context value, not a denial.
+	 */
+	error = secondary_ops->capable(current, CAP_MAC_ADMIN);
+	if (!error)
+		error = avc_has_perm_noaudit(tsec->sid, tsec->sid,
+					     SECCLASS_CAPABILITY2,
+					     CAPABILITY2__MAC_ADMIN,
+					     0,
+					     NULL);
+	if (!error)
+		error = security_sid_to_context_force(isec->sid, &context,
+						      &size);
+	else
+		error = security_sid_to_context(isec->sid, &context, &size);
 	if (error)
 		return error;
 	error = size;

-- 
Stephen Smalley
National Security Agency


linux-2.6-selinux-new-proc-checks.patch:

--- NEW FILE linux-2.6-selinux-new-proc-checks.patch ---
From: Stephen Smalley <sds at tycho.nsa.gov>

Enable security modules to distinguish reading of process state via
proc from full ptrace access by renaming ptrace_may_attach to
ptrace_may_access and adding a mode argument indicating whether only
read access or full attach access is requested.  This allows security
modules to permit access to reading process state without granting
full ptrace access.  The base DAC/capability checking remains unchanged.

Read access to /proc/pid/mem continues to apply a full ptrace attach
check since check_mem_permission() already requires the current task
to already be ptracing the target.  The other ptrace checks within
proc for elements like environ, maps, and fds are changed to pass the
read mode instead of attach.

In the SELinux case, we model such reading of process state as a
reading of a proc file labeled with the target process' label.  This
enables SELinux policy to permit such reading of process state without
permitting control or manipulation of the target process, as there are
a number of cases where programs probe for such information via proc
but do not need to be able to control the target (e.g. procps,
lsof, PolicyKit, ConsoleKit).  At present we have to choose between
allowing full ptrace in policy (more permissive than required/desired)
or breaking functionality (or in some cases just silencing the denials
via dontaudit rules but this can hide genuine attacks).

This version of the patch incorporates comments from Casey Schaufler
(change/replace existing ptrace_may_attach interface, pass access
mode), and Chris Wright (provide greater consistency in the checking).

Note that like their predecessors __ptrace_may_attach and
ptrace_may_attach, the __ptrace_may_access and ptrace_may_access
interfaces use different return value conventions from each other (0
or -errno vs. 1 or 0).  I retained this difference to avoid any
changes to the caller logic but made the difference clearer by
changing the latter interface to return a bool rather than an int and
by adding a comment about it to ptrace.h for any future callers.

Signed-off-by:  Stephen Smalley <sds at tycho.nsa.gov>

---

 fs/proc/base.c             |    9 +++++----
 fs/proc/task_mmu.c         |    8 ++++----
 fs/proc/task_nommu.c       |    2 +-
 include/linux/ptrace.h     |    8 ++++++--
 include/linux/security.h   |   16 +++++++++++-----
 kernel/ptrace.c            |   15 ++++++++-------
 security/commoncap.c       |    3 ++-
 security/dummy.c           |    3 ++-
 security/security.c        |    5 +++--
 security/selinux/hooks.c   |   13 +++++++++++--
 security/smack/smack_lsm.c |    5 +++--
 11 files changed, 56 insertions(+), 31 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 808cbdc..2f92003 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -214,7 +214,7 @@ static int check_mem_permission(struct task_struct *task)
 	 */
 	if (task->parent == current && (task->ptrace & PT_PTRACED) &&
 	    task_is_stopped_or_traced(task) &&
-	    ptrace_may_attach(task))
+	    ptrace_may_access(task, PTRACE_MODE_ATTACH))
 		return 0;
 
 	/*
@@ -232,7 +232,8 @@ struct mm_struct *mm_for_maps(struct task_struct *task)
 	task_lock(task);
 	if (task->mm != mm)
 		goto out;
-	if (task->mm != current->mm && __ptrace_may_attach(task) < 0)
+	if (task->mm != current->mm &&
+	    __ptrace_may_access(task, PTRACE_MODE_READ) < 0)
 		goto out;
 	task_unlock(task);
 	return mm;
@@ -499,7 +500,7 @@ static int proc_fd_access_allowed(struct inode *inode)
 	 */
 	task = get_proc_task(inode);
 	if (task) {
-		allowed = ptrace_may_attach(task);
+		allowed = ptrace_may_access(task, PTRACE_MODE_READ);
 		put_task_struct(task);
 	}
 	return allowed;
@@ -885,7 +886,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
 	if (!task)
 		goto out_no_task;
 
-	if (!ptrace_may_attach(task))
+	if (!ptrace_may_access(task, PTRACE_MODE_READ))
 		goto out;
 
 	ret = -ENOMEM;
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index e2b8e76..c6906e7 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -212,7 +212,7 @@ static int show_map(struct seq_file *m, void *v)
 	dev_t dev = 0;
 	int len;
 
-	if (maps_protect && !ptrace_may_attach(task))
+	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
 		return -EACCES;
 
 	if (file) {
@@ -631,7 +631,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
 		goto out;
 
 	ret = -EACCES;
-	if (!ptrace_may_attach(task))
+	if (!ptrace_may_access(task, PTRACE_MODE_READ))
 		goto out_task;
 
 	ret = -EINVAL;
@@ -669,7 +669,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
 	pm.out = (u64 *)buf;
 	pm.end = (u64 *)(buf + count);
 
-	if (!ptrace_may_attach(task)) {
+	if (!ptrace_may_access(task, PTRACE_MODE_READ)) {
 		ret = -EIO;
 	} else {
 		unsigned long src = *ppos;
@@ -728,7 +728,7 @@ static int show_numa_map_checked(struct seq_file *m, void *v)
 	struct proc_maps_private *priv = m->private;
 	struct task_struct *task = priv->task;
 
-	if (maps_protect && !ptrace_may_attach(task))
+	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
 		return -EACCES;
 
 	return show_numa_map(m, v);
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 4b4f9cc..5d84e71 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -113,7 +113,7 @@ static int show_map(struct seq_file *m, void *_vml)
 	struct proc_maps_private *priv = m->private;
 	struct task_struct *task = priv->task;
 
-	if (maps_protect && !ptrace_may_attach(task))
+	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
 		return -EACCES;
 
 	return nommu_vma_show(m, vml->vma);
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index f98501b..c6f5f9d 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -95,8 +95,12 @@ extern void __ptrace_link(struct task_struct *child,
 			  struct task_struct *new_parent);
 extern void __ptrace_unlink(struct task_struct *child);
 extern void ptrace_untrace(struct task_struct *child);
-extern int ptrace_may_attach(struct task_struct *task);
-extern int __ptrace_may_attach(struct task_struct *task);
+#define PTRACE_MODE_READ   1
+#define PTRACE_MODE_ATTACH 2
+/* Returns 0 on success, -errno on denial. */
+extern int __ptrace_may_access(struct task_struct *task, unsigned int mode);
+/* Returns true on success, false on denial. */
+extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
 
 static inline int ptrace_reparented(struct task_struct *child)
 {
diff --git a/include/linux/security.h b/include/linux/security.h
index 50737c7..62bd80c 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -46,7 +46,8 @@ struct audit_krule;
  */
 extern int cap_capable(struct task_struct *tsk, int cap);
 extern int cap_settime(struct timespec *ts, struct timezone *tz);
-extern int cap_ptrace(struct task_struct *parent, struct task_struct *child);
+extern int cap_ptrace(struct task_struct *parent, struct task_struct *child,
+		      unsigned int mode);
 extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
 extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
 extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -1170,6 +1171,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *	attributes would be changed by the execve.
  *	@parent contains the task_struct structure for parent process.
  *	@child contains the task_struct structure for child process.
+ *	@mode contains the PTRACE_MODE flags indicating the form of access.
  *	Return 0 if permission is granted.
  * @capget:
  *	Get the @effective, @inheritable, and @permitted capability sets for
@@ -1295,7 +1297,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
 struct security_operations {
 	char name[SECURITY_NAME_MAX + 1];
 
-	int (*ptrace) (struct task_struct *parent, struct task_struct *child);
+	int (*ptrace) (struct task_struct *parent, struct task_struct *child,
+		       unsigned int mode);
 	int (*capget) (struct task_struct *target,
 		       kernel_cap_t *effective,
 		       kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -1573,7 +1576,8 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par
 extern void securityfs_remove(struct dentry *dentry);
 
 /* Security operations */
-int security_ptrace(struct task_struct *parent, struct task_struct *child);
+int security_ptrace(struct task_struct *parent, struct task_struct *child,
+		    unsigned int mode);
 int security_capget(struct task_struct *target,
 		    kernel_cap_t *effective,
 		    kernel_cap_t *inheritable,
@@ -1755,9 +1759,11 @@ static inline int security_init(void)
 	return 0;
 }
 
-static inline int security_ptrace(struct task_struct *parent, struct task_struct *child)
+static inline int security_ptrace(struct task_struct *parent,
+				  struct task_struct *child,
+				  unsigned int mode)
 {
-	return cap_ptrace(parent, child);
+	return cap_ptrace(parent, child, mode);
 }
 
 static inline int security_capget(struct task_struct *target,
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 6c19e94..e337390 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -121,7 +121,7 @@ int ptrace_check_attach(struct task_struct *child, int kill)
 	return ret;
 }
 
-int __ptrace_may_attach(struct task_struct *task)
+int __ptrace_may_access(struct task_struct *task, unsigned int mode)
 {
 	/* May we inspect the given task?
 	 * This check is used both for attaching with ptrace
@@ -148,16 +148,16 @@ int __ptrace_may_attach(struct task_struct *task)
 	if (!dumpable && !capable(CAP_SYS_PTRACE))
 		return -EPERM;
 
-	return security_ptrace(current, task);
+	return security_ptrace(current, task, mode);
 }
 
-int ptrace_may_attach(struct task_struct *task)
+bool ptrace_may_access(struct task_struct *task, unsigned int mode)
 {
 	int err;
 	task_lock(task);
-	err = __ptrace_may_attach(task);
+	err = __ptrace_may_access(task, mode);
 	task_unlock(task);
-	return !err;
+	return (!err ? true : false);
 }
 
 int ptrace_attach(struct task_struct *task)
@@ -195,7 +195,7 @@ repeat:
 	/* the same process cannot be attached many times */
 	if (task->ptrace & PT_PTRACED)
 		goto bad;
-	retval = __ptrace_may_attach(task);
+	retval = __ptrace_may_access(task, PTRACE_MODE_ATTACH);
 	if (retval)
 		goto bad;
 
@@ -494,7 +494,8 @@ int ptrace_traceme(void)
 	 */
 	task_lock(current);
 	if (!(current->ptrace & PT_PTRACED)) {
-		ret = security_ptrace(current->parent, current);
+		ret = security_ptrace(current->parent, current,
+				      PTRACE_MODE_ATTACH);
 		/*
 		 * Set the ptrace bit in the process ptrace flags.
 		 */
diff --git a/security/commoncap.c b/security/commoncap.c
index 5edabc7..c53855f 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -63,7 +63,8 @@ int cap_settime(struct timespec *ts, struct timezone *tz)
 	return 0;
 }
 
-int cap_ptrace (struct task_struct *parent, struct task_struct *child)
+int cap_ptrace (struct task_struct *parent, struct task_struct *child,
+		unsigned int mode)
 {
 	/* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */
 	if (!cap_issubset(child->cap_permitted, parent->cap_permitted) &&
diff --git a/security/dummy.c b/security/dummy.c
index f50c6c3..4b7f877 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -30,7 +30,8 @@
 #include <linux/prctl.h>
 #include <linux/securebits.h>
 
-static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
+static int dummy_ptrace (struct task_struct *parent, struct task_struct *child,
+			 unsigned int mode)
 {
 	return 0;
 }
diff --git a/security/security.c b/security/security.c
index 59838a9..c4507ce 100644
--- a/security/security.c
+++ b/security/security.c
@@ -161,9 +161,10 @@ int mod_reg_security(const char *name, struct security_operations *ops)
 
 /* Security operations */
 
-int security_ptrace(struct task_struct *parent, struct task_struct *child)
+int security_ptrace(struct task_struct *parent, struct task_struct *child,
+		    unsigned int mode)
 {
-	return security_ops->ptrace(parent, child);
+	return security_ops->ptrace(parent, child, mode);
 }
 
 int security_capget(struct task_struct *target,
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 59c6e98..2ca9a06 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1682,14 +1682,23 @@ static inline u32 file_to_av(struct file *file)
 
 /* Hook functions begin here. */
 
-static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
+static int selinux_ptrace(struct task_struct *parent,
+			  struct task_struct *child,
+			  unsigned int mode)
 {
 	int rc;
 
-	rc = secondary_ops->ptrace(parent, child);
+	rc = secondary_ops->ptrace(parent, child, mode);
 	if (rc)
 		return rc;
 
+	if (mode == PTRACE_MODE_READ) {
+		struct task_security_struct *tsec = parent->security;
+		struct task_security_struct *csec = child->security;
+		return avc_has_perm(tsec->sid, csec->sid,
+				    SECCLASS_FILE, FILE__READ, NULL);
+	}
+
 	return task_has_perm(parent, child, PROCESS__PTRACE);
 }
 
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index b5c8f92..f2d54bc 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -95,11 +95,12 @@ struct inode_smack *new_inode_smack(char *smack)
  *
  * Do the capability checks, and require read and write.
  */
-static int smack_ptrace(struct task_struct *ptp, struct task_struct *ctp)
+static int smack_ptrace(struct task_struct *ptp, struct task_struct *ctp,
+			unsigned int mode)
 {
 	int rc;
 
-	rc = cap_ptrace(ptp, ctp);
+	rc = cap_ptrace(ptp, ctp, mode);
 	if (rc != 0)
 		return rc;
 

-- 
Stephen Smalley
National Security Agency


linux-2.6-silence-fbcon-logo.patch:

--- NEW FILE linux-2.6-silence-fbcon-logo.patch ---
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 97aff8d..5e230b6 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -674,13 +674,15 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
-	if (logo_lines > vc->vc_bottom) {
-		logo_shown = FBCON_LOGO_CANSHOW;
-		printk(KERN_INFO
-		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
-		logo_shown = FBCON_LOGO_DRAW;
-		vc->vc_top = logo_lines;
+	if (logo_shown != FBCON_LOGO_DONTSHOW) {
+		if (logo_lines > vc->vc_bottom) {
+			logo_shown = FBCON_LOGO_CANSHOW;
+			printk(KERN_INFO
+			       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
+		} else {
+			logo_shown = FBCON_LOGO_DRAW;
+			vc->vc_top = logo_lines;
+		}
 	}
 }
 #endif /* MODULE */
@@ -3604,6 +3606,13 @@ static int __init fb_console_init(void)
 	return 0;
 }
 
+static int __init quiet_logo(char *str)
+{
+	logo_shown = FBCON_LOGO_DONTSHOW;
+}
+
+early_param("quiet", quiet_logo);
+
 module_init(fb_console_init);
 
 #ifdef MODULE

linux-2.6-silence-x86-decompressor.patch:

--- NEW FILE linux-2.6-silence-x86-decompressor.patch ---
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 90456ce..b548379 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -30,6 +30,7 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/boot.h>
+#include <asm/bootparam.h>
 
 /* WARNING!!
  * This code is compiled with -fPIC and it is relocated dynamically
@@ -187,13 +188,9 @@ static void gzip_release(void **);
 /*
  * This is set up by the setup-routine at boot-time
  */
-static unsigned char *real_mode; /* Pointer to real-mode data */
-
-#define RM_EXT_MEM_K   (*(unsigned short *)(real_mode + 0x2))
-#ifndef STANDARD_MEMORY_BIOS_CALL
-#define RM_ALT_MEM_K   (*(unsigned long *)(real_mode + 0x1e0))
-#endif
-#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
+static struct boot_params *real_mode;		/* Pointer to real-mode data */
+#define RM_SCREEN_INFO (real_mode->screen_info)
+static int quiet;
 
 extern unsigned char input_data[];
 extern int input_len;
@@ -395,7 +392,8 @@ static void parse_elf(void *output)
 		return;
 	}
 
-	putstr("Parsing ELF... ");
+	if (!quiet)
+		putstr("Parsing ELF... ");
 
 	phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
 	if (!phdrs)
@@ -423,11 +421,28 @@ static void parse_elf(void *output)
 	}
 }
 
+static const char *strnstr(const char *string, int len, const char *s)
+{
+	int i, j;
+
+	for (i = 0; i < len; i++) {
+		for (j = 0; i + j < len && s[j]; j++)
+			if (string[i + j] != s[j])
+				break;
+		if (s[j] == '\0')
+			return string + i;
+	}
+
+	return NULL;
+}
+
 asmlinkage void decompress_kernel(void *rmode, memptr heap,
 				  unsigned char *input_data,
 				  unsigned long input_len,
 				  unsigned char *output)
 {
+	const char * cmdline;  
+
 	real_mode = rmode;
 
 	if (RM_SCREEN_INFO.orig_video_mode == 7) {
@@ -441,6 +456,10 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
 	lines = RM_SCREEN_INFO.orig_video_lines;
 	cols = RM_SCREEN_INFO.orig_video_cols;
 
+	cmdline = (char *) real_mode->hdr.cmd_line_ptr;
+	if (strnstr(cmdline, real_mode->hdr.cmdline_size, "quiet"))
+		quiet = 1;
+
 	window = output;		/* Output buffer (Normally at 1M) */
 	free_mem_ptr     = heap;	/* Heap */
 	free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
@@ -465,9 +484,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
 #endif
 
 	makecrc();
-	putstr("\nDecompressing Linux... ");
+	if (!quiet)
+		putstr("\nDecompressing Linux... ");
 	gunzip();
 	parse_elf(output);
-	putstr("done.\nBooting the kernel.\n");
+	if (!quiet)
+		putstr("done.\nBooting the kernel.\n");
 	return;
 }

linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch:

--- NEW FILE linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch ---
>From 4665f0ce11ca268c850eb98b57168119f56c0c6f Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru at redhat.com>
Date: Thu, 10 Apr 2008 17:46:39 +0200
Subject: [PATCH] xen: Enable Xen console by default in domU

Without console= arguments on the kernel command line, the first
console to register becomes enabled and the preferred console (the one
behind /dev/console).  This is tty (assuming CONFIG_VT_CONSOLE is
enabled, which it commonly is).

This is okay as long tty is a useful console.  But unless we have the
PV framebuffer, and it is enabled for this domain, tty0 in domU is
merely a dummy.  In that case, we want the preferred console to be the
Xen console hvc0, and we want it without having to fiddle with the
kernel command line.

Even with PV framebuffer enabled, we still want to enable the Xen
console as well.

Problem: when tty registers, we can't yet know whether the PVFB is
enabled.  By the time we can know (xenstore is up), the console setup
game is over.

Enable the Xen console hvc by default, and make it the preferred
console.  Change the preferred console to tty when PVFB probes
successfully, unless we've been given console kernel parameters.

Signed-off-by: Markus Armbruster <armbru at redhat.com>
---
 arch/x86/xen/enlighten.c    |    4 +++-
 drivers/video/xen-fbfront.c |   25 +++++++++++++++++++++++++
 include/linux/console.h     |    2 ++
 kernel/printk.c             |    2 ++
 4 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 042a72d..cd3f067 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1259,8 +1259,10 @@ asmlinkage void __init xen_start_kernel(void)
 		? __pa(xen_start_info->mod_start) : 0;
 	boot_params.hdr.ramdisk_size = xen_start_info->mod_len;
 
-	if (!is_initial_xendomain())
+	if (!is_initial_xendomain()) {
+		add_preferred_console("tty", 0, NULL);
 		add_preferred_console("hvc", 0, NULL);
+	}
 
 	/* Start the world */
 	start_kernel();
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 619a6f8..4e10876 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -18,6 +18,7 @@
  * frame buffer.
  */
 
+#include <linux/console.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/fb.h>
@@ -48,6 +49,7 @@ struct xenfb_info {
 
 static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8;
 
+static void xenfb_make_preferred_console(void);
 static int xenfb_remove(struct xenbus_device *);
 static void xenfb_init_shared_page(struct xenfb_info *);
 static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *);
@@ -348,6 +350,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	if (ret < 0)
 		goto error;
 
+	xenfb_make_preferred_console();
 	return 0;
 
  error_nomem:
@@ -358,6 +361,28 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	return ret;
 }
 
+static __devinit void
+xenfb_make_preferred_console(void)
+{
+	struct console *c;
+
+	if (console_set_on_cmdline)
+		return;
+
+	acquire_console_sem();
+	for (c = console_drivers; c; c = c->next) {
+		if (!strcmp(c->name, "tty") && c->index == 0)
+			break;
+	}
+	release_console_sem();
+	if (c) {
+		unregister_console(c);
+		c->flags |= CON_CONSDEV;
+		c->flags &= ~CON_PRINTBUFFER; /* don't print again */
+		register_console(c);
+	}
+}
+
 static int xenfb_resume(struct xenbus_device *dev)
 {
 	struct xenfb_info *info = dev->dev.driver_data;
diff --git a/include/linux/console.h b/include/linux/console.h
index a4f27fb..248e6e3 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -108,6 +108,8 @@ struct console {
 	struct	 console *next;
 };
 
+extern int console_set_on_cmdline;
+
 extern int add_preferred_console(char *name, int idx, char *options);
 extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
 extern void register_console(struct console *);
diff --git a/kernel/printk.c b/kernel/printk.c
index 8fb01c3..7e454e1 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -121,6 +121,7 @@ struct console_cmdline
 static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
 static int selected_console = -1;
 static int preferred_console = -1;
+int console_set_on_cmdline;
 
 /* Flag: console code may call schedule() */
 static int console_may_schedule;
@@ -890,6 +891,7 @@ static int __init console_setup(char *str)
 	*s = 0;
 
 	__add_preferred_console(buf, idx, options, brl_options);
+	console_set_on_cmdline = 1;
 	return 1;
 }
 __setup("console=", console_setup);
-- 
1.5.4.1


linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch:

--- NEW FILE linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch ---
>From b378d3a2cfd9077b0ad665a3ee2797f8131412e9 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Tue, 19 Feb 2008 15:34:32 +0000
Subject: [PATCH] xen: Add a vmlinuz target

Although patches are in progress to allow Xen boot
a DomU using a bzImage, support for booting a Dom0
using a bzImage is still a ways off.

For now, just add a target to build a gzip-ed ELF
file which Xen can use to boot both Dom0 and DomU.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/Makefile        |    9 +++++++++
 arch/x86/boot/.gitignore |    1 +
 arch/x86/boot/Makefile   |    9 +++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 3cff3c8..17d5784 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -205,6 +205,15 @@ boot := arch/x86/boot
 PHONY += zImage bzImage compressed zlilo bzlilo \
          zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
 
+ifdef CONFIG_XEN
+PHONY += vmlinuz
+all: vmlinuz
+
+vmlinuz: KBUILD_IMAGE := $(boot)/vmlinuz
+vmlinuz: vmlinux
+	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
+endif
+
 # Default kernel to build
 all: bzImage
 
diff --git a/arch/x86/boot/.gitignore b/arch/x86/boot/.gitignore
index 172cf8a..109cf54 100644
--- a/arch/x86/boot/.gitignore
+++ b/arch/x86/boot/.gitignore
@@ -6,3 +6,4 @@ offsets.h
 setup
 setup.bin
 setup.elf
+vmlinuz
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 7ee102f..6edcbff 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -26,6 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
 #RAMDISK := -DRAMDISK=512
 
 targets		:= vmlinux.bin setup.bin setup.elf zImage bzImage
+targets		+= vmlinuz vmlinux-stripped
 subdir-		:= compressed
 
 setup-y		+= a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
@@ -119,6 +120,14 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
 $(obj)/compressed/vmlinux: FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
 
+$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
+	$(call if_changed,gzip)
+	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
+
+$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
+$(obj)/vmlinux-stripped: vmlinux FORCE
+	$(call if_changed,objcopy)
+
 # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
 FDARGS =
 # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
-- 
1.5.4.1


linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch:

--- NEW FILE linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch ---
>From ce5546f1306a16b5b340c3763fd5f37928a92b0d Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 4 Feb 2008 08:30:37 +0000
Subject: [PATCH] xen: Add empty xenctrl module

Add the basic infrastructure for a xenctrl module
which will contain the various kernel interfaces
used by (mainly Dom0) Xen userspace.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/xen/Kconfig         |    7 +++++
 drivers/xen/Makefile         |    2 +
 drivers/xen/xenctrl/Makefile |    4 +++
 drivers/xen/xenctrl/main.c   |   62 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xenctrl/Makefile
 create mode 100644 drivers/xen/xenctrl/main.c

diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index 2e641be..cec759f 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -11,3 +11,10 @@ config XEN
 	  This is the Linux Xen port.  Enabling this will allow the
 	  kernel to boot in a paravirtualized environment under the
 	  Xen hypervisor.
+
+config XENCTRL
+	tristate "Xen's user space control interfaces"
+	depends on XEN && PROC_FS
+	default y if XEN
+	help
+	  This is the /proc/xen interface used by Xen's libxc.
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 37af04f..61bce05 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -2,3 +2,5 @@ obj-y	+= grant-table.o features.o events.o
 obj-y	+= xenbus/
 obj-$(CONFIG_XEN_XENCOMM)	+= xencomm.o
 obj-$(CONFIG_XEN_BALLOON)	+= balloon.o
+
+obj-$(CONFIG_XENCTRL) += xenctrl/
diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
new file mode 100644
index 0000000..1f43a43
--- /dev/null
+++ b/drivers/xen/xenctrl/Makefile
@@ -0,0 +1,4 @@
+obj-$(CONFIG_XENCTRL) += xenctrl.o
+
+xenctrl-objs  =
+xenctrl-objs += main.o
diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
new file mode 100644
index 0000000..2965ceb
--- /dev/null
+++ b/drivers/xen/xenctrl/main.c
@@ -0,0 +1,62 @@
+/******************************************************************************
+ *
+ * main.c
+ *
+ * Xen userspace control interfaces
+ *
+ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/proc_fs.h>
+#include <linux/module.h>
+#include <asm/xen/hypervisor.h>
+
+static int __init xenctrl_init(void)
+{
+	struct proc_dir_entry *dir;
+
+	if (!is_running_on_xen())
+		return -ENODEV;
+
+	dir = proc_mkdir("xen", NULL);
+	if (!dir)
+		return -ENOMEM;
+
+	dir->owner = THIS_MODULE;
+
+	return 0;
+}
+
+static void __exit xenctrl_exit(void)
+{
+	remove_proc_entry("xen", NULL);
+}
+
+module_init(xenctrl_init);
+module_exit(xenctrl_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
-- 
1.5.4.1


linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch:

--- NEW FILE linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch ---
>From 0a85177f7c36ea2979593d4a7e43fd0e90a90ad4 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 4 Feb 2008 09:16:51 +0000
Subject: [PATCH] xen: Add /proc/xen/capabilities

/proc/xen/capabilities is used by the xend init script
to check whether it is running on Dom0.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 drivers/xen/xenctrl/Makefile       |    1 +
 drivers/xen/xenctrl/capabilities.c |   68 ++++++++++++++++++++++++++++++++++++
 drivers/xen/xenctrl/main.c         |   11 ++++++
 drivers/xen/xenctrl/xenctrl.h      |   39 ++++++++++++++++++++
 4 files changed, 119 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xenctrl/capabilities.c
 create mode 100644 drivers/xen/xenctrl/xenctrl.h

diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
index 1f43a43..631f535 100644
--- a/drivers/xen/xenctrl/Makefile
+++ b/drivers/xen/xenctrl/Makefile
@@ -2,3 +2,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
 
 xenctrl-objs  =
 xenctrl-objs += main.o
+xenctrl-objs += capabilities.o
diff --git a/drivers/xen/xenctrl/capabilities.c b/drivers/xen/xenctrl/capabilities.c
new file mode 100644
index 0000000..1ff078a
--- /dev/null
+++ b/drivers/xen/xenctrl/capabilities.c
@@ -0,0 +1,68 @@
+/******************************************************************************
+ *
+ * capabilities.c
+ *
+ * /proc/xen/capabilities
+ *
+ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/proc_fs.h>
+#include <linux/module.h>
+#include <asm/xen/hypervisor.h>
+
+static int capabilities_read(char *page, char **start, off_t off,
+			     int count, int *eof, void *data)
+{
+	int len = 0;
+	*page = 0;
+
+	if (is_initial_xendomain())
+		len = sprintf(page, "control_d\n");
+
+	*eof = 1;
+	return len;
+}
+
+int __init capabilities_create_proc_entry(void)
+{
+	struct proc_dir_entry *entry;
+
+	entry = create_proc_entry("xen/capabilities", 0400, NULL);
+	if (!entry)
+		return -ENOMEM;
+
+	entry->owner = THIS_MODULE;
+	entry->read_proc = capabilities_read;
+
+	return 0;
+}
+
+void __exit capabilities_remove_proc_entry(void)
+{
+	remove_proc_entry("xen/capabilities", NULL);
+}
diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
index 2965ceb..0e42f7e 100644
--- a/drivers/xen/xenctrl/main.c
+++ b/drivers/xen/xenctrl/main.c
@@ -31,6 +31,8 @@
  * IN THE SOFTWARE.
  */
 
+#include "xenctrl.h"
+
 #include <linux/proc_fs.h>
 #include <linux/module.h>
 #include <asm/xen/hypervisor.h>
@@ -38,6 +40,7 @@
 static int __init xenctrl_init(void)
 {
 	struct proc_dir_entry *dir;
+	int ret;
 
 	if (!is_running_on_xen())
 		return -ENODEV;
@@ -48,11 +51,19 @@ static int __init xenctrl_init(void)
 
 	dir->owner = THIS_MODULE;
 
+	ret = capabilities_create_proc_entry();
+	if (ret)
+		goto fail1;
+
 	return 0;
+
+ fail1:	remove_proc_entry("xen", NULL);
+	return ret;
 }
 
 static void __exit xenctrl_exit(void)
 {
+	capabilities_remove_proc_entry();
 	remove_proc_entry("xen", NULL);
 }
 
diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
new file mode 100644
index 0000000..7378dde
--- /dev/null
+++ b/drivers/xen/xenctrl/xenctrl.h
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * xenctl.h
+ * 
+ * Xen userspace control interfaces
+ * 
+ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/init.h>
+
+/*
+ * capabilities.c
+ */
+int capabilities_create_proc_entry(void) __init;
+void capabilities_remove_proc_entry(void) __exit;
-- 
1.5.4.1


linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch:

--- NEW FILE linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch ---
>From 9490bfb8d11c7552c5c54d69d290349bb6e68e00 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 4 Feb 2008 08:24:57 +0000
Subject: [PATCH] xen: Add /proc/xen/privcmd

/proc/xen/privcmd is an ioctl() interface which allows
userspace apps to invoke hypercalls.

There should also be an ioctl (IOCTL_PRIVCMD_MMAP)
which is used to map foreign pages into a processes
address space, but we leave this unimplemented for
now pending further work on foreign page support.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 drivers/xen/xenctrl/Makefile    |    1 +
 drivers/xen/xenctrl/main.c      |    6 +++
 drivers/xen/xenctrl/privcmd.c   |   81 +++++++++++++++++++++++++++++++++++++++
 drivers/xen/xenctrl/xenctrl.h   |    6 +++
 include/asm-x86/xen/hypercall.h |   28 +++++++++++++
 include/xen/sys/privcmd.h       |   79 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 201 insertions(+), 0 deletions(-)
 create mode 100644 drivers/xen/xenctrl/privcmd.c
 create mode 100644 include/xen/sys/privcmd.h

diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
index 631f535..8a706cb 100644
--- a/drivers/xen/xenctrl/Makefile
+++ b/drivers/xen/xenctrl/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
 xenctrl-objs  =
 xenctrl-objs += main.o
 xenctrl-objs += capabilities.o
+xenctrl-objs += privcmd.o
diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
index 0e42f7e..d1fe6ef 100644
--- a/drivers/xen/xenctrl/main.c
+++ b/drivers/xen/xenctrl/main.c
@@ -55,14 +55,20 @@ static int __init xenctrl_init(void)
 	if (ret)
 		goto fail1;
 
+	ret = privcmd_create_proc_entry();
+	if (ret)
+		goto fail2;
+
 	return 0;
 
+ fail2: capabilities_remove_proc_entry();
  fail1:	remove_proc_entry("xen", NULL);
 	return ret;
 }
 
 static void __exit xenctrl_exit(void)
 {
+	privcmd_remove_proc_entry();
 	capabilities_remove_proc_entry();
 	remove_proc_entry("xen", NULL);
 }
diff --git a/drivers/xen/xenctrl/privcmd.c b/drivers/xen/xenctrl/privcmd.c
new file mode 100644
index 0000000..58c4b83
--- /dev/null
+++ b/drivers/xen/xenctrl/privcmd.c
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * privcmd.c
+ * 
+ * Interface to privileged domain-0 commands.
+ * 
+ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/proc_fs.h>
+#include <linux/module.h>
+#include <linux/uaccess.h>
+#include <asm/xen/hypervisor.h>
+#include <xen/sys/privcmd.h>
+
+static long privcmd_ioctl(struct file *file, unsigned int cmd,
+			  unsigned long arg)
+{
+	switch (cmd) {
+	case IOCTL_PRIVCMD_HYPERCALL: {
+		privcmd_hypercall_t cmd;
+  
+		if (copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)))
+			return -EFAULT;
+
+		return privcmd_hypercall(&cmd);
+	}
+
+	case IOCTL_PRIVCMD_MMAP:
+	case IOCTL_PRIVCMD_MMAPBATCH:
+		printk(KERN_WARNING "IOCTL_PRIVCMD_MMAP ioctl not yet implemented\n");
+	default:
+		return -EINVAL;
+	}
+}
+
+static const struct file_operations privcmd_file_ops = {
+	.unlocked_ioctl = privcmd_ioctl,
+};
+
+int __init privcmd_create_proc_entry(void)
+{
+	static struct proc_dir_entry *entry;
+
+	entry = create_proc_entry("xen/privcmd", 0400, NULL);
+	if (!entry)
+		return -ENOMEM;
+
+	entry->owner = THIS_MODULE;
+	entry->proc_fops = &privcmd_file_ops;
+
+	return 0;
+}
+
+void __exit privcmd_remove_proc_entry(void)
+{
+	remove_proc_entry("xen/privcmd", NULL);
+}
diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
index 7378dde..a35209a 100644
--- a/drivers/xen/xenctrl/xenctrl.h
+++ b/drivers/xen/xenctrl/xenctrl.h
@@ -37,3 +37,9 @@
  */
 int capabilities_create_proc_entry(void) __init;
 void capabilities_remove_proc_entry(void) __exit;
+
+/*
+ * privcmd.c
+ */
+int privcmd_create_proc_entry(void) __init;
+void privcmd_remove_proc_entry(void) __exit;
diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index c2ccd99..0ff6e89 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -416,4 +416,32 @@ MULTI_stack_switch(struct multicall_entry *mcl,
 	mcl->args[1] = esp;
 }
 
+#include <xen/sys/privcmd.h>
+
+static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
+{
+	int ret;
+
+	if (hypercall->op >= (PAGE_SIZE >> 5))
+		return -EINVAL;
+
+	__asm__ __volatile__ (
+		"pushl %%ebx; pushl %%ecx; pushl %%edx; "
+		"pushl %%esi; pushl %%edi; "
+		"movl  8(%%eax),%%ebx ;"
+		"movl 16(%%eax),%%ecx ;"
+		"movl 24(%%eax),%%edx ;"
+		"movl 32(%%eax),%%esi ;"
+		"movl 40(%%eax),%%edi ;"
+		"movl   (%%eax),%%eax ;"
+		"shll $5,%%eax ;"
+		"addl $hypercall_page,%%eax ;"
+		"call *%%eax ;"
+		"popl %%edi; popl %%esi; popl %%edx; "
+		"popl %%ecx; popl %%ebx"
+		: "=a" (ret) : "0" (hypercall) : "memory" );
+
+	return ret;
+}
+
 #endif /* __HYPERCALL_H__ */
diff --git a/include/xen/sys/privcmd.h b/include/xen/sys/privcmd.h
new file mode 100644
index 0000000..9cfa9d7
--- /dev/null
+++ b/include/xen/sys/privcmd.h
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * privcmd.h
+ * 
+ * Interface to /proc/xen/privcmd.
+ * 
+ * Copyright (c) 2003-2005, K A Fraser
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __LINUX_PUBLIC_PRIVCMD_H__
+#define __LINUX_PUBLIC_PRIVCMD_H__
+
+#include <linux/types.h>
+
+#ifndef __user
+#define __user
+#endif
+
+typedef struct privcmd_hypercall
+{
+	__u64 op;
+	__u64 arg[5];
+} privcmd_hypercall_t;
+
+typedef struct privcmd_mmap_entry {
+	__u64 va;
+	__u64 mfn;
+	__u64 npages;
+} privcmd_mmap_entry_t; 
+
+typedef struct privcmd_mmap {
+	int num;
+	domid_t dom; /* target domain */
+	privcmd_mmap_entry_t __user *entry;
+} privcmd_mmap_t; 
+
+typedef struct privcmd_mmapbatch {
+	int num;     /* number of pages to populate */
+	domid_t dom; /* target domain */
+	__u64 addr;  /* virtual address */
+	ulong __user *arr; /* array of mfns - top nibble set on err */
+} privcmd_mmapbatch_t; 
+
+/*
+ * @cmd: IOCTL_PRIVCMD_HYPERCALL
+ * @arg: &privcmd_hypercall_t
+ * Return: Value returned from execution of the specified hypercall.
+ */
+#define IOCTL_PRIVCMD_HYPERCALL					\
+	_IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
+#define IOCTL_PRIVCMD_MMAP					\
+	_IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))
+#define IOCTL_PRIVCMD_MMAPBATCH					\
+	_IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
+
+#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
1.5.4.1


linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch:

--- NEW FILE linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch ---
>From b536041e4c7f7b09d8da98dcf82714bf38f02767 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 4 Feb 2008 22:04:36 +0000
Subject: [PATCH] xen: Add /proc/xen/xenbus

This interface is used by userspace programs to talk to
xenstored.

Since xenstored makes itself available to Dom0 userspace
via a socket this should only really be useful in Domu,
but it turns out that Dom0 apps historically default
to using /proc/xen/xenbus rather than the socket.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 drivers/xen/xenbus/xenbus_comms.h |    1 -
 drivers/xen/xenbus/xenbus_probe.c |    2 +
 drivers/xen/xenbus/xenbus_xs.c    |    1 +
 drivers/xen/xenctrl/Makefile      |    1 +
 drivers/xen/xenctrl/main.c        |    6 +
 drivers/xen/xenctrl/xenbus.c      |  398 +++++++++++++++++++++++++++++++++++++
 drivers/xen/xenctrl/xenctrl.h     |    6 +
 include/xen/xenbus.h              |    2 +
 8 files changed, 416 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xenctrl/xenbus.c

diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h
index c21db75..fcc9b29 100644
--- a/drivers/xen/xenbus/xenbus_comms.h
+++ b/drivers/xen/xenbus/xenbus_comms.h
@@ -41,6 +41,5 @@ int xb_data_to_read(void);
 int xb_wait_for_data_to_read(void);
 int xs_input_avail(void);
 extern struct xenstore_domain_interface *xen_store_interface;
-extern int xen_store_evtchn;
 
 #endif /* _XENBUS_COMMS_H */
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 57ceb53..c811581 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -56,6 +56,8 @@
 #include "xenbus_probe.h"
 
 int xen_store_evtchn;
+EXPORT_SYMBOL_GPL(xen_store_evtchn);
+
 struct xenstore_domain_interface *xen_store_interface;
 static unsigned long xen_store_mfn;
 
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 227d53b..810e24a 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -184,6 +184,7 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
 
 	return ret;
 }
+EXPORT_SYMBOL(xenbus_dev_request_and_reply);
 
 /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
 static void *xs_talkv(struct xenbus_transaction t,
diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
index 8a706cb..23dafa3 100644
--- a/drivers/xen/xenctrl/Makefile
+++ b/drivers/xen/xenctrl/Makefile
@@ -4,3 +4,4 @@ xenctrl-objs  =
 xenctrl-objs += main.o
 xenctrl-objs += capabilities.o
 xenctrl-objs += privcmd.o
+xenctrl-objs += xenbus.o
diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
index d1fe6ef..b0cf61b 100644
--- a/drivers/xen/xenctrl/main.c
+++ b/drivers/xen/xenctrl/main.c
@@ -59,8 +59,13 @@ static int __init xenctrl_init(void)
 	if (ret)
 		goto fail2;
 
+	ret = xenbus_create_proc_entry();
+	if (ret)
+		goto fail3;
+
 	return 0;
 
+ fail3: privcmd_remove_proc_entry();
  fail2: capabilities_remove_proc_entry();
  fail1:	remove_proc_entry("xen", NULL);
 	return ret;
@@ -68,6 +73,7 @@ static int __init xenctrl_init(void)
 
 static void __exit xenctrl_exit(void)
 {
+	xenbus_remove_proc_entry();
 	privcmd_remove_proc_entry();
 	capabilities_remove_proc_entry();
 	remove_proc_entry("xen", NULL);
diff --git a/drivers/xen/xenctrl/xenbus.c b/drivers/xen/xenctrl/xenbus.c
new file mode 100644
index 0000000..57d5501
--- /dev/null
+++ b/drivers/xen/xenctrl/xenbus.c
@@ -0,0 +1,398 @@
+/*
+ * xenbus.c
+ * 
+ * /proc/xen/xenbus gives user-space access to the kernel's xenbus
+ * connection to xenstore.
+ * 
+ * Copyright (c) 2005, Christian Limpach
+ * Copyright (c) 2005, Rusty Russell, IBM Corporation
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/proc_fs.h>
+#include <linux/module.h>
+#include <linux/uaccess.h>
+#include <linux/poll.h>
+
+#include <xen/xenbus.h>
+
+struct xenbus_dev_transaction {
+	struct list_head list;
+	struct xenbus_transaction handle;
+};
+
+struct read_buffer {
+	struct list_head list;
+	unsigned int cons;
+	unsigned int len;
+	char msg[];
+};
+
+struct xenbus_dev_data {
+	/* In-progress transaction. */
+	struct list_head transactions;
+
+	/* Active watches. */
+	struct list_head watches;
+
+	/* Partial request. */
+	unsigned int len;
+	union {
+		struct xsd_sockmsg msg;
+		char buffer[PAGE_SIZE];
+	} u;
+
+	/* Response queue. */
+	struct list_head read_buffers;
+	wait_queue_head_t read_waitq;
+
+	struct mutex reply_mutex;
+};
+
+static ssize_t xenbus_dev_read(struct file *filp,
+			       char __user *ubuf,
+			       size_t len, loff_t *ppos)
+{
+	struct xenbus_dev_data *u = filp->private_data;
+	struct read_buffer *rb;
+	int i, ret;
+
+	mutex_lock(&u->reply_mutex);
+	while (list_empty(&u->read_buffers)) {
+		mutex_unlock(&u->reply_mutex);
+		ret = wait_event_interruptible(u->read_waitq,
+					       !list_empty(&u->read_buffers));
+		if (ret)
+			return ret;
+		mutex_lock(&u->reply_mutex);
+	}
+
+	rb = list_entry(u->read_buffers.next, struct read_buffer, list);
+	for (i = 0; i < len;) {
+		put_user(rb->msg[rb->cons], ubuf + i);
+		i++;
+		rb->cons++;
+		if (rb->cons == rb->len) {
+			list_del(&rb->list);
+			kfree(rb);
+			if (list_empty(&u->read_buffers))
+				break;
+			rb = list_entry(u->read_buffers.next,
+					struct read_buffer, list);
+		}
+	}
+	mutex_unlock(&u->reply_mutex);
+
+	return i;
+}
+
+static void queue_reply(struct xenbus_dev_data *u,
+			char *data, unsigned int len)
+{
+	struct read_buffer *rb;
+
+	if (len == 0)
+		return;
+
+	rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL);
+	BUG_ON(rb == NULL);
+
+	rb->cons = 0;
+	rb->len = len;
+
+	memcpy(rb->msg, data, len);
+
+	list_add_tail(&rb->list, &u->read_buffers);
+
+	wake_up(&u->read_waitq);
+}
+
+struct watch_adapter
+{
+	struct list_head list;
+	struct xenbus_watch watch;
+	struct xenbus_dev_data *dev_data;
+	char *token;
+};
+
+static void free_watch_adapter(struct watch_adapter *watch)
+{
+	kfree(watch->watch.node);
+	kfree(watch->token);
+	kfree(watch);
+}
+
+static void watch_fired(struct xenbus_watch *watch,
+			const char **vec,
+			unsigned int len)
+{
+	struct watch_adapter *adap =
+            container_of(watch, struct watch_adapter, watch);
+	struct xsd_sockmsg hdr;
+	const char *path, *token;
+	int path_len, tok_len, body_len;
+
+	path = vec[XS_WATCH_PATH];
+	token = adap->token;
+
+	path_len = strlen(path) + 1;
+	tok_len = strlen(token) + 1;
+	body_len = path_len + tok_len;
+
+	hdr.type = XS_WATCH_EVENT;
+	hdr.len = body_len;
+
+	mutex_lock(&adap->dev_data->reply_mutex);
+	queue_reply(adap->dev_data, (char *)&hdr, sizeof(hdr));
+	queue_reply(adap->dev_data, (char *)path, path_len);
+	queue_reply(adap->dev_data, (char *)token, tok_len);
+	mutex_unlock(&adap->dev_data->reply_mutex);
+}
+
+static LIST_HEAD(watch_list);
+
+static ssize_t xenbus_dev_write(struct file *filp,
+				const char __user *ubuf,
+				size_t len, loff_t *ppos)
+{
+	struct xenbus_dev_data *u = filp->private_data;
+	struct xenbus_dev_transaction *trans = NULL;
+	uint32_t msg_type;
+	void *reply;
+	char *path, *token;
+	struct watch_adapter *watch, *tmp_watch;
+	int err, rc = len;
+
+	if ((len + u->len) > sizeof(u->u.buffer)) {
+		rc = -EINVAL;
+		goto out;
+	}
+
+	if (copy_from_user(u->u.buffer + u->len, ubuf, len) != 0) {
+		rc = -EFAULT;
+		goto out;
+	}
+
+	u->len += len;
+	if ((u->len < sizeof(u->u.msg)) ||
+	    (u->len < (sizeof(u->u.msg) + u->u.msg.len)))
+		return rc;
+
+	msg_type = u->u.msg.type;
+
+	switch (msg_type) {
+	case XS_TRANSACTION_START:
+	case XS_TRANSACTION_END:
+	case XS_DIRECTORY:
+	case XS_READ:
+	case XS_GET_PERMS:
+	case XS_RELEASE:
+	case XS_GET_DOMAIN_PATH:
+	case XS_WRITE:
+	case XS_MKDIR:
+	case XS_RM:
+	case XS_SET_PERMS:
+		if (msg_type == XS_TRANSACTION_START) {
+			trans = kmalloc(sizeof(*trans), GFP_KERNEL);
+			if (!trans) {
+				rc = -ENOMEM;
+				goto out;
+			}
+		}
+
+		reply = xenbus_dev_request_and_reply(&u->u.msg);
+		if (IS_ERR(reply)) {
+			kfree(trans);
+			rc = PTR_ERR(reply);
+			goto out;
+		}
+
+		if (msg_type == XS_TRANSACTION_START) {
+			trans->handle.id = simple_strtoul(reply, NULL, 0);
+			list_add(&trans->list, &u->transactions);
+		} else if (msg_type == XS_TRANSACTION_END) {
+			list_for_each_entry(trans, &u->transactions, list)
+				if (trans->handle.id == u->u.msg.tx_id)
+					break;
+			BUG_ON(&trans->list == &u->transactions);
+			list_del(&trans->list);
+			kfree(trans);
+		}
+		mutex_lock(&u->reply_mutex);
+		queue_reply(u, (char *)&u->u.msg, sizeof(u->u.msg));
+		queue_reply(u, (char *)reply, u->u.msg.len);
+		mutex_unlock(&u->reply_mutex);
+		kfree(reply);
+		break;
+
+	case XS_WATCH:
+	case XS_UNWATCH: {
+		static const char *XS_RESP = "OK";
+		struct xsd_sockmsg hdr;
+
+		path = u->u.buffer + sizeof(u->u.msg);
+		token = memchr(path, 0, u->u.msg.len);
+		if (token == NULL) {
+			rc = -EILSEQ;
+			goto out;
+		}
+		token++;
+
+		if (msg_type == XS_WATCH) {
+			watch = kmalloc(sizeof(*watch), GFP_KERNEL);
+			watch->watch.node = kmalloc(strlen(path)+1,
+                                                    GFP_KERNEL);
+			strcpy((char *)watch->watch.node, path);
+			watch->watch.callback = watch_fired;
+			watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
+			strcpy(watch->token, token);
+			watch->dev_data = u;
+
+			err = register_xenbus_watch(&watch->watch);
+			if (err) {
+				free_watch_adapter(watch);
+				rc = err;
+				goto out;
+			}
+			
+			list_add(&watch->list, &u->watches);
+		} else {
+			list_for_each_entry_safe(watch, tmp_watch,
+                                                 &u->watches, list) {
+				if (!strcmp(watch->token, token) &&
+				    !strcmp(watch->watch.node, path))
+				{
+					unregister_xenbus_watch(&watch->watch);
+					list_del(&watch->list);
+					free_watch_adapter(watch);
+					break;
+				}
+			}
+		}
+
+		hdr.type = msg_type;
+		hdr.len = strlen(XS_RESP) + 1;
+		mutex_lock(&u->reply_mutex);
+		queue_reply(u, (char *)&hdr, sizeof(hdr));
+		queue_reply(u, (char *)XS_RESP, hdr.len);
+		mutex_unlock(&u->reply_mutex);
+		break;
+	}
+
+	default:
+		rc = -EINVAL;
+		break;
+	}
+
+ out:
+	u->len = 0;
+	return rc;
+}
+
+static int xenbus_dev_open(struct inode *inode, struct file *filp)
+{
+	struct xenbus_dev_data *u;
+
+	if (xen_store_evtchn == 0)
+		return -ENOENT;
+
+	nonseekable_open(inode, filp);
+
+	u = kzalloc(sizeof(*u), GFP_KERNEL);
+	if (u == NULL)
+		return -ENOMEM;
+
+	INIT_LIST_HEAD(&u->transactions);
+	INIT_LIST_HEAD(&u->watches);
+	INIT_LIST_HEAD(&u->read_buffers);
+	init_waitqueue_head(&u->read_waitq);
+
+	mutex_init(&u->reply_mutex);
+
+	filp->private_data = u;
+
+	return 0;
+}
+
+static int xenbus_dev_release(struct inode *inode, struct file *filp)
+{
+	struct xenbus_dev_data *u = filp->private_data;
+	struct xenbus_dev_transaction *trans, *tmp;
+	struct watch_adapter *watch, *tmp_watch;
+
+	list_for_each_entry_safe(trans, tmp, &u->transactions, list) {
+		xenbus_transaction_end(trans->handle, 1);
+		list_del(&trans->list);
+		kfree(trans);
+	}
+
+	list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) {
+		unregister_xenbus_watch(&watch->watch);
+		list_del(&watch->list);
+		free_watch_adapter(watch);
+	}
+
+	kfree(u);
+
+	return 0;
+}
+
+static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait)
+{
+	struct xenbus_dev_data *u = file->private_data;
+
+	poll_wait(file, &u->read_waitq, wait);
+	if (!list_empty(&u->read_buffers))
+		return POLLIN | POLLRDNORM;
+	return 0;
+}
+
+static const struct file_operations xenbus_dev_file_ops = {
+	.read = xenbus_dev_read,
+	.write = xenbus_dev_write,
+	.open = xenbus_dev_open,
+	.release = xenbus_dev_release,
+	.poll = xenbus_dev_poll,
+};
+
+int __init xenbus_create_proc_entry(void)
+{
+	struct proc_dir_entry *entry;
+
+	entry = create_proc_entry("xen/xenbus", 0400, NULL);
+	if (!entry)
+		return -ENOMEM;
+
+	entry->owner = THIS_MODULE;
+	entry->proc_fops = &xenbus_dev_file_ops;
+
+	return 0;
+}
+
+void __exit xenbus_remove_proc_entry(void)
+{
+	remove_proc_entry("xen/xenbus", NULL);
+}
diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
index a35209a..e585c4b 100644
--- a/drivers/xen/xenctrl/xenctrl.h
+++ b/drivers/xen/xenctrl/xenctrl.h
@@ -43,3 +43,9 @@ void capabilities_remove_proc_entry(void) __exit;
  */
 int privcmd_create_proc_entry(void) __init;
 void privcmd_remove_proc_entry(void) __exit;
+
+/*
+ * xenbus.c
+ */
+int xenbus_create_proc_entry(void) __init;
+void xenbus_remove_proc_entry(void) __exit;
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 6369d89..a3fef9d 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -232,4 +232,6 @@ const char *xenbus_strstate(enum xenbus_state state);
 int xenbus_dev_is_online(struct xenbus_device *dev);
 int xenbus_frontend_closed(struct xenbus_device *dev);
 
+extern int xen_store_evtchn;
+
 #endif /* _XEN_XENBUS_H */
-- 
1.5.4.1


linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch:

--- NEW FILE linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch ---
>From 3210b9b1536a1223c3dc6a70d11264d42f7ae103 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Thu, 7 Feb 2008 15:32:28 +0000
Subject: [PATCH] xen: Add Xen's /sys/hypervisor interface

Hook up Xen's /sys/hypervisor interface:

  /sys/hypervisor/
    -> type
    -> uuid
    -> compilation
         -> compile_date
         -> compiled_by
         -> compiler
    -> properties
         -> capabilities
         -> changeset
         -> pagesize
         -> virtual_start
         -> writable_pt
    -> version
         -> extra
         -> major
         -> minor

Note: the hypervisor subsys hook requires that
SYS_HYPERVISOR is selected to enabled it, which in
turns means that the subsys will be registered by
a pv-ops kernel with Xen support, even on bare
metal. This hook needs to be changed to be runtime
enabled.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/xen/Kconfig            |    3 +-
 drivers/xen/xenctrl/Makefile    |    1 +
 drivers/xen/xenctrl/main.c      |    6 +
 drivers/xen/xenctrl/sysfs.c     |  349 +++++++++++++++++++++++++++++++++++++++
 drivers/xen/xenctrl/xenctrl.h   |    6 +
 include/xen/interface/version.h |    6 +
 6 files changed, 370 insertions(+), 1 deletions(-)
 create mode 100644 drivers/xen/xenctrl/sysfs.c

diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index cec759f..12622e5 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -14,7 +14,8 @@ config XEN
 
 config XENCTRL
 	tristate "Xen's user space control interfaces"
-	depends on XEN && PROC_FS
+	depends on XEN && PROC_FS && SYSFS
 	default y if XEN
+	select SYS_HYPERVISOR
 	help
 	  This is the /proc/xen interface used by Xen's libxc.
diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
index 23dafa3..e126e76 100644
--- a/drivers/xen/xenctrl/Makefile
+++ b/drivers/xen/xenctrl/Makefile
@@ -5,3 +5,4 @@ xenctrl-objs += main.o
 xenctrl-objs += capabilities.o
 xenctrl-objs += privcmd.o
 xenctrl-objs += xenbus.o
+xenctrl-objs += sysfs.o
diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
index b0cf61b..87d0dba 100644
--- a/drivers/xen/xenctrl/main.c
+++ b/drivers/xen/xenctrl/main.c
@@ -63,8 +63,13 @@ static int __init xenctrl_init(void)
 	if (ret)
 		goto fail3;
 
+	ret = sys_hypervisor_init();
+	if (ret)
+		goto fail4;
+
 	return 0;
 
+ fail4: xenbus_remove_proc_entry();
  fail3: privcmd_remove_proc_entry();
  fail2: capabilities_remove_proc_entry();
  fail1:	remove_proc_entry("xen", NULL);
@@ -73,6 +78,7 @@ static int __init xenctrl_init(void)
 
 static void __exit xenctrl_exit(void)
 {
+	sys_hypervisor_exit();
 	xenbus_remove_proc_entry();
 	privcmd_remove_proc_entry();
 	capabilities_remove_proc_entry();
diff --git a/drivers/xen/xenctrl/sysfs.c b/drivers/xen/xenctrl/sysfs.c
new file mode 100644
index 0000000..8cbf4d6
--- /dev/null
+++ b/drivers/xen/xenctrl/sysfs.c
@@ -0,0 +1,349 @@
+/*
+ *  copyright (c) 2006 IBM Corporation
+ *  Authored by: Mike D. Day <ncmike at us.ibm.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+#include <linux/err.h>
+#include <asm/xen/hypervisor.h>
+#include <xen/xenbus.h>
+#include "xenctrl.h"
+
+#define HYPERVISOR_ATTR_RO(_name) \
+static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
+
+#define HYPERVISOR_ATTR_RW(_name) \
+static struct kobj_attribute _name##_attr = \
+	__ATTR(_name, 0644, _name##_show, _name##_store)
+
+static ssize_t type_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	return sprintf(buffer, "xen\n");
+}
+
+HYPERVISOR_ATTR_RO(type);
+
+static int __init xen_sysfs_type_init(void)
+{
+	return sysfs_create_file(hypervisor_kobj, &type_attr.attr);
+}
+
+static void xen_sysfs_type_destroy(void)
+{
+	sysfs_remove_file(hypervisor_kobj, &type_attr.attr);
+}
+
+static ssize_t major_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	int version;
+
+	version = HYPERVISOR_xen_version(XENVER_version, NULL);
+	if (!version)
+		return -ENODEV;
+
+	return sprintf(buffer, "%d\n", version >> 16);
+}
+
+HYPERVISOR_ATTR_RO(major);
+
+static ssize_t minor_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	int version;
+
+	version = HYPERVISOR_xen_version(XENVER_version, NULL);
+	if (!version)
+		return -ENODEV;
+
+	return sprintf(buffer, "%d\n", version & 0xff);
+}
+
+HYPERVISOR_ATTR_RO(minor);
+
+static ssize_t extra_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	int ret;
+	struct xen_extraversion extra;
+
+	ret = HYPERVISOR_xen_version(XENVER_extraversion, &extra);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%s\n", extra.extraversion);
+}
+
+HYPERVISOR_ATTR_RO(extra);
+
+static struct attribute *version_attrs[] = {
+	&major_attr.attr,
+	&minor_attr.attr,
+	&extra_attr.attr,
+	NULL
+};
+
+static struct attribute_group version_group = {
+	.name = "version",
+	.attrs = version_attrs,
+};
+
+static int __init xen_sysfs_version_init(void)
+{
+	return sysfs_create_group(hypervisor_kobj, &version_group);
+}
+
+static void xen_sysfs_version_destroy(void)
+{
+	sysfs_remove_group(hypervisor_kobj, &version_group);
+}
+
+static ssize_t uuid_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	char *vm, *val;
+	int ret;
+
+	vm = xenbus_read(XBT_NIL, "vm", "", NULL);
+	if (IS_ERR(vm))
+		return PTR_ERR(vm);
+
+	val = xenbus_read(XBT_NIL, vm, "uuid", NULL);
+	if (IS_ERR(val)) {
+		ret = PTR_ERR(val);
+		goto out;
+	}
+
+	ret = sprintf(buffer, "%s\n", val);
+
+	kfree(val);
+out:	kfree(vm);
+
+	return ret;
+}
+
+HYPERVISOR_ATTR_RO(uuid);
+
+static int __init xen_sysfs_uuid_init(void)
+{
+	return sysfs_create_file(hypervisor_kobj, &uuid_attr.attr);
+}
+
+static void xen_sysfs_uuid_destroy(void)
+{
+	sysfs_remove_file(hypervisor_kobj, &uuid_attr.attr);
+}
+
+static ssize_t compiler_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_compile_info info;
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%s\n", info.compiler);
+}
+
+HYPERVISOR_ATTR_RO(compiler);
+
+static ssize_t compiled_by_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_compile_info info;
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%s\n", info.compile_by);
+}
+
+HYPERVISOR_ATTR_RO(compiled_by);
+
+static ssize_t compile_date_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_compile_info info;
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%s\n", info.compile_date);
+}
+
+HYPERVISOR_ATTR_RO(compile_date);
+
+static struct attribute *xen_compile_attrs[] = {
+	&compiler_attr.attr,
+	&compiled_by_attr.attr,
+	&compile_date_attr.attr,
+	NULL
+};
+
+static struct attribute_group xen_compilation_group = {
+	.name = "compilation",
+	.attrs = xen_compile_attrs,
+};
+
+static int __init xen_compilation_init(void)
+{
+	return sysfs_create_group(hypervisor_kobj,
+				  &xen_compilation_group);
+}
+
+static void xen_compilation_destroy(void)
+{
+	sysfs_remove_group(hypervisor_kobj,
+			   &xen_compilation_group);
+}
+
+static ssize_t capabilities_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_capabilities_info *caps;
+	int ret;
+
+	caps = kmalloc(sizeof(struct xen_capabilities_info), GFP_KERNEL);
+	if (!caps)
+		return -ENOMEM;
+
+	ret = HYPERVISOR_xen_version(XENVER_capabilities, caps);
+	if (ret)
+		goto out;
+
+	ret = sprintf(buffer, "%s\n", caps->info);
+
+out:	kfree(caps);
+
+	return ret;
+}
+
+HYPERVISOR_ATTR_RO(capabilities);
+
+static ssize_t changeset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_changeset_info cset;
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_changeset, &cset);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%s\n", cset.info);
+}
+
+HYPERVISOR_ATTR_RO(changeset);
+
+static ssize_t virtual_start_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_platform_parameters parms;
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_platform_parameters, &parms);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%lx\n", parms.virt_start);
+}
+
+HYPERVISOR_ATTR_RO(virtual_start);
+
+static ssize_t pagesize_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	int ret;
+
+	ret = HYPERVISOR_xen_version(XENVER_pagesize, NULL);
+	if (ret < 0)
+		return ret;
+
+	return sprintf(buffer, "%x\n", ret);
+}
+
+HYPERVISOR_ATTR_RO(pagesize);
+
+static ssize_t writable_pt_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
+{
+	struct xen_feature_info info;
+	int ret;
+
+	info.submap_idx = XENFEAT_writable_page_tables;
+
+	ret = HYPERVISOR_xen_version(XENVER_get_features, &info);
+	if (ret)
+		return ret;
+
+	return sprintf(buffer, "%d\n", info.submap);
+}
+
+HYPERVISOR_ATTR_RO(writable_pt);
+
+static struct attribute *xen_properties_attrs[] = {
+	&capabilities_attr.attr,
+	&changeset_attr.attr,
+	&virtual_start_attr.attr,
+	&pagesize_attr.attr,
+	&writable_pt_attr.attr,
+	NULL
+};
+
+static struct attribute_group xen_properties_group = {
+	.name = "properties",
+	.attrs = xen_properties_attrs,
+};
+
+static int __init xen_properties_init(void)
+{
+	return sysfs_create_group(hypervisor_kobj,
+				  &xen_properties_group);
+}
+
+static void xen_properties_destroy(void)
+{
+	sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
+}
+
+int __init sys_hypervisor_init(void)
+{
+	int ret;
+
+	if (!is_running_on_xen())
+		return -ENODEV;
+
+	ret = xen_sysfs_type_init();
+	if (ret)
+		goto out;
+	ret = xen_sysfs_version_init();
+	if (ret)
+		goto version_out;
+	ret = xen_compilation_init();
+	if (ret)
+		goto comp_out;
+	ret = xen_sysfs_uuid_init();
+	if (ret)
+		goto uuid_out;
+	ret = xen_properties_init();
+	if (!ret)
+		goto out;
+
+	xen_sysfs_uuid_destroy();
+uuid_out:
+	xen_compilation_destroy();
+comp_out:
+	xen_sysfs_version_destroy();
+version_out:
+	xen_sysfs_type_destroy();
+out:
+	return ret;
+}
+
+void __exit sys_hypervisor_exit(void)
+{
+	xen_properties_destroy();
+	xen_compilation_destroy();
+	xen_sysfs_uuid_destroy();
+	xen_sysfs_version_destroy();
+	xen_sysfs_type_destroy();
+}
diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
index e585c4b..1afbdfb 100644
--- a/drivers/xen/xenctrl/xenctrl.h
+++ b/drivers/xen/xenctrl/xenctrl.h
@@ -49,3 +49,9 @@ void privcmd_remove_proc_entry(void) __exit;
  */
 int xenbus_create_proc_entry(void) __init;
 void xenbus_remove_proc_entry(void) __exit;
+
+/*
+ * sysfs.c
+ */
+int sys_hypervisor_init(void) __init;
+void sys_hypervisor_exit(void) __exit;
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
index 453235e..dd58cf5 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -57,4 +57,10 @@ struct xen_feature_info {
 /* Declares the features reported by XENVER_get_features. */
 #include "features.h"
 
+/* arg == NULL; returns host memory page size. */
+#define XENVER_pagesize 7
+
+/* arg == xen_domain_handle_t. */
+#define XENVER_guest_handle 8
+
 #endif /* __XEN_PUBLIC_VERSION_H__ */
-- 
1.5.4.1


linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch:

--- NEW FILE linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch ---
>From 55bc3e943717c4ef3a9b78138fae9f4068436914 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Thu, 6 Mar 2008 11:10:59 +0000
Subject: [PATCH] xen x86_64: Add 64 bit version of privcmd_hypercall()

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 include/asm-x86/xen/hypercall.h |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index 0ff6e89..03e6406 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -418,6 +418,7 @@ MULTI_stack_switch(struct multicall_entry *mcl,
 
 #include <xen/sys/privcmd.h>
 
+#ifdef CONFIG_X86_32
 static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
 {
 	int ret;
@@ -443,5 +444,32 @@ static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
 
 	return ret;
 }
+#else /* CONFIG_X86_32 */
+static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
+{
+	int ret;
+        long ign1, ign2, ign3;
+
+	if (hypercall->op >= (PAGE_SIZE >> 5))
+		return -EINVAL;
+
+        __asm__ __volatile__ (
+		"movq %8,%%r10; movq %9,%%r8;"
+                "shll $5,%%eax ;"
+                "addq $hypercall_page,%%rax ;"
+                "call *%%rax"
+                : "=a" (ret), "=D" (ign1),
+                  "=S" (ign2), "=d" (ign3)
+                : "0" ((unsigned int)hypercall->op),
+                  "1" (hypercall->arg[0]),
+                  "2" (hypercall->arg[1]),
+                  "3" (hypercall->arg[2]),
+                  "g" (hypercall->arg[3]),
+                  "g" (hypercall->arg[4])
+                : "r8", "r10", "memory" );
+
+	return ret;
+}
+#endif /* CONFIG_X86_32 */
 
 #endif /* __HYPERCALL_H__ */
-- 
1.5.4.1


linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch:

--- NEW FILE linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch ---
>From 8bbba08cd18f80e3244ea2ac8e6ec0722e82fed7 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Tue, 25 Mar 2008 11:56:43 +0000
Subject: [PATCH] xen x86_64: Only define load_user_cs_desc() on 32 bit

load_user_cs_desc() is only used on 32 bit, so only
define it in that case.

Fixes compile failure in native_load_user_cs_desc()
since mm_context_t->user_cs is only available on
32 bit.

Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/kernel/paravirt.c |    2 ++
 arch/x86/xen/enlighten.c   |    4 ++++
 include/asm-x86/desc.h     |    4 ++++
 include/asm-x86/paravirt.h |    4 ++++
 4 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index afdbfb3..ca9a311 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -315,7 +315,9 @@ struct pv_cpu_ops pv_cpu_ops = {
 	.read_tscp = native_read_tscp,
 	.load_tr_desc = native_load_tr_desc,
 	.set_ldt = native_set_ldt,
+#ifdef CONFIG_X86_32
 	.load_user_cs_desc = native_load_user_cs_desc,
+#endif
 	.load_gdt = native_load_gdt,
 	.load_idt = native_load_idt,
 	.store_gdt = native_store_gdt,
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index cd3f067..411e402 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -292,6 +292,7 @@ static void xen_set_ldt(const void *addr, unsigned entries)
 	xen_mc_issue(PARAVIRT_LAZY_CPU);
 }
 
+#ifdef CONFIG_X86_32
 static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
 {
 	void *gdt;
@@ -307,6 +308,7 @@ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
 
 	HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
 }
+#endif
 
 static void xen_load_gdt(const struct desc_ptr *dtr)
 {
@@ -1028,7 +1030,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
 
 	.load_tr_desc = paravirt_nop,
 	.set_ldt = xen_set_ldt,
+#ifdef CONFIG_X86_32
 	.load_user_cs_desc = xen_load_user_cs_desc,
+#endif
 	.load_gdt = xen_load_gdt,
 	.load_idt = xen_load_idt,
 	.load_tls = xen_load_tls,
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 428376e..95e2021 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -95,7 +95,9 @@ static inline int desc_empty(const void *ptr)
 
 #define load_TLS(t, cpu) native_load_tls(t, cpu)
 #define set_ldt native_set_ldt
+#ifdef CONFIG_X86_32
 #define load_user_cs_desc native_load_user_cs_desc
+#endif
 
 #define write_ldt_entry(dt, entry, desc)	\
 	native_write_ldt_entry(dt, entry, desc)
@@ -364,10 +366,12 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
 	desc->b = (limit & 0xf0000) | 0x00c0fb00;
 }
 
+#ifdef CONFIG_X86_32
 static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
 {
 	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
 }
+#endif
 
 extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
 extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index cde8985..a05d4f1 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -113,7 +113,9 @@ struct pv_cpu_ops {
 	void (*store_gdt)(struct desc_ptr *);
 	void (*store_idt)(struct desc_ptr *);
 	void (*set_ldt)(const void *desc, unsigned entries);
+#ifdef CONFIG_X86_32
 	void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
+#endif
 	unsigned long (*store_tr)(void);
 	void (*load_tls)(struct thread_struct *t, unsigned int cpu);
 	void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
@@ -772,11 +774,13 @@ static inline void set_ldt(const void *addr, unsigned entries)
 {
 	PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
 }
+#ifdef CONFIG_X86_32
 static inline void load_user_cs_desc(unsigned int cpu, 
 				     struct mm_struct *mm)
 {
 	PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
 }
+#endif
 static inline void store_gdt(struct desc_ptr *dtr)
 {
 	PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
-- 
1.5.4.1


linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch:

--- NEW FILE linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch ---
>From 5251f3187ef418d278274f2bdc89edf878cc69c4 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 28 Jan 2008 15:38:03 +0000
Subject: [PATCH] xen: expose set_pte_vaddr() and make xen use it

Re-name set_pte_pfn() to set_pte_vaddr(), taking a pte_t
rather than pfn/flags, and expose it.

Make xen's set_pte_mfn() use this rather than copying it.

Signed-off-by: Jeremy Fitzhardinge <jeremy at xensource.com>
Signed-off-by: Juan Quintela <quintela at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/mm/pgtable_32.c     |    8 ++++----
 arch/x86/xen/mmu.c           |   30 +-----------------------------
 include/asm-x86/pgtable_32.h |    3 +++
 3 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index 369cf06..790e0a6 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -71,7 +71,7 @@ void show_mem(void)
  * Associate a virtual page frame with a given physical page frame 
  * and protection flags for that frame.
  */ 
-static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
+void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
 {
 	pgd_t *pgd;
 	pud_t *pud;
@@ -94,8 +94,8 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
 		return;
 	}
 	pte = pte_offset_kernel(pmd, vaddr);
-	if (pgprot_val(flags))
-		set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags));
+	if (pte_val(pteval))
+		set_pte_present(&init_mm, vaddr, pte, pteval);
 	else
 		pte_clear(&init_mm, vaddr, pte);
 
@@ -153,7 +153,7 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
 		BUG();
 		return;
 	}
-	set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
+	set_pte_vaddr(address, pfn_pte(phys >> PAGE_SHIFT, flags));
 	fixmaps++;
 }
 
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 3525ef5..d3ee761 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -122,35 +122,7 @@ void xen_set_pmd(pmd_t *ptr, pmd_t val)
  */
 void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
 {
-	pgd_t *pgd;
-	pud_t *pud;
-	pmd_t *pmd;
-	pte_t *pte;
-
-	pgd = swapper_pg_dir + pgd_index(vaddr);
-	if (pgd_none(*pgd)) {
-		BUG();
-		return;
-	}
-	pud = pud_offset(pgd, vaddr);
-	if (pud_none(*pud)) {
-		BUG();
-		return;
-	}
-	pmd = pmd_offset(pud, vaddr);
-	if (pmd_none(*pmd)) {
-		BUG();
-		return;
-	}
-	pte = pte_offset_kernel(pmd, vaddr);
-	/* <mfn,flags> stored as-is, to permit clearing entries */
-	xen_set_pte(pte, mfn_pte(mfn, flags));
-
-	/*
-	 * It's enough to flush this one mapping.
-	 * (PGE mappings get flushed as well)
-	 */
-	__flush_tlb_one(vaddr);
+	set_pte_vaddr(vaddr, mfn_pte(mfn, flags));
 }
 
 void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h
index 32ca031..ee22578 100644
--- a/include/asm-x86/pgtable_32.h
+++ b/include/asm-x86/pgtable_32.h
@@ -194,6 +194,9 @@ do {						\
 extern void native_pagetable_setup_start(pgd_t *base);
 extern void native_pagetable_setup_done(pgd_t *base);
 
+/* Install a pte for a particular vaddr in kernel space. */
+void set_pte_vaddr(unsigned long vaddr, pte_t pte);
+
 #ifndef CONFIG_PARAVIRT
 static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
 {
-- 
1.5.4.1


linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch:

--- NEW FILE linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch ---
>From b282b86657fc87afd27ae77567803e1cbe635db0 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Mon, 28 Jan 2008 15:42:08 +0000
Subject: [PATCH] xen dom0: Add set_fixmap pv_mmu_ops.

Adds the logic necessary to map by mfn rather than pfn when we set up
fixmaps to point to IO space.

Signed-off-by: Jeremy Fitzhardinge <jeremy at xensource.com>
Signed-off-by: Juan Quintela <quintela at redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/kernel/paravirt.c  |    2 ++
 arch/x86/mm/pgtable_32.c    |    9 +++++++--
 arch/x86/xen/enlighten.c    |   28 ++++++++++++++++++++++++++++
 include/asm-x86/fixmap_32.h |   13 +++++++++++--
 include/asm-x86/paravirt.h  |   13 +++++++++++++
 5 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index ca9a311..0c077cd 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -419,6 +419,8 @@ struct pv_mmu_ops pv_mmu_ops = {
 		.enter = paravirt_nop,
 		.leave = paravirt_nop,
 	},
+
+	.set_fixmap = native_set_fixmap,
 };
 
 EXPORT_SYMBOL_GPL(pv_time_ops);
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index 790e0a6..e92c7bb 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -145,7 +145,7 @@ static int fixmaps;
 unsigned long __FIXADDR_TOP = 0xfffff000;
 EXPORT_SYMBOL(__FIXADDR_TOP);
 
-void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
+void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
 {
 	unsigned long address = __fix_to_virt(idx);
 
@@ -153,10 +153,15 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
 		BUG();
 		return;
 	}
-	set_pte_vaddr(address, pfn_pte(phys >> PAGE_SHIFT, flags));
+	set_pte_vaddr(address, pte);
 	fixmaps++;
 }
 
+void native_set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
+{
+	__native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, flags));
+}
+
 /**
  * reserve_top_address - reserves a hole in the top of kernel address space
  * @reserve - size of hole to reserve
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 411e402..7c65c46 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -978,6 +978,32 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
 	return ret;
 }
 
+static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
+{
+	pte_t pte;
+
+	phys >>= PAGE_SHIFT;
+
+	switch (idx) {
+#ifdef CONFIG_X86_F00F_BUG
+	case FIX_F00F_IDT:
+#endif
+	case FIX_WP_TEST:
+	case FIX_VDSO:
+#ifdef CONFIG_X86_LOCAL_APIC
+	case FIX_APIC_BASE:	/* maps dummy local APIC */
+#endif
+		pte = pfn_pte(phys, prot);
+		break;
+
+	default:
+		pte = mfn_pte(phys, prot);
+		break;
+	}
+
+	__native_set_fixmap(idx, pte);
+}
+
 static const struct pv_info xen_info __initdata = {
 	.paravirt_enabled = 1,
 	.shared_kernel_pmd = 0,
@@ -1133,6 +1159,8 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
 		.enter = paravirt_enter_lazy_mmu,
 		.leave = xen_leave_lazy,
 	},
+
+	.set_fixmap = xen_set_fixmap,
 };
 
 #ifdef CONFIG_SMP
diff --git a/include/asm-x86/fixmap_32.h b/include/asm-x86/fixmap_32.h
index 4b96148..0878fba 100644
--- a/include/asm-x86/fixmap_32.h
+++ b/include/asm-x86/fixmap_32.h
@@ -109,8 +109,17 @@ enum fixed_addresses {
 	__end_of_fixed_addresses
 };
 
-extern void __set_fixmap(enum fixed_addresses idx,
-			 unsigned long phys, pgprot_t flags);
+void __native_set_fixmap(enum fixed_addresses idx, pte_t pte);
+void native_set_fixmap(enum fixed_addresses idx,
+		       unsigned long phys, pgprot_t flags);
+
+#ifndef CONFIG_PARAVIRT
+static inline void __set_fixmap(enum fixed_addresses idx,
+				unsigned long phys, pgprot_t flags)
+{
+	native_set_fixmap(idx, phys, flags);
+}
+#endif
 extern void reserve_top_address(unsigned long reserve);
 
 #define set_fixmap(idx, phys)				\
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index a05d4f1..a37fc2d 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -276,6 +276,13 @@ struct pv_mmu_ops {
 #endif
 
 	struct pv_lazy_ops lazy_mode;
+
+	/* dom0 ops */
+
+	/* Sometimes the physical address is a pfn, and sometimes its
+	   an mfn.  We can tell which is which from the index. */
+	void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
+			   unsigned long phys, pgprot_t flags);
 };
 
 /* This contains all the paravirt structures: we get a convenient
@@ -1262,6 +1269,12 @@ static inline void arch_flush_lazy_mmu_mode(void)
 	}
 }
 
+static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
+				unsigned long phys, pgprot_t flags)
+{
+	pv_mmu_ops.set_fixmap(idx, phys, flags);
+}
+
 void _paravirt_nop(void);
 #define paravirt_nop	((void *)_paravirt_nop)
 
-- 
1.5.4.1


linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch:

--- NEW FILE linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch ---
>From 0a74c0297dd190cf8ccaf4274a962abaa739b757 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 3 Mar 2008 15:03:42 -0300
Subject: [PATCH] x86_64: Expose set_pte_vaddr()

Re-name set_pte_pfn() to set_pte_vaddr(), taking a pte_t
rather than pfn/flags, and expose it.

This brings 32-bit closer to 64-bit.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/mm/init_64.c        |   15 +++++++--------
 include/asm-x86/pgtable_64.h |    4 ++++
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index e16cb7a..fd06fb4 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -135,15 +135,15 @@ static __init void *spp_getpage(void)
 	return ptr;
 }
 
-static void
-set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot)
+void
+set_pte_vaddr(unsigned long vaddr, pte_t pteval)
 {
 	pgd_t *pgd;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *pte, new_pte;
+	pte_t *pte;
 
-	pr_debug("set_pte_phys %lx to %lx\n", vaddr, phys);
+	pr_debug("set_pte_phys %lx to %lx\n", vaddr, native_pte_val(pteval));
 
 	pgd = pgd_offset_k(vaddr);
 	if (pgd_none(*pgd)) {
@@ -170,13 +170,12 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot)
 			return;
 		}
 	}
-	new_pte = pfn_pte(phys >> PAGE_SHIFT, prot);
 
 	pte = pte_offset_kernel(pmd, vaddr);
-	if (!pte_none(*pte) && pte_val(new_pte) &&
-	    pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask))
+	if (!pte_none(*pte) && pte_val(pteval) &&
+	    pte_val(*pte) != (pte_val(pteval) & __supported_pte_mask))
 		pte_ERROR(*pte);
-	set_pte(pte, new_pte);
+	set_pte(pte, pteval);
 
 	/*
 	 * It's enough to flush this one mapping.
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index 1cc50d2..0785137 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -280,6 +280,10 @@ extern void cleanup_highmap(void);
 	 : (o))
 
 #define __HAVE_ARCH_PTE_SAME
+
+/* Install a pte for a particular vaddr in kernel space. */
+void set_pte_vaddr(unsigned long vaddr, pte_t pte);
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _X86_64_PGTABLE_H */
-- 
1.5.4.1


linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch:

--- NEW FILE linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch ---
>From d3867be3336732d79e7bd53b181a3988907d7073 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 8 Feb 2008 12:41:04 -0200
Subject: [PATCH] x86_64: Split set_pte_vaddr()

We will need to set a pte on l3_user_pgt. Extract set_pte_vaddr_pud()
from set_pte_vaddr(), that will accept the l3 page table as
parameter.

This change should be a no-op for existing code.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/mm/init_64.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index fd06fb4..b7e44c9 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -135,23 +135,14 @@ static __init void *spp_getpage(void)
 	return ptr;
 }
 
-void
-set_pte_vaddr(unsigned long vaddr, pte_t pteval)
+static void
+set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t pteval)
 {
-	pgd_t *pgd;
 	pud_t *pud;
 	pmd_t *pmd;
 	pte_t *pte;
 
-	pr_debug("set_pte_phys %lx to %lx\n", vaddr, native_pte_val(pteval));
-
-	pgd = pgd_offset_k(vaddr);
-	if (pgd_none(*pgd)) {
-		printk(KERN_ERR
-			"PGD FIXMAP MISSING, it should be setup in head.S!\n");
-		return;
-	}
-	pud = pud_offset(pgd, vaddr);
+	pud = pud_page + pud_index(vaddr);
 	if (pud_none(*pud)) {
 		pmd = (pmd_t *) spp_getpage();
 		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
@@ -184,6 +175,24 @@ set_pte_vaddr(unsigned long vaddr, pte_t pteval)
 	__flush_tlb_one(vaddr);
 }
 
+void
+set_pte_vaddr(unsigned long vaddr, pte_t pteval)
+{
+	pgd_t *pgd;
+	pud_t *pud_page;
+
+	pr_debug("set_pte_vaddr %lx to %lx\n", vaddr, native_pte_val(pteval));
+
+	pgd = pgd_offset_k(vaddr);
+	if (pgd_none(*pgd)) {
+		printk(KERN_ERR
+			"PGD FIXMAP MISSING, it should be setup in head.S!\n");
+		return;
+	}
+	pud_page = (pud_t*)pgd_page_vaddr(*pgd);
+	set_pte_vaddr_pud(pud_page, vaddr, pteval);
+}
+
 /*
  * The head.S code sets up the kernel high mapping:
  *
-- 
1.5.4.1


linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch:

--- NEW FILE linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch ---
>From 9429947be55dab5735758bb1b89808d11b0bcdd1 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 3 Mar 2008 16:31:57 -0300
Subject: [PATCH] x86_64: Add clear_fixmap()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 include/asm-x86/fixmap_64.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/fixmap_64.h b/include/asm-x86/fixmap_64.h
index 355d26a..9ab438e 100644
--- a/include/asm-x86/fixmap_64.h
+++ b/include/asm-x86/fixmap_64.h
@@ -63,6 +63,9 @@ extern void __set_fixmap(enum fixed_addresses idx,
 #define set_fixmap_nocache(idx, phys)			\
 	__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
 
+#define clear_fixmap(idx) \
+		__set_fixmap(idx, 0, __pgprot(0))
+
 #define FIXADDR_TOP	(VSYSCALL_END-PAGE_SIZE)
 #define FIXADDR_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
-- 
1.5.4.1


linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch:

--- NEW FILE linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch ---
>From acd16f26c88c6d8a912d180d7c01e69ee077a043 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 3 Mar 2008 14:36:59 -0300
Subject: [PATCH] xen x86_64: Make set_fixmap() a paravirt op on 64-bit

Make set_fixmap() a paravirt op on 64-bit.

This should be unified with 32-bit later.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c       |   10 ++++++++--
 include/asm-x86/fixmap_64.h |   13 +++++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index b7e44c9..7815dfd 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -222,7 +222,7 @@ void __init cleanup_highmap(void)
 }
 
 /* NOTE: this is meant to be run only at boot */
-void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
+void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
 {
 	unsigned long address = __fix_to_virt(idx);
 
@@ -230,7 +230,13 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
 		printk(KERN_ERR "Invalid __set_fixmap\n");
 		return;
 	}
-	set_pte_phys(address, phys, prot);
+	set_pte_vaddr(address, pte);
+}
+
+void __init
+native_set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
+{
+	__native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, prot));
 }
 
 static unsigned long __initdata table_start;
diff --git a/include/asm-x86/fixmap_64.h b/include/asm-x86/fixmap_64.h
index 9ab438e..fdee956 100644
--- a/include/asm-x86/fixmap_64.h
+++ b/include/asm-x86/fixmap_64.h
@@ -52,8 +52,17 @@ enum fixed_addresses {
 	__end_of_fixed_addresses
 };
 
-extern void __set_fixmap(enum fixed_addresses idx,
-			 unsigned long phys, pgprot_t flags);
+void __native_set_fixmap(enum fixed_addresses idx, pte_t pte);
+void native_set_fixmap(enum fixed_addresses idx,
+		       unsigned long phys, pgprot_t flags);
+
+#ifndef CONFIG_PARAVIRT
+static inline void __set_fixmap(enum fixed_addresses idx,
+				unsigned long phys, pgprot_t flags)
+{
+	native_set_fixmap(idx, phys, flags);
+}
+#endif
 
 #define set_fixmap(idx, phys)			\
 	__set_fixmap(idx, phys, PAGE_KERNEL)
-- 
1.5.4.1


linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch:

--- NEW FILE linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch ---
>From 6b1abcfb14782abcb815e30a3f973e50f856c227 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 8 Feb 2008 12:48:51 -0200
Subject: [PATCH] xen x86_64: Hack to set vsyscall pages on user-space pagetables also (FIXME)

This should be done using pvops.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 7815dfd..9b15da2 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -231,6 +231,12 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
 		return;
 	}
 	set_pte_vaddr(address, pte);
+
+#ifdef CONFIG_XEN
+	/*FIXME: move this to xen_set_pte() */
+	if (idx == VSYSCALL_FIRST_PAGE)
+		set_pte_vaddr_pud(level3_user_pgt, address, pte);
+#endif
 }
 
 void __init
-- 
1.5.4.1


linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch:

--- NEW FILE linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch ---
>From 6e8ca4f7f73b8a84c4012d9c6044ddf5540df068 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 7 Mar 2008 18:53:28 -0300
Subject: [PATCH] Handle VSYSCALL_FIRST_PAGE on xen_set_pte()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 7c65c46..c0b431d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -993,6 +993,9 @@ static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
 #ifdef CONFIG_X86_LOCAL_APIC
 	case FIX_APIC_BASE:	/* maps dummy local APIC */
 #endif
+#ifdef CONFIG_X86_64
+	case VSYSCALL_FIRST_PAGE:
+#endif
 		pte = pfn_pte(phys, prot);
 		break;
 
-- 
1.5.4.1


linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch:

--- NEW FILE linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch ---
>From 9e94cd2247d7dd81a2c53628275fe21c049e17bd Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 5 Mar 2008 11:48:34 -0300
Subject: [PATCH] xen x86_64: Remove the 640K-1M hole and disable DMI (TEMPORARY)

On 64-bit, we don't have the LOWMEM and HIGHMEM macros. As I think
using the LOWMEM and HIGHMEM macros on 64-bit would be ugly, I am
disabling the hole temporarily, until I understand the DMI problem
properly.

Instead, for now, just disable CONFIG_DMI under CONFIG_XEN.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 arch/x86/Kconfig     |    2 +-
 arch/x86/xen/setup.c |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 52e18e6..ad8bba8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -490,7 +490,7 @@ config HPET_EMULATE_RTC
 # Mark as embedded because too many people got it wrong.
 # The code disables itself when not needed.
 config DMI
-	default y
+	default !XEN
 	bool "Enable DMI scanning" if EMBEDDED
 	help
 	  Enabled scanning of DMI to identify machine quirks. Say Y
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 82517e4..2dabdfa 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -39,8 +39,12 @@ char * __init xen_memory_setup(void)
 	unsigned long max_pfn = xen_start_info->nr_pages;
 
 	e820.nr_map = 0;
+#ifdef CONFIG_X86_32
 	add_memory_region(0, LOWMEMSIZE(), E820_RAM);
 	add_memory_region(HIGH_MEMORY, PFN_PHYS(max_pfn)-HIGH_MEMORY, E820_RAM);
+#else
+	add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
+#endif
 
 	return "Xen";
 }
-- 
1.5.4.1


linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch:

--- NEW FILE linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch ---
>From e4707a5c2b837e5962761988e842d96b21ccadd2 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 14:50:24 -0200
Subject: [PATCH] xen x86_64: Add update_va_mapping 64-bit code

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/hypercall.h  |   44 ++++++++++++++++++++++++++++++-------
 include/asm-x86/xen/hypervisor.h |    3 --
 2 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index 03e6406..069e891 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -120,6 +120,15 @@ extern struct { char _entry[32]; } hypercall_page[];
 	(type)__res;							\
 })
 
+#if defined(CONFIG_X86_64)
+#define MULTI_UVMFLAGS_INDEX 2
+#define MULTI_UVMDOMID_INDEX 3
+#else
+#define MULTI_UVMFLAGS_INDEX 3
+#define MULTI_UVMDOMID_INDEX 4
+#endif
+
+
 static inline int
 HYPERVISOR_set_trap_table(struct trap_info *table)
 {
@@ -223,12 +232,17 @@ static inline int
 HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
 			     unsigned long flags)
 {
+#ifdef CONFIG_X86_64
+	return _hypercall3(int, update_va_mapping, va,
+			   new_val.pte, flags);
+#else
 	unsigned long pte_hi = 0;
 #ifdef CONFIG_X86_PAE
 	pte_hi = new_val.pte_high;
 #endif
 	return _hypercall4(int, update_va_mapping, va,
 			   new_val.pte_low, pte_hi, flags);
+#endif
 }
 
 static inline int
@@ -281,12 +295,17 @@ static inline int
 HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val,
 					 unsigned long flags, domid_t domid)
 {
+#ifdef CONFIG_X86_64
+	return _hypercall4(int, update_va_mapping_otherdomain, va,
+			   new_val.pte, flags, domid);
+#else
 	unsigned long pte_hi = 0;
 #ifdef CONFIG_X86_PAE
 	pte_hi = new_val.pte_high;
 #endif
 	return _hypercall5(int, update_va_mapping_otherdomain, va,
 			   new_val.pte_low, pte_hi, flags, domid);
+#endif
 }
 
 static inline int
@@ -320,14 +339,18 @@ MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
 {
 	mcl->op = __HYPERVISOR_update_va_mapping;
 	mcl->args[0] = va;
-#ifdef CONFIG_X86_PAE
-	mcl->args[1] = new_val.pte_low;
-	mcl->args[2] = new_val.pte_high;
+
+#ifdef CONFIG_X86_64
+	mcl->args[1] = new_val.pte;
 #else
 	mcl->args[1] = new_val.pte_low;
+#  ifdef CONFIG_X86_PAE
+	mcl->args[2] = new_val.pte_high;
+#  else
 	mcl->args[2] = 0;
+#  endif
 #endif
-	mcl->args[3] = flags;
+	mcl->args[MULTI_UVMFLAGS_INDEX] = flags;
 }
 
 static inline void
@@ -347,15 +370,18 @@ MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long v
 {
 	mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
 	mcl->args[0] = va;
-#ifdef CONFIG_X86_PAE
-	mcl->args[1] = new_val.pte_low;
-	mcl->args[2] = new_val.pte_high;
+#ifdef CONFIG_X86_64
+	mcl->args[1] = new_val.pte;
 #else
 	mcl->args[1] = new_val.pte_low;
+#  ifdef CONFIG_X86_PAE
+	mcl->args[2] = new_val.pte_high;
+#  else
 	mcl->args[2] = 0;
+#  endif
 #endif
-	mcl->args[3] = flags;
-	mcl->args[4] = domid;
+	mcl->args[MULTI_UVMFLAGS_INDEX] = flags;
+	mcl->args[MULTI_UVMDOMID_INDEX] = domid;
 }
 
 static inline void
diff --git a/include/asm-x86/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h
index 8e15dd2..49a5e24 100644
--- a/include/asm-x86/xen/hypervisor.h
+++ b/include/asm-x86/xen/hypervisor.h
@@ -65,9 +65,6 @@ extern void force_evtchn_callback(void);
 u64 jiffies_to_st(unsigned long jiffies);
 
 
-#define MULTI_UVMFLAGS_INDEX 3
-#define MULTI_UVMDOMID_INDEX 4
-
 #define is_running_on_xen()	(xen_start_info ? 1 : 0)
 
 #endif /* __HYPERVISOR_H__ */
-- 
1.5.4.1


linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch:

--- NEW FILE linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch ---
>From 7687c615b3312eaabefafedd404ce0cece659b7a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 18:08:41 -0200
Subject: [PATCH] x86_64: Add sync_cmpxchg()

Add a sync_cmpxchg() for x86_64, including a sync_cmpxchg64()
implementation.

Needed for Xen's grant table implementation.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 include/asm-x86/cmpxchg_64.h |   49 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/cmpxchg_64.h b/include/asm-x86/cmpxchg_64.h
index d9b26b9..77c3fe7 100644
--- a/include/asm-x86/cmpxchg_64.h
+++ b/include/asm-x86/cmpxchg_64.h
@@ -93,6 +93,45 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 	return old;
 }
 
+/*
+ * Always use locked operations when touching memory shared with a
+ * hypervisor, since the system may be SMP even if the guest kernel
+ * isn't.
+ */
+static inline unsigned long __sync_cmpxchg(volatile void *ptr,
+					    unsigned long old,
+					    unsigned long new, int size)
+{
+	unsigned long prev;
+	switch (size) {
+	case 1:
+		__asm__ __volatile__("lock; cmpxchgb %b1,%2"
+				     : "=a"(prev)
+				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
+				     : "memory");
+		return prev;
+	case 2:
+		__asm__ __volatile__("lock; cmpxchgw %w1,%2"
+				     : "=a"(prev)
+				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
+				     : "memory");
+		return prev;
+	case 4:
+		__asm__ __volatile__("lock; cmpxchgl %k1,%2"
+				     : "=a"(prev)
+				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
+				     : "memory");
+		return prev;
+	case 8:
+		__asm__ __volatile__("lock; cmpxchgq %1,%2"
+				     : "=a"(prev)
+				     : "r"(new), "m"(*__xg(ptr)), "0"(old)
+				     : "memory");
+		return prev;
+	}
+	return old;
+}
+
 static inline unsigned long __cmpxchg_local(volatile void *ptr,
 					    unsigned long old,
 					    unsigned long new, int size)
@@ -135,6 +174,16 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
 	cmpxchg((ptr), (o), (n));					\
 })
+
+#define sync_cmpxchg(ptr, o, n)						\
+	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
+				       (unsigned long)(n), sizeof(*(ptr))))
+#define sync_cmpxchg64(ptr, o, n)						\
+({									\
+	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
+	sync_cmpxchg((ptr), (o), (n));					\
+})
+
 #define cmpxchg_local(ptr, o, n)					\
 	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
 					     (unsigned long)(n),	\
-- 
1.5.4.1


linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch:

--- NEW FILE linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch ---
>From 1c3b083c506b94d7e2f8f99547e8aed7cc6120aa Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 18:09:08 -0200
Subject: [PATCH] xen x86_64: Implement {HYPERVISOR,MULTI}_update_descriptor()

Add 64-bit versions of HYPERVISOR_update_descriptor() and
MULTI_update_descriptor().

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
 include/asm-x86/xen/hypercall.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index 069e891..f5f07de 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -210,11 +210,20 @@ HYPERVISOR_get_debugreg(int reg)
 	return _hypercall1(unsigned long, get_debugreg, reg);
 }
 
+#ifdef CONFIG_X86_64
+static inline int
+HYPERVISOR_update_descriptor(
+	unsigned long ma, unsigned long word)
+{
+	return _hypercall2(int, update_descriptor, ma, word);
+}
+#else
 static inline int
 HYPERVISOR_update_descriptor(u64 ma, u64 desc)
 {
 	return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
 }
+#endif
 
 static inline int
 HYPERVISOR_memory_op(unsigned int cmd, void *arg)
@@ -389,10 +398,16 @@ MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
 			struct desc_struct desc)
 {
 	mcl->op = __HYPERVISOR_update_descriptor;
+#ifdef CONFIG_X86_64
+	BUG_ON(sizeof(desc) != sizeof(mcl->args[2]));
+	mcl->args[0] = maddr;
+	mcl->args[1] = *((unsigned long *)&desc);
+#else
 	mcl->args[0] = maddr;
 	mcl->args[1] = maddr >> 32;
 	mcl->args[2] = desc.a;
 	mcl->args[3] = desc.b;
+#endif
 }
 
 static inline void
-- 
1.5.4.1


linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch:

--- NEW FILE linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch ---
>From a175ae697a913c8d1b0fe23347d49a63df67eb0d Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 18:21:29 -0200
Subject: [PATCH] xen x86_64: Add hacky 64-bit x86_{read,write}_percpu()

It isn't implemented on x86_64 yet, so I am simply using __get_cpu_var().

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/percpu.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h
index 736fc3b..938f493 100644
--- a/include/asm-x86/percpu.h
+++ b/include/asm-x86/percpu.h
@@ -22,6 +22,10 @@
 
 DECLARE_PER_CPU(struct x8664_pda, pda);
 
+/* x86_read_percpu & friends */
+#define x86_read_percpu(var) __get_cpu_var(var)
+#define x86_write_percpu(var,val) (__get_cpu_var(var) = (val))
+
 #else /* CONFIG_X86_64 */
 
 #ifdef __ASSEMBLY__
-- 
1.5.4.1


linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch:

--- NEW FILE linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch ---
>From 8ddfa2765675e2f0adaab89fa015231556e5c485 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 19:25:50 -0200
Subject: [PATCH] xen x86_64: Use x86_read_percpu() only to refer to a variable name

Our x86_read_percpu() implementation doesn't handle struct
dereferences.

Signed-off-by: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
---
 arch/x86/xen/enlighten.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index c0b431d..0092d63 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -637,7 +637,11 @@ static unsigned long xen_read_cr2(void)
 
 static unsigned long xen_read_cr2_direct(void)
 {
+#ifdef CONFIG_X86_32
 	return x86_read_percpu(xen_vcpu_info.arch.cr2);
+#else
+	return x86_read_percpu(xen_vcpu_info).arch.cr2;
+#endif
 }
 
 static void xen_write_cr4(unsigned long cr4)
-- 
1.5.4.1


linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch:

--- NEW FILE linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch ---
>From 2796346811cb920c86f11eec7b8188c53266ee03 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 19:42:21 -0200
Subject: [PATCH] Add FIX_PARAVIRT_BOOTAP to fixmap_64.h too

Signed-off-by: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
---
 include/asm-x86/fixmap_64.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/fixmap_64.h b/include/asm-x86/fixmap_64.h
index fdee956..8436081 100644
--- a/include/asm-x86/fixmap_64.h
+++ b/include/asm-x86/fixmap_64.h
@@ -46,6 +46,9 @@ enum fixed_addresses {
 	FIX_EFI_IO_MAP_LAST_PAGE,
 	FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
 				  + MAX_EFI_IO_PAGES - 1,
+#ifdef CONFIG_PARAVIRT
+	FIX_PARAVIRT_BOOTMAP,
+#endif
 #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 	FIX_OHCI1394_BASE,
 #endif
-- 
1.5.4.1


linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch:

--- NEW FILE linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch ---
>From fcccec19339feda551cfb03a3434f268ddacdfc0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 19:42:54 -0200
Subject: [PATCH] Add gate_offset() and gate_segment() macros

For calculating the offset from struct gate_struct fields.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/desc_defs.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h
index eccb4ea..a9bcd41 100644
--- a/include/asm-x86/desc_defs.h
+++ b/include/asm-x86/desc_defs.h
@@ -75,10 +75,14 @@ struct ldttss_desc64 {
 typedef struct gate_struct64 gate_desc;
 typedef struct ldttss_desc64 ldt_desc;
 typedef struct ldttss_desc64 tss_desc;
+#define gate_offset(g) ((g).offset_low | ((unsigned long)(g).offset_middle << 16) | ((unsigned long)(g).offset_high << 32))
+#define gate_segment(g) ((g).segment)
 #else
 typedef struct desc_struct gate_desc;
 typedef struct desc_struct ldt_desc;
 typedef struct desc_struct tss_desc;
+#define gate_offset(g) get_desc_limit(&(g))
+#define gate_segment(g) get_desc_base(&(g))
 #endif
 
 struct desc_ptr {
-- 
1.5.4.1


linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch:

--- NEW FILE linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch ---
>From 0f5aa8683cc0bb94bb5b4af8a4beffc7a984f0dd Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 19:43:41 -0200
Subject: [PATCH] xen_write_idt_entry() and cvt_gate_to_trap()

Changed to use the (to-be-)unified descriptor structs.

Signed-off-by: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
---
 arch/x86/xen/enlighten.c |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0092d63..d2c152b 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -387,23 +387,18 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
 	preempt_enable();
 }
 
-static int cvt_gate_to_trap(int vector, u32 low, u32 high,
+static int cvt_gate_to_trap(int vector, const gate_desc *val,
 			    struct trap_info *info)
 {
-	u8 type, dpl;
-
-	type = (high >> 8) & 0x1f;
-	dpl = (high >> 13) & 3;
-
-	if (type != 0xf && type != 0xe)
+	if (val->type != 0xf && val->type != 0xe)
 		return 0;
 
 	info->vector = vector;
-	info->address = (high & 0xffff0000) | (low & 0x0000ffff);
-	info->cs = low >> 16;
-	info->flags = dpl;
+	info->address = gate_offset(*val);
+	info->cs = gate_segment(*val);
+	info->flags = val->dpl;
 	/* interrupt gates clear IF */
-	if (type == 0xe)
+	if (val->type == 0xe)
 		info->flags |= 4;
 
 	return 1;
@@ -430,11 +425,10 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
 
 	if (p >= start && (p + 8) <= end) {
 		struct trap_info info[2];
-		u32 *desc = (u32 *)g;
 
 		info[1].address = 0;
 
-		if (cvt_gate_to_trap(entrynum, desc[0], desc[1], &info[0]))
+		if (cvt_gate_to_trap(entrynum, g, &info[0]))
 			if (HYPERVISOR_set_trap_table(info))
 				BUG();
 	}
@@ -451,9 +445,9 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
 	BUG_ON(count > 256);
 
 	for (in = out = 0; in < count; in++) {
-		const u32 *entry = (u32 *)(desc->address + in * 8);
+		gate_desc *entry = (gate_desc*)(desc->address) + in;
 
-		if (cvt_gate_to_trap(in, entry[0], entry[1], &traps[out]))
+		if (cvt_gate_to_trap(in, entry, &traps[out]))
 			out++;
 	}
 	traps[out].address = 0;
-- 
1.5.4.1


linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch:

--- NEW FILE linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch ---
>From 8f86c0b1883d4cff94bba5e5e4ca4971d84f05c5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at Rawhide-64.localdomain>
Date: Tue, 27 Nov 2007 20:09:43 -0200
Subject: [PATCH] typedefs for pte_val() and friends

Trying to reduce the #ifdef mess a bit.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.h |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index b5e189b..ce425a4 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -37,15 +37,15 @@ void xen_exit_mmap(struct mm_struct *mm);
 void xen_pgd_pin(pgd_t *pgd);
 //void xen_pgd_unpin(pgd_t *pgd);
 
-#ifdef CONFIG_X86_PAE
-unsigned long long xen_pte_val(pte_t);
-unsigned long long xen_pmd_val(pmd_t);
-unsigned long long xen_pgd_val(pgd_t);
+pteval_t xen_pte_val(pte_t);
+pmdval_t xen_pmd_val(pmd_t);
+pgdval_t xen_pgd_val(pgd_t);
 
-pte_t xen_make_pte(unsigned long long);
-pmd_t xen_make_pmd(unsigned long long);
-pgd_t xen_make_pgd(unsigned long long);
+pte_t xen_make_pte(pteval_t);
+pmd_t xen_make_pmd(pmdval_t);
+pgd_t xen_make_pgd(pgdval_t);
 
+#ifdef CONFIG_X86_PAE
 void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
 		    pte_t *ptep, pte_t pteval);
 void xen_set_pte_atomic(pte_t *ptep, pte_t pte);
@@ -53,15 +53,6 @@ void xen_set_pud(pud_t *ptr, pud_t val);
 void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
 void xen_pmd_clear(pmd_t *pmdp);
 
-
-#else
-unsigned long xen_pte_val(pte_t);
-unsigned long xen_pmd_val(pmd_t);
-unsigned long xen_pgd_val(pgd_t);
-
-pte_t xen_make_pte(unsigned long);
-pmd_t xen_make_pmd(unsigned long);
-pgd_t xen_make_pgd(unsigned long);
 #endif
 
 #endif	/* _XEN_MMU_H */
-- 
1.5.4.1


linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch:

--- NEW FILE linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch ---
>From c795e42b2c24a5db4920990ae4b03dc6d246d941 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 Nov 2007 12:20:59 -0200
Subject: [PATCH] x86_64 implementation of some page.h macros

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/page.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index baf3a4d..3b5ba6e 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -151,14 +151,12 @@ static inline pte_t __pte_ma(pteval_t x)
 }
 
 #ifdef CONFIG_X86_PAE
-#define pmd_val_ma(v) ((v).pmd)
 #define pud_val_ma(v) ((v).pgd.pgd)
 #define __pmd_ma(x)	((pmd_t) { (x) } )
-#else  /* !X86_PAE */
-#define pmd_val_ma(v)	((v).pud.pgd.pgd)
 #endif	/* CONFIG_X86_PAE */
 
 #define pgd_val_ma(x)	((x).pgd)
+#define pmd_val_ma(x)	(native_pmd_val((x)))
 
 
 xmaddr_t arbitrary_virt_to_machine(unsigned long address);
-- 
1.5.4.1


linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch:

--- NEW FILE linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch ---
>From 9d3b116d2d48fe2cfa586c40fc78d9e2ac5285fa Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 Nov 2007 12:21:33 -0200
Subject: [PATCH] Chainsaw-style #ifdefs

Whee!

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    8 ++++++++
 arch/x86/xen/setup.c     |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index d2c152b..4f40352 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1217,6 +1217,7 @@ static const struct machine_ops __initdata xen_machine_ops = {
 };
 
 
+#ifdef CONFIG_X86_32
 static void __init xen_reserve_top(void)
 {
 	unsigned long top = HYPERVISOR_VIRT_START;
@@ -1227,6 +1228,9 @@ static void __init xen_reserve_top(void)
 
 	reserve_top_address(-top + 2 * PAGE_SIZE);
 }
+#else
+#define xen_reserve_top() do { } while (0)
+#endif
 
 /* First C function to be called on Xen boot */
 asmlinkage void __init xen_start_kernel(void)
@@ -1261,7 +1265,9 @@ asmlinkage void __init xen_start_kernel(void)
 
 	pgd = (pgd_t *)xen_start_info->pt_base;
 
+#ifdef CONFIG_X86_32
 	init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
+#endif
 
 	init_mm.pgd = pgd; /* use the Xen pagetables to start */
 
@@ -1281,10 +1287,12 @@ asmlinkage void __init xen_start_kernel(void)
 	/* set the limit of our address space */
 	xen_reserve_top();
 
+#ifdef CONFIG_X86_32
 	/* set up basic CPUID stuff */
 	cpu_detect(&new_cpu_data);
 	new_cpu_data.hard_math = 1;
 	new_cpu_data.x86_capability[0] = cpuid_edx(1);
+#endif
 
 	/* Poke various useful things into boot_params */
 	boot_params.hdr.type_of_loader = (9 << 4) | 0;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 2dabdfa..1c28b77 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -8,6 +8,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/pm.h>
+#include <linux/pfn.h>
 
 #include <asm/elf.h>
 #include <asm/vdso.h>
@@ -63,6 +64,7 @@ static void xen_idle(void)
 	}
 }
 
+#ifdef CONFIG_X86_32
 /*
  * Set the bit indicating "nosegneg" library variants should be used.
  */
@@ -72,6 +74,9 @@ static void __init fiddle_vdso(void)
 	u32 *mask = VDSO32_SYMBOL(&vdso32_default_start, NOTE_MASK);
 	*mask |= 1 << VDSO_NOTE_NONEGSEG_BIT;
 }
+#else
+#define fiddle_vdso() do { } while (0)
+#endif
 
 void xen_enable_sysenter(void)
 {
-- 
1.5.4.1


linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch:

--- NEW FILE linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch ---
>From b1c09934158c64a7e84aa35e1a0bcefa875e6d3a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 Nov 2007 17:53:17 -0200
Subject: [PATCH] xen: Make xen_pte_val() generic

Care is taken to make sure that all attribute bits
are left untouched by the address translation,
especially NX since it is a higher bit than all the
others.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index d3ee761..efac5e7 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -153,10 +153,14 @@ out:
 
 pteval_t xen_pte_val(pte_t pte)
 {
-	pteval_t ret = pte.pte;
+	pteval_t ret = pte_val_ma(pte);
 
-	if (ret & _PAGE_PRESENT)
-		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
+	if (ret & _PAGE_PRESENT) {
+		/* preserve all other pte bits */
+		unsigned long m = machine_to_phys(XMADDR(ret & PHYSICAL_PAGE_MASK)).paddr;
+		ret &= ~PHYSICAL_PAGE_MASK;
+		ret |= m;
+	}
 
 	return ret;
 }
-- 
1.5.4.1


linux-2.6-xen-0034-More-chainsaw-ifdefs.patch:

--- NEW FILE linux-2.6-xen-0034-More-chainsaw-ifdefs.patch ---
>From e572484163f54088a7d05ba456effa29c4ddf15e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 Nov 2007 17:54:25 -0200
Subject: [PATCH] More chainsaw-ifdefs

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c   |    5 +++++
 drivers/xen/events.c |   11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index efac5e7..77692cb 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -507,7 +507,12 @@ static void drop_other_mm_ref(void *info)
 {
 	struct mm_struct *mm = info;
 
+#ifdef CONFIG_X86_32
+	/*FIXME: better way to do this, avoiding #ifdefs */
 	if (__get_cpu_var(cpu_tlbstate).active_mm == mm)
+#else
+	if (read_pda(active_mm) == mm)
+#endif
 		leave_mm(smp_processor_id());
 
 	/* If this cpu still has a stale cr3 reference, then make sure
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 4f0f22b..1a8fa4b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -502,6 +502,12 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
 }
 
 
+/*FIXME: ugly */
+#ifdef CONFIG_X86_64
+extern asmlinkage unsigned int do_IRQ(struct pt_regs *regs);
+#endif
+
+
 /*
  * Search the CPUs pending events bitmasks.  For each one found, map
  * the event number to an irq, and feed it into do_IRQ() for
@@ -670,5 +676,8 @@ void __init xen_init_IRQ(void)
 	for (i = 0; i < NR_IRQS; i++)
 		irq_bindcount[i] = 0;
 
-	irq_ctx_init(smp_processor_id());
+#ifdef CONFIG_X86_32
+	/*FIXME: investigate this better */
+ 	irq_ctx_init(smp_processor_id());
+#endif
 }
-- 
1.5.4.1


linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch:

--- NEW FILE linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch ---
>From 6bb5b1404a0a1f2e79e6d2434a13cde7375a20e6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 Nov 2007 17:55:00 -0200
Subject: [PATCH] Chainsaw-ifdefs on assembly percpu handling

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>

Undo stupid code added when trying to make percpu work

Using 32-bit registers would never work.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/percpu.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h
index 938f493..6604529 100644
--- a/include/asm-x86/percpu.h
+++ b/include/asm-x86/percpu.h
@@ -9,6 +9,8 @@
    should be just put into a single section and referenced directly
    from %gs */
 
+#ifndef __ASSEMBLY__
+
 #ifdef CONFIG_SMP
 #include <asm/pda.h>
 
@@ -26,6 +28,8 @@ DECLARE_PER_CPU(struct x8664_pda, pda);
 #define x86_read_percpu(var) __get_cpu_var(var)
 #define x86_write_percpu(var,val) (__get_cpu_var(var) = (val))
 
+#endif
+
 #else /* CONFIG_X86_64 */
 
 #ifdef __ASSEMBLY__
-- 
1.5.4.1


linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch:

--- NEW FILE linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch ---
>From eb5c05ae5fecbfaf5670eb5ebf586ffaf67fdca7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 29 Nov 2007 16:05:08 -0200
Subject: [PATCH] x86_64 percpu assembly macros

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/percpu.h |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h
index 6604529..83fe34e 100644
--- a/include/asm-x86/percpu.h
+++ b/include/asm-x86/percpu.h
@@ -9,7 +9,31 @@
    should be just put into a single section and referenced directly
    from %gs */
 
-#ifndef __ASSEMBLY__
+#ifdef __ASSEMBLY__
+
+/*
+ * PER_CPU finds an address of a per-cpu variable.
+ *
+ * Args:
+ *    var - variable name
+ *    reg - 32bit register
+ *
+ * The resulting address is stored in the "reg" argument.
+ *
+ * Example:
+ *    PER_CPU(cpu_gdt_descr, %ebx)
+ */
+#ifdef CONFIG_SMP
+#define PER_CPU(var, reg)			\
+	movq %gs:pda_data_offset, reg;		\
+	lea per_cpu__##var(reg), reg
+#else /* ! SMP */
+#define PER_CPU(var, reg)			\
+	movl $per_cpu__##var, reg
+#define PER_CPU_VAR(var)	per_cpu__##var
+#endif	/* SMP */
+
+#else /* ...!ASSEMBLY */
 
 #ifdef CONFIG_SMP
 #include <asm/pda.h>
-- 
1.5.4.1


linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch:

--- NEW FILE linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch ---
>From 3db6bb0f351b3ee2aa91fcb3c1d317e107f97e26 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 29 Nov 2007 16:06:30 -0200
Subject: [PATCH] Some xen-asm.S x86_64 code

Funny preprocessor tricks to make the same code work on both arches
included.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/xen-asm.S |   55 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 2497a30..f61e5e5 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -24,6 +24,28 @@
 #define RELOC(x, v)	.globl x##_reloc; x##_reloc=v
 #define ENDPATCH(x)	.globl x##_end; x##_end=.
 
+#ifdef CONFIG_X86_64
+#  define SUFFIX  q
+#  define REGPREF r
+#else
+#  define SUFFIX  l
+#  define REGPREF e
+#endif
+
+#define  __REG(pref, reg) %pref##reg
+#define  _REG(pref, reg) __REG(pref, reg)
+#define  REG(reg) _REG(REGPREF, reg)
+
+#define  __INSN(in, suff) in##suff
+#define  _INSN(in, suff) __INSN(in, suff)
+#define  INSN(in) _INSN(in, SUFFIX)
+
+#define  rAX REG(ax)
+#define  rSP REG(sp)
+#define  MOV INSN(mov)
+#define  AND INSN(and)
+
+
 /* Pseudo-flag used for virtual NMI, which we don't implement yet */
 #define XEN_EFLAGS_NMI	0x80000000
 
@@ -34,14 +56,24 @@
  */
 ENTRY(xen_irq_enable_direct)
 	/* Unmask events */
+#ifdef PER_CPU_VAR
 	movb $0, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
+#else
+	PER_CPU(xen_vcpu_info, rAX)
+	movb $0, XEN_vcpu_info_mask(rAX)
+#endif
 
 	/* Preempt here doesn't matter because that will deal with
 	   any pending interrupts.  The pending check may end up being
 	   run on the wrong CPU, but that doesn't hurt. */
 
 	/* Test for pending */
+#ifdef PER_CPU_VAR
 	testb $0xff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
+#else
+	/* rAX already points to xen_vcpu_info */
+	testb $0xff, XEN_vcpu_info_pending(rAX)
+#endif
 	jz 1f
 
 2:	call check_events
@@ -57,7 +89,12 @@ ENDPATCH(xen_irq_enable_direct)
 	non-zero.
  */
 ENTRY(xen_irq_disable_direct)
+#ifdef PER_CPU_VAR
 	movb $1, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
+#else
+	PER_CPU(xen_vcpu_info, rAX)
+	movb $1, XEN_vcpu_info_mask(rAX)
+#endif
 ENDPATCH(xen_irq_disable_direct)
 	ret
 	ENDPROC(xen_irq_disable_direct)
@@ -73,7 +110,12 @@ ENDPATCH(xen_irq_disable_direct)
 	Xen and x86 use opposite senses (mask vs enable).
  */
 ENTRY(xen_save_fl_direct)
+#ifdef PER_CPU_VAR
 	testb $0xff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
+#else
+	PER_CPU(xen_vcpu_info, rAX)
+	testb $0xff, XEN_vcpu_info_mask(rAX)
+#endif
 	setz %ah
 	addb %ah,%ah
 ENDPATCH(xen_save_fl_direct)
@@ -92,13 +134,23 @@ ENDPATCH(xen_save_fl_direct)
  */
 ENTRY(xen_restore_fl_direct)
 	testb $X86_EFLAGS_IF>>8, %ah
+#ifdef PER_CPU_VAR
 	setz PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
+#else
+	PER_CPU(xen_vcpu_info, rAX)
+	setz XEN_vcpu_info_mask(rAX)
+#endif
 	/* Preempt here doesn't matter because that will deal with
 	   any pending interrupts.  The pending check may end up being
 	   run on the wrong CPU, but that doesn't hurt. */
 
 	/* check for unmasked and pending */
+#ifdef PER_CPU_VAR
 	cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
+#else
+	/* rAX already points to xen_vcpu_info */
+	cmpw $0x0001, XEN_vcpu_info_pending(rAX)
+#endif
 	jz 1f
 2:	call check_events
 1:
@@ -152,7 +204,8 @@ ENDPROC(xen_sysexit)
  */
 ENTRY(xen_iret)
 	/* test eflags for special cases */
-	testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp)
+	/*FIXME: use right offset for rFLAGS */
+	testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(rSP)
 	jnz hyper_iret
 
 	push %eax
-- 
1.5.4.1


linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch:

--- NEW FILE linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch ---
>From 4d5d2fcb93fe425e3b991a8f6bf324a6c52a46cf Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 3 Dec 2007 17:28:38 -0200
Subject: [PATCH] Chainsaw party (SPLITME)

:D

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/asm-offsets_64.c |   15 +++
 arch/x86/kernel/entry_32.S       |   91 +----------------
 arch/x86/kernel/entry_64.S       |    4 +
 arch/x86/kernel/head_64.S        |    3 +
 arch/x86/xen/enlighten.c         |    3 +
 arch/x86/xen/entry.S             |    5 +
 arch/x86/xen/entry_32.S          |   89 +++++++++++++++
 arch/x86/xen/entry_64.S          |    1 +
 arch/x86/xen/smp.c               |   16 +++
 arch/x86/xen/xen-asm.S           |  220 +-------------------------------------
 arch/x86/xen/xen-asm_32.S        |  197 ++++++++++++++++++++++++++++++++++
 arch/x86/xen/xen-asm_64.S        |    8 ++
 arch/x86/xen/xen-head.S          |   20 +++-
 include/asm-x86/asm-hack.h       |   27 +++++
 include/linux/elfnote.h          |    2 +-
 include/xen/interface/elfnote.h  |   16 +++
 16 files changed, 406 insertions(+), 311 deletions(-)
 create mode 100644 arch/x86/xen/entry.S
 create mode 100644 arch/x86/xen/entry_32.S
 create mode 100644 arch/x86/xen/entry_64.S
 create mode 100644 arch/x86/xen/xen-asm_32.S
 create mode 100644 arch/x86/xen/xen-asm_64.S
 create mode 100644 include/asm-x86/asm-hack.h

diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index f126c05..23b6d28 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -18,6 +18,8 @@
 #include <asm/ia32.h>
 #include <asm/bootparam.h>
 
+#include <xen/interface/xen.h>
+
 #define __NO_STUBS 1
 #undef __SYSCALL
 #undef _ASM_X86_64_UNISTD_H_
@@ -85,6 +87,13 @@ int main(void)
 	       offsetof (struct rt_sigframe32, uc.uc_mcontext));
 	BLANK();
 #endif
+
+#ifdef CONFIG_XEN
+	BLANK();
+	OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
+	OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
+#endif
+
 	DEFINE(pbe_address, offsetof(struct pbe, address));
 	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
 	DEFINE(pbe_next, offsetof(struct pbe, next));
@@ -123,6 +132,12 @@ int main(void)
 	BLANK();
 	DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
 
+	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+	DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
+	DEFINE(PTRS_PER_PTE, PTRS_PER_PTE);
+	DEFINE(PTRS_PER_PMD, PTRS_PER_PMD);
+	DEFINE(PTRS_PER_PGD, PTRS_PER_PGD);
+
 	BLANK();
 	OFFSET(BP_scratch, boot_params, scratch);
 	OFFSET(BP_loadflags, boot_params, hdr.loadflags);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c778e4f..043d7aa 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1018,96 +1018,7 @@ ENTRY(kernel_thread_helper)
 ENDPROC(kernel_thread_helper)
 
 #ifdef CONFIG_XEN
-/* Xen doesn't set %esp to be precisely what the normal sysenter
-   entrypoint expects, so fix it up before using the normal path. */
-ENTRY(xen_sysenter_target)
-	RING0_INT_FRAME
-	addl $5*4, %esp		/* remove xen-provided frame */
-	jmp sysenter_past_esp
-
-ENTRY(xen_hypervisor_callback)
-	CFI_STARTPROC
-	pushl $0
-	CFI_ADJUST_CFA_OFFSET 4
-	SAVE_ALL
-	TRACE_IRQS_OFF
-
-	/* Check to see if we got the event in the critical
-	   region in xen_iret_direct, after we've reenabled
-	   events and checked for pending events.  This simulates
-	   iret instruction's behaviour where it delivers a
-	   pending interrupt when enabling interrupts. */
-	movl PT_EIP(%esp),%eax
-	cmpl $xen_iret_start_crit,%eax
-	jb   1f
-	cmpl $xen_iret_end_crit,%eax
-	jae  1f
-
-	jmp  xen_iret_crit_fixup
-
-ENTRY(xen_do_upcall)
-1:	mov %esp, %eax
-	call xen_evtchn_do_upcall
-	jmp  ret_from_intr
-	CFI_ENDPROC
-ENDPROC(xen_hypervisor_callback)
-
-# Hypervisor uses this for application faults while it executes.
-# We get here for two reasons:
-#  1. Fault while reloading DS, ES, FS or GS
-#  2. Fault while executing IRET
-# Category 1 we fix up by reattempting the load, and zeroing the segment
-# register if the load fails.
-# Category 2 we fix up by jumping to do_iret_error. We cannot use the
-# normal Linux return path in this case because if we use the IRET hypercall
-# to pop the stack frame we end up in an infinite loop of failsafe callbacks.
-# We distinguish between categories by maintaining a status value in EAX.
-ENTRY(xen_failsafe_callback)
-	CFI_STARTPROC
-	pushl %eax
-	CFI_ADJUST_CFA_OFFSET 4
-	movl $1,%eax
-1:	mov 4(%esp),%ds
-2:	mov 8(%esp),%es
-3:	mov 12(%esp),%fs
-4:	mov 16(%esp),%gs
-	testl %eax,%eax
-	popl %eax
-	CFI_ADJUST_CFA_OFFSET -4
-	lea 16(%esp),%esp
-	CFI_ADJUST_CFA_OFFSET -16
-	jz 5f
-	addl $16,%esp
-	jmp iret_exc		# EAX != 0 => Category 2 (Bad IRET)
-5:	pushl $0		# EAX == 0 => Category 1 (Bad segment)
-	CFI_ADJUST_CFA_OFFSET 4
-	SAVE_ALL
-	jmp ret_from_exception
-	CFI_ENDPROC
-
-.section .fixup,"ax"
-6:	xorl %eax,%eax
-	movl %eax,4(%esp)
-	jmp 1b
-7:	xorl %eax,%eax
-	movl %eax,8(%esp)
-	jmp 2b
-8:	xorl %eax,%eax
-	movl %eax,12(%esp)
-	jmp 3b
-9:	xorl %eax,%eax
-	movl %eax,16(%esp)
-	jmp 4b
-.previous
-.section __ex_table,"a"
-	.align 4
-	.long 1b,6b
-	.long 2b,7b
-	.long 3b,8b
-	.long 4b,9b
-.previous
-ENDPROC(xen_failsafe_callback)
-
+#include "../xen/entry_32.S"
 #endif	/* CONFIG_XEN */
 
 .section .rodata,"a"
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 556a8df..3fedbd6 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1202,3 +1202,7 @@ KPROBE_ENTRY(ignore_sysret)
 	sysret
 	CFI_ENDPROC
 ENDPROC(ignore_sysret)
+
+#ifdef CONFIG_XEN
+#include "../xen/entry_64.S"
+#endif	/* CONFIG_XEN */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 10a1955..27d8f6e 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -411,6 +411,9 @@ ENTRY(phys_base)
 	/* This must match the first entry in level2_kernel_pgt */
 	.quad   0x0000000000000000
 
+#include "../../x86/xen/xen-head.S"
+
+
 /* We need valid kernel segments for data and code in long mode too
  * IRET will check the segment types  kkeil 2000/10/28
  * Also sysret mandates a special GDT layout 
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 4f40352..b7e7b55 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1251,7 +1251,10 @@ asmlinkage void __init xen_start_kernel(void)
 	pv_apic_ops = xen_apic_ops;
 	pv_mmu_ops = xen_mmu_ops;
 
+#ifdef CONFIG_X86_32
+	/*FIXME: implement me! */
 	machine_ops = xen_machine_ops;
+#endif
 
 #ifdef CONFIG_SMP
 	smp_ops = xen_smp_ops;
diff --git a/arch/x86/xen/entry.S b/arch/x86/xen/entry.S
new file mode 100644
index 0000000..1e7551e
--- /dev/null
+++ b/arch/x86/xen/entry.S
@@ -0,0 +1,5 @@
+#ifdef CONFIG_X86_64
+#  include "entry_64.S"
+#else
+#  include "entry_32.S"
+#endif
diff --git a/arch/x86/xen/entry_32.S b/arch/x86/xen/entry_32.S
new file mode 100644
index 0000000..efa56a3
--- /dev/null
+++ b/arch/x86/xen/entry_32.S
@@ -0,0 +1,89 @@
+/* Xen doesn't set %esp to be precisely what the normal sysenter
+   entrypoint expects, so fix it up before using the normal path. */
+ENTRY(xen_sysenter_target)
+	RING0_INT_FRAME
+	addl $5*4, %esp		/* remove xen-provided frame */
+	jmp sysenter_past_esp
+
+ENTRY(xen_hypervisor_callback)
+	CFI_STARTPROC
+	pushl $0
+	CFI_ADJUST_CFA_OFFSET 4
+	SAVE_ALL
+	TRACE_IRQS_OFF
+
+	/* Check to see if we got the event in the critical
+	   region in xen_iret_direct, after we've reenabled
+	   events and checked for pending events.  This simulates
+	   iret instruction's behaviour where it delivers a
+	   pending interrupt when enabling interrupts. */
+	movl PT_EIP(%esp),%eax
+	cmpl $xen_iret_start_crit,%eax
+	jb   1f
+	cmpl $xen_iret_end_crit,%eax
+	jae  1f
+
+	jmp  xen_iret_crit_fixup
+
+ENTRY(xen_do_upcall)
+1:	mov %esp, %eax
+	call xen_evtchn_do_upcall
+	jmp  ret_from_intr
+	CFI_ENDPROC
+ENDPROC(xen_hypervisor_callback)
+
+# Hypervisor uses this for application faults while it executes.
+# We get here for two reasons:
+#  1. Fault while reloading DS, ES, FS or GS
+#  2. Fault while executing IRET
+# Category 1 we fix up by reattempting the load, and zeroing the segment
+# register if the load fails.
+# Category 2 we fix up by jumping to do_iret_error. We cannot use the
+# normal Linux return path in this case because if we use the IRET hypercall
+# to pop the stack frame we end up in an infinite loop of failsafe callbacks.
+# We distinguish between categories by maintaining a status value in EAX.
+ENTRY(xen_failsafe_callback)
+	CFI_STARTPROC
+	pushl %eax
+	CFI_ADJUST_CFA_OFFSET 4
+	movl $1,%eax
+1:	mov 4(%esp),%ds
+2:	mov 8(%esp),%es
+3:	mov 12(%esp),%fs
+4:	mov 16(%esp),%gs
+	testl %eax,%eax
+	popl %eax
+	CFI_ADJUST_CFA_OFFSET -4
+	lea 16(%esp),%esp
+	CFI_ADJUST_CFA_OFFSET -16
+	jz 5f
+	addl $16,%esp
+	jmp iret_exc		# EAX != 0 => Category 2 (Bad IRET)
+5:	pushl $0		# EAX == 0 => Category 1 (Bad segment)
+	CFI_ADJUST_CFA_OFFSET 4
+	SAVE_ALL
+	jmp ret_from_exception
+	CFI_ENDPROC
+
+.section .fixup,"ax"
+6:	xorl %eax,%eax
+	movl %eax,4(%esp)
+	jmp 1b
+7:	xorl %eax,%eax
+	movl %eax,8(%esp)
+	jmp 2b
+8:	xorl %eax,%eax
+	movl %eax,12(%esp)
+	jmp 3b
+9:	xorl %eax,%eax
+	movl %eax,16(%esp)
+	jmp 4b
+.previous
+.section __ex_table,"a"
+	.align 4
+	.long 1b,6b
+	.long 2b,7b
+	.long 3b,8b
+	.long 4b,9b
+.previous
+ENDPROC(xen_failsafe_callback)
diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
new file mode 100644
index 0000000..c8c1473
--- /dev/null
+++ b/arch/x86/xen/entry_64.S
@@ -0,0 +1 @@
+#error foo
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 94e6900..c1ed5a5 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -154,7 +154,10 @@ void __init xen_smp_prepare_boot_cpu(void)
 
 	/* We've switched to the "real" per-cpu gdt, so make sure the
 	   old memory can be recycled */
+#ifdef CONFIG_X86_32
+	//FIXME: implement this on 64-bit
 	make_lowmem_page_readwrite(&per_cpu__gdt_page);
+#endif
 
 	for_each_possible_cpu(cpu) {
 		cpus_clear(per_cpu(cpu_sibling_map, cpu));
@@ -217,6 +220,8 @@ void __init xen_smp_prepare_cpus(unsigned int max_cpus)
 static __cpuinit int
 cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
 {
+/*FIXME: implement me */
+#ifdef CONFIG_X86_32
 	struct vcpu_guest_context *ctxt;
 	struct gdt_page *gdt = &per_cpu(gdt_page, cpu);
 
@@ -266,11 +271,14 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
 		BUG();
 
 	kfree(ctxt);
+#endif
 	return 0;
 }
 
 int __cpuinit xen_cpu_up(unsigned int cpu)
 {
+//FIXME: implement me!
+#ifdef CONFIG_X86_32
 	struct task_struct *idle = idle_task(cpu);
 	int rc;
 
@@ -309,6 +317,7 @@ int __cpuinit xen_cpu_up(unsigned int cpu)
 	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
 	BUG_ON(rc);
 
+#endif
 	return 0;
 }
 
@@ -318,6 +327,8 @@ void xen_smp_cpus_done(unsigned int max_cpus)
 
 static void stop_self(void *v)
 {
+//FIXME: implement me!
+#ifdef CONFIG_X86_32
 	int cpu = smp_processor_id();
 
 	/* make sure we're not pinning something down */
@@ -326,6 +337,7 @@ static void stop_self(void *v)
 
 	HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL);
 	BUG();
+#endif
 }
 
 void xen_smp_send_stop(void)
@@ -366,7 +378,11 @@ static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
 	 */
 	irq_enter();
 	(*func)(info);
+#ifdef CONFIG_X86_32
 	__get_cpu_var(irq_stat).irq_call_count++;
+#else
+	add_pda(irq_call_count, 1);
+#endif
 	irq_exit();
 
 	if (wait) {
diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index f61e5e5..2b4cd7d 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -18,33 +18,13 @@
 #include <asm/percpu.h>
 #include <asm/processor-flags.h>
 #include <asm/segment.h>
+#include <asm/asm-hack.h>
 
 #include <xen/interface/xen.h>
 
 #define RELOC(x, v)	.globl x##_reloc; x##_reloc=v
 #define ENDPATCH(x)	.globl x##_end; x##_end=.
 
-#ifdef CONFIG_X86_64
-#  define SUFFIX  q
-#  define REGPREF r
-#else
-#  define SUFFIX  l
-#  define REGPREF e
-#endif
-
-#define  __REG(pref, reg) %pref##reg
-#define  _REG(pref, reg) __REG(pref, reg)
-#define  REG(reg) _REG(REGPREF, reg)
-
-#define  __INSN(in, suff) in##suff
-#define  _INSN(in, suff) __INSN(in, suff)
-#define  INSN(in) _INSN(in, SUFFIX)
-
-#define  rAX REG(ax)
-#define  rSP REG(sp)
-#define  MOV INSN(mov)
-#define  AND INSN(and)
-
 
 /* Pseudo-flag used for virtual NMI, which we don't implement yet */
 #define XEN_EFLAGS_NMI	0x80000000
@@ -159,200 +139,8 @@ ENDPATCH(xen_restore_fl_direct)
 	ENDPROC(xen_restore_fl_direct)
 	RELOC(xen_restore_fl_direct, 2b+1)
 
-/*
-	We can't use sysexit directly, because we're not running in ring0.
-	But we can easily fake it up using iret.  Assuming xen_sysexit
-	is jumped to with a standard stack frame, we can just strip it
-	back to a standard iret frame and use iret.
- */
-ENTRY(xen_sysexit)
-	movl PT_EAX(%esp), %eax			/* Shouldn't be necessary? */
-	orl $X86_EFLAGS_IF, PT_EFLAGS(%esp)
-	lea PT_EIP(%esp), %esp
-
-	jmp xen_iret
-ENDPROC(xen_sysexit)
-
-/*
-	This is run where a normal iret would be run, with the same stack setup:
-	      8: eflags
-	      4: cs
-	esp-> 0: eip
-
-	This attempts to make sure that any pending events are dealt
-	with on return to usermode, but there is a small window in
-	which an event can happen just before entering usermode.  If
-	the nested interrupt ends up setting one of the TIF_WORK_MASK
-	pending work flags, they will not be tested again before
-	returning to usermode. This means that a process can end up
-	with pending work, which will be unprocessed until the process
-	enters and leaves the kernel again, which could be an
-	unbounded amount of time.  This means that a pending signal or
-	reschedule event could be indefinitely delayed.
-
-	The fix is to notice a nested interrupt in the critical
-	window, and if one occurs, then fold the nested interrupt into
-	the current interrupt stack frame, and re-process it
-	iteratively rather than recursively.  This means that it will
-	exit via the normal path, and all pending work will be dealt
-	with appropriately.
-
-	Because the nested interrupt handler needs to deal with the
-	current stack state in whatever form its in, we keep things
-	simple by only using a single register which is pushed/popped
-	on the stack.
- */
-ENTRY(xen_iret)
-	/* test eflags for special cases */
-	/*FIXME: use right offset for rFLAGS */
-	testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(rSP)
-	jnz hyper_iret
-
-	push %eax
-	ESP_OFFSET=4	# bytes pushed onto stack
-
-	/* Store vcpu_info pointer for easy access.  Do it this
-	   way to avoid having to reload %fs */
-#ifdef CONFIG_SMP
-	GET_THREAD_INFO(%eax)
-	movl TI_cpu(%eax),%eax
-	movl __per_cpu_offset(,%eax,4),%eax
-	mov per_cpu__xen_vcpu(%eax),%eax
+#ifdef CONFIG_X86_64
+#include "xen-asm_64.S"
 #else
-	movl per_cpu__xen_vcpu, %eax
+#include "xen-asm_32.S"
 #endif
-
-	/* check IF state we're restoring */
-	testb $X86_EFLAGS_IF>>8, 8+1+ESP_OFFSET(%esp)
-
-	/* Maybe enable events.  Once this happens we could get a
-	   recursive event, so the critical region starts immediately
-	   afterwards.  However, if that happens we don't end up
-	   resuming the code, so we don't have to be worried about
-	   being preempted to another CPU. */
-	setz XEN_vcpu_info_mask(%eax)
-xen_iret_start_crit:
-
-	/* check for unmasked and pending */
-	cmpw $0x0001, XEN_vcpu_info_pending(%eax)
-
-	/* If there's something pending, mask events again so we
-	   can jump back into xen_hypervisor_callback */
-	sete XEN_vcpu_info_mask(%eax)
-
-	popl %eax
-
-	/* From this point on the registers are restored and the stack
-	   updated, so we don't need to worry about it if we're preempted */
-iret_restore_end:
-
-	/* Jump to hypervisor_callback after fixing up the stack.
-	   Events are masked, so jumping out of the critical
-	   region is OK. */
-	je xen_hypervisor_callback
-
-1:	iret
-xen_iret_end_crit:
-.section __ex_table,"a"
-	.align 4
-	.long 1b,iret_exc
-.previous
-
-hyper_iret:
-	/* put this out of line since its very rarely used */
-	jmp hypercall_page + __HYPERVISOR_iret * 32
-
-	.globl xen_iret_start_crit, xen_iret_end_crit
-
-/*
-   This is called by xen_hypervisor_callback in entry.S when it sees
-   that the EIP at the time of interrupt was between xen_iret_start_crit
-   and xen_iret_end_crit.  We're passed the EIP in %eax so we can do
-   a more refined determination of what to do.
-
-   The stack format at this point is:
-	----------------
-	 ss		: (ss/esp may be present if we came from usermode)
-	 esp		:
-	 eflags		}  outer exception info
-	 cs		}
-	 eip		}
-	---------------- <- edi (copy dest)
-	 eax		:  outer eax if it hasn't been restored
-	----------------
-	 eflags		}  nested exception info
-	 cs		}   (no ss/esp because we're nested
-	 eip		}    from the same ring)
-	 orig_eax	}<- esi (copy src)
-	 - - - - - - - -
-	 fs		}
-	 es		}
-	 ds		}  SAVE_ALL state
-	 eax		}
-	  :		:
-	 ebx		}<- esp
-	----------------
-
-   In order to deliver the nested exception properly, we need to shift
-   everything from the return addr up to the error code so it
-   sits just under the outer exception info.  This means that when we
-   handle the exception, we do it in the context of the outer exception
-   rather than starting a new one.
-
-   The only caveat is that if the outer eax hasn't been
-   restored yet (ie, it's still on stack), we need to insert
-   its value into the SAVE_ALL state before going on, since
-   it's usermode state which we eventually need to restore.
- */
-ENTRY(xen_iret_crit_fixup)
-	/*
-	   Paranoia: Make sure we're really coming from kernel space.
-	   One could imagine a case where userspace jumps into the
-	   critical range address, but just before the CPU delivers a GP,
-	   it decides to deliver an interrupt instead.  Unlikely?
-	   Definitely.  Easy to avoid?  Yes.  The Intel documents
-	   explicitly say that the reported EIP for a bad jump is the
-	   jump instruction itself, not the destination, but some virtual
-	   environments get this wrong.
-	 */
-	movl PT_CS(%esp), %ecx
-	andl $SEGMENT_RPL_MASK, %ecx
-	cmpl $USER_RPL, %ecx
-	je 2f
-
-	lea PT_ORIG_EAX(%esp), %esi
-	lea PT_EFLAGS(%esp), %edi
-
-	/* If eip is before iret_restore_end then stack
-	   hasn't been restored yet. */
-	cmp $iret_restore_end, %eax
-	jae 1f
-
-	movl 0+4(%edi),%eax		/* copy EAX (just above top of frame) */
-	movl %eax, PT_EAX(%esp)
-
-	lea ESP_OFFSET(%edi),%edi	/* move dest up over saved regs */
-
-	/* set up the copy */
-1:	std
-	mov $PT_EIP / 4, %ecx		/* saved regs up to orig_eax */
-	rep movsl
-	cld
-
-	lea 4(%edi),%esp		/* point esp to new frame */
-2:	jmp xen_do_upcall
-
-
-/*
-	Force an event check by making a hypercall,
-	but preserve regs before making the call.
- */
-check_events:
-	push %eax
-	push %ecx
-	push %edx
-	call force_evtchn_callback
-	pop %edx
-	pop %ecx
-	pop %eax
-	ret
diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S
new file mode 100644
index 0000000..f56902a
--- /dev/null
+++ b/arch/x86/xen/xen-asm_32.S
@@ -0,0 +1,197 @@
+/*
+	We can't use sysexit directly, because we're not running in ring0.
+	But we can easily fake it up using iret.  Assuming xen_sysexit
+	is jumped to with a standard stack frame, we can just strip it
+	back to a standard iret frame and use iret.
+ */
+ENTRY(xen_sysexit)
+	movl PT_EAX(%esp), %eax			/* Shouldn't be necessary? */
+	orl $X86_EFLAGS_IF, PT_EFLAGS(%esp)
+	lea PT_EIP(%esp), %esp
+
+	jmp xen_iret
+ENDPROC(xen_sysexit)
+
+/*
+	This is run where a normal iret would be run, with the same stack setup:
+	      8: eflags
+	      4: cs
+	esp-> 0: eip
+
+	This attempts to make sure that any pending events are dealt
+	with on return to usermode, but there is a small window in
+	which an event can happen just before entering usermode.  If
+	the nested interrupt ends up setting one of the TIF_WORK_MASK
+	pending work flags, they will not be tested again before
+	returning to usermode. This means that a process can end up
+	with pending work, which will be unprocessed until the process
+	enters and leaves the kernel again, which could be an
+	unbounded amount of time.  This means that a pending signal or
+	reschedule event could be indefinitely delayed.
+
+	The fix is to notice a nested interrupt in the critical
+	window, and if one occurs, then fold the nested interrupt into
+	the current interrupt stack frame, and re-process it
+	iteratively rather than recursively.  This means that it will
+	exit via the normal path, and all pending work will be dealt
+	with appropriately.
+
+	Because the nested interrupt handler needs to deal with the
+	current stack state in whatever form its in, we keep things
+	simple by only using a single register which is pushed/popped
+	on the stack.
+ */
+ENTRY(xen_iret)
+	/* test eflags for special cases */
+	/*FIXME: use right offset for rFLAGS */
+	testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(rSP)
+	jnz hyper_iret
+
+	push %eax
+	ESP_OFFSET=4	# bytes pushed onto stack
+
+	/* Store vcpu_info pointer for easy access.  Do it this
+	   way to avoid having to reload %fs */
+#ifdef CONFIG_SMP
+	GET_THREAD_INFO(%eax)
+	movl TI_cpu(%eax),%eax
+	movl __per_cpu_offset(,%eax,4),%eax
+	mov per_cpu__xen_vcpu(%eax),%eax
+#else
+	movl per_cpu__xen_vcpu, %eax
+#endif
+
+	/* check IF state we're restoring */
+	testb $X86_EFLAGS_IF>>8, 8+1+ESP_OFFSET(%esp)
+
+	/* Maybe enable events.  Once this happens we could get a
+	   recursive event, so the critical region starts immediately
+	   afterwards.  However, if that happens we don't end up
+	   resuming the code, so we don't have to be worried about
+	   being preempted to another CPU. */
+	setz XEN_vcpu_info_mask(%eax)
+xen_iret_start_crit:
+
+	/* check for unmasked and pending */
+	cmpw $0x0001, XEN_vcpu_info_pending(%eax)
+
+	/* If there's something pending, mask events again so we
+	   can jump back into xen_hypervisor_callback */
+	sete XEN_vcpu_info_mask(%eax)
+
+	popl %eax
+
+	/* From this point on the registers are restored and the stack
+	   updated, so we don't need to worry about it if we're preempted */
+iret_restore_end:
+
+	/* Jump to hypervisor_callback after fixing up the stack.
+	   Events are masked, so jumping out of the critical
+	   region is OK. */
+	je xen_hypervisor_callback
+
+1:	iret
+xen_iret_end_crit:
+.section __ex_table,"a"
+	.align 4
+	.long 1b,iret_exc
+.previous
+
+hyper_iret:
+	/* put this out of line since its very rarely used */
+	jmp hypercall_page + __HYPERVISOR_iret * 32
+
+	.globl xen_iret_start_crit, xen_iret_end_crit
+
+/*
+   This is called by xen_hypervisor_callback in entry.S when it sees
+   that the EIP at the time of interrupt was between xen_iret_start_crit
+   and xen_iret_end_crit.  We're passed the EIP in %eax so we can do
+   a more refined determination of what to do.
+
+   The stack format at this point is:
+	----------------
+	 ss		: (ss/esp may be present if we came from usermode)
+	 esp		:
+	 eflags		}  outer exception info
+	 cs		}
+	 eip		}
+	---------------- <- edi (copy dest)
+	 eax		:  outer eax if it hasn't been restored
+	----------------
+	 eflags		}  nested exception info
+	 cs		}   (no ss/esp because we're nested
+	 eip		}    from the same ring)
+	 orig_eax	}<- esi (copy src)
+	 - - - - - - - -
+	 fs		}
+	 es		}
+	 ds		}  SAVE_ALL state
+	 eax		}
+	  :		:
+	 ebx		}<- esp
+	----------------
+
+   In order to deliver the nested exception properly, we need to shift
+   everything from the return addr up to the error code so it
+   sits just under the outer exception info.  This means that when we
+   handle the exception, we do it in the context of the outer exception
+   rather than starting a new one.
+
+   The only caveat is that if the outer eax hasn't been
+   restored yet (ie, it's still on stack), we need to insert
+   its value into the SAVE_ALL state before going on, since
+   it's usermode state which we eventually need to restore.
+ */
+ENTRY(xen_iret_crit_fixup)
+	/*
+	   Paranoia: Make sure we're really coming from kernel space.
+	   One could imagine a case where userspace jumps into the
+	   critical range address, but just before the CPU delivers a GP,
+	   it decides to deliver an interrupt instead.  Unlikely?
+	   Definitely.  Easy to avoid?  Yes.  The Intel documents
+	   explicitly say that the reported EIP for a bad jump is the
+	   jump instruction itself, not the destination, but some virtual
+	   environments get this wrong.
+	 */
+	movl PT_CS(%esp), %ecx
+	andl $SEGMENT_RPL_MASK, %ecx
+	cmpl $USER_RPL, %ecx
+	je 2f
+
+	lea PT_ORIG_EAX(%esp), %esi
+	lea PT_EFLAGS(%esp), %edi
+
+	/* If eip is before iret_restore_end then stack
+	   hasn't been restored yet. */
+	cmp $iret_restore_end, %eax
+	jae 1f
+
+	movl 0+4(%edi),%eax		/* copy EAX (just above top of frame) */
+	movl %eax, PT_EAX(%esp)
+
+	lea ESP_OFFSET(%edi),%edi	/* move dest up over saved regs */
+
+	/* set up the copy */
+1:	std
+	mov $PT_EIP / 4, %ecx		/* saved regs up to orig_eax */
+	rep movsl
+	cld
+
+	lea 4(%edi),%esp		/* point esp to new frame */
+2:	jmp xen_do_upcall
+
+
+/*
+	Force an event check by making a hypercall,
+	but preserve regs before making the call.
+ */
+check_events:
+	push %eax
+	push %ecx
+	push %edx
+	call force_evtchn_callback
+	pop %edx
+	pop %ecx
+	pop %eax
+	ret
diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
new file mode 100644
index 0000000..38443b8
--- /dev/null
+++ b/arch/x86/xen/xen-asm_64.S
@@ -0,0 +1,8 @@
+check_events:
+	/*FIXME: implement me! */
+	ud2a
+
+
+ENTRY(xen_iret_direct)
+	/*FIXME: implement me! */
+	ud2a
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 288d587..ec5d622 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -7,12 +7,14 @@
 #include <linux/init.h>
 #include <asm/boot.h>
 #include <xen/interface/elfnote.h>
+#include <asm/asm-hack.h>
+
 
 	__INIT
 ENTRY(startup_xen)
-	movl %esi,xen_start_info
+ 	MOV rSI,xen_start_info
 	cld
-	movl $(init_thread_union+THREAD_SIZE),%esp
+ 	MOV $(init_thread_union+THREAD_SIZE),rSP
 	jmp xen_start_kernel
 
 	__FINIT
@@ -26,14 +28,24 @@ ENTRY(hypercall_page)
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
 	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
+#ifdef CONFIG_X86_32
 	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .long  __PAGE_OFFSET)
 	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long  startup_xen)
 	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long  hypercall_page)
+#else
+	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad  __START_KERNEL_map)
+	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad  0)
+	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad  startup_64)
+	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad  _PAGE_PRESENT,_PAGE_PRESENT)
+#endif
+
 	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
-#ifdef CONFIG_X86_PAE
+#ifdef CONFIG_X86_32
+#  ifdef CONFIG_X86_PAE
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
-#else
+#  else
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "no")
+#  endif
 #endif
 	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
 
diff --git a/include/asm-x86/asm-hack.h b/include/asm-x86/asm-hack.h
new file mode 100644
index 0000000..b7c2a66
--- /dev/null
+++ b/include/asm-x86/asm-hack.h
@@ -0,0 +1,27 @@
+#ifndef __ASM_ASM_HACK_H
+
+#ifdef CONFIG_X86_64
+#  define SUFFIX  q
+#  define REGPREF r
+#else
+#  define SUFFIX  l
+#  define REGPREF e
+#endif
+
+#define  __REG(pref, reg) %pref##reg
+#define  _REG(pref, reg) __REG(pref, reg)
+#define  REG(reg) _REG(REGPREF, reg)
+
+#define  __INSN(in, suff) in##suff
+#define  _INSN(in, suff) __INSN(in, suff)
+#define  INSN(in) _INSN(in, SUFFIX)
+
+#define  rAX REG(ax)
+#define  rSP REG(sp)
+#define  rSI REG(si)
+#define  rDI REG(di)
+
+#define  MOV INSN(mov)
+#define  AND INSN(and)
+
+#endif /* __ASM_ASM_HACK_H */
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 278e3ef..9f9816a 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -52,7 +52,7 @@
 4484:.balign 4				;	\
 .popsection				;
 
-#define ELFNOTE(name, type, desc)		\
+#define ELFNOTE(name, type, desc...)		\
 	ELFNOTE_START(name, type, "")		\
 		desc			;	\
 	ELFNOTE_END
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index a64d3df..ee5501d 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -120,6 +120,22 @@
  */
 #define XEN_ELFNOTE_BSD_SYMTAB    11
 
+/*
+ * The lowest address the hypervisor hole can begin at (numeric).
+ *
+ * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
+ * also indicates to the hypervisor that the kernel can deal with the
+ * hole starting at a higher address.
+ */
+#define XEN_ELFNOTE_HV_START_LOW  12
+
+/*
+ * List of maddr_t-sized mask/value pairs describing how to recognize
+ * (non-present) L1 page table entries carrying valid MFNs (numeric).
+ */
+#define XEN_ELFNOTE_L1_MFN_VALID  13
+
+
 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
 
 /*
-- 
1.5.4.1


linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch:

--- NEW FILE linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch ---
>From 29608fce8499324b97ef0b907db1e3564ccf39c9 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 4 Dec 2007 14:43:21 -0200
Subject: [PATCH] xen-asm.S: x86_64 notes

- Point to right entrypoint (startup_xen)
- Point to hypercall_page

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/xen-head.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index ec5d622..429e8f3 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -33,9 +33,10 @@ ENTRY(hypercall_page)
 	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long  startup_xen)
 	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long  hypercall_page)
 #else
+	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad  startup_xen)
+	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad  hypercall_page)
 	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad  __START_KERNEL_map)
 	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad  0)
-	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad  startup_64)
 	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad  _PAGE_PRESENT,_PAGE_PRESENT)
 #endif
 
-- 
1.5.4.1


linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch:

--- NEW FILE linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch ---
>From d84466823f36621b74836044145eda1258d26ee6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 4 Dec 2007 16:25:41 -0200
Subject: [PATCH] xen x86_64: Make hypercall assembly code work

Se comment for explanation.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/hypercall.h |  113 ++++++++++++++++++++++++++++++--------
 1 files changed, 89 insertions(+), 24 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index f5f07de..2ee807b 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -42,13 +42,42 @@
 
 extern struct { char _entry[32]; } hypercall_page[];
 
+#define __STR(x) #x
+#define STR(x) __STR(x)
+
+/* We could let gcc handle the asm operand generation for us, and
+ * use hypercall_page[__HYPERVISOR_##name] as a asm "m" or "i" operand.
+ *
+ * On i386, a "m" operand works for a direct call, but on x86_64,
+ * gcc generates a %rip-relative operand and the assembler generates
+ * an indirect call (and emits a warning).
+ *
+ *
+ * A "i" operand could work, but at least on x86_64, gcc generates
+ * the following:
+ *
+ * 	call $hypercall_page+555
+ *
+ * That is rejected by the assembler with the error "suffix or operands
+ * invalid for `call'"
+ */
+#define HYPERCALL_STR(name)						\
+	"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
+
+#ifdef CONFIG_X86_64
+#define IGN1 "=D"
+#define IGN2 "=S"
+#else
+#define IGN1 "=b"
+#define IGN2 "=c"
+#endif
+
 #define _hypercall0(type, name)						\
 ({									\
 	long __res;							\
 	asm volatile (							\
-		"call %[call]"						\
+		HYPERCALL_STR(name)					\
 		: "=a" (__res)						\
-		: [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
 		: "memory" );						\
 	(type)__res;							\
 })
@@ -57,10 +86,9 @@ extern struct { char _entry[32]; } hypercall_page[];
 ({									\
 	long __res, __ign1;						\
 	asm volatile (							\
-		"call %[call]"						\
-		: "=a" (__res), "=b" (__ign1)				\
-		: "1" ((long)(a1)),					\
-		  [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
+		HYPERCALL_STR(name)					\
+		: "=a" (__res), IGN1(__ign1)				\
+		: "1" ((long)(a1))					\
 		: "memory" );						\
 	(type)__res;							\
 })
@@ -69,10 +97,9 @@ extern struct { char _entry[32]; } hypercall_page[];
 ({									\
 	long __res, __ign1, __ign2;					\
 	asm volatile (							\
-		"call %[call]"						\
-		: "=a" (__res), "=b" (__ign1), "=c" (__ign2)		\
-		: "1" ((long)(a1)), "2" ((long)(a2)),			\
-		  [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
+		HYPERCALL_STR(name)					\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2)		\
+		: "1" ((long)(a1)), "2" ((long)(a2))			\
 		: "memory" );						\
 	(type)__res;							\
 })
@@ -81,27 +108,64 @@ extern struct { char _entry[32]; } hypercall_page[];
 ({									\
 	long __res, __ign1, __ign2, __ign3;				\
 	asm volatile (							\
-		"call %[call]"						\
-		: "=a" (__res), "=b" (__ign1), "=c" (__ign2),		\
+		HYPERCALL_STR(name)					\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2),		\
 		"=d" (__ign3)						\
 		: "1" ((long)(a1)), "2" ((long)(a2)),			\
-		  "3" ((long)(a3)),					\
-		  [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
+		  "3" ((long)(a3))					\
 		: "memory" );						\
 	(type)__res;							\
 })
 
+/* The hypercalls below are handled differently on x86_64 because
+ * of the way the 4th and following parameters are passed to the asm
+ * block.
+ */
+
+#ifdef CONFIG_X86_64
+
+#define _hypercall4(type, name, a1, a2, a3, a4)			\
+({								\
+	long __res, __ign1, __ign2, __ign3;			\
+	asm volatile (						\
+		"movq %7,%%r10; "				\
+		HYPERCALL_STR(name)				\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2),	\
+		"=d" (__ign3)					\
+		: "1" ((long)(a1)), "2" ((long)(a2)),		\
+		"3" ((long)(a3)), "g" ((long)(a4))		\
+		: "memory", "r10");				\
+	(type)__res;						\
+})
+
+#define _hypercall5(type, name, a1, a2, a3, a4, a5)		\
+({								\
+	long __res, __ign1, __ign2, __ign3;			\
+	asm volatile (						\
+		"movq %7,%%r10; movq %8,%%r8; "			\
+		HYPERCALL_STR(name)				\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2),	\
+		"=d" (__ign3)					\
+		: "1" ((long)(a1)), "2" ((long)(a2)),		\
+		"3" ((long)(a3)), "g" ((long)(a4)),		\
+		"g" ((long)(a5))				\
+		: "memory", "r10", "r8");			\
+	(type)__res;						\
+})
+
+
+#else
+
 #define _hypercall4(type, name, a1, a2, a3, a4)				\
 ({									\
 	long __res, __ign1, __ign2, __ign3, __ign4;			\
 	asm volatile (							\
-		"call %[call]"						\
-		: "=a" (__res), "=b" (__ign1), "=c" (__ign2),		\
+		HYPERCALL_STR(name)					\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2),		\
 		"=d" (__ign3), "=S" (__ign4)				\
 		: "1" ((long)(a1)), "2" ((long)(a2)),			\
-		  "3" ((long)(a3)), "4" ((long)(a4)),			\
-		  [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
-		: "memory" );						\
+		  "3" ((long)(a3)), "4" ((long)(a4))			\
+		: "memory");						\
 	(type)__res;							\
 })
 
@@ -109,17 +173,18 @@ extern struct { char _entry[32]; } hypercall_page[];
 ({									\
 	long __res, __ign1, __ign2, __ign3, __ign4, __ign5;		\
 	asm volatile (							\
-		"call %[call]"						\
-		: "=a" (__res), "=b" (__ign1), "=c" (__ign2),		\
+		HYPERCALL_STR(name)					\
+		: "=a" (__res), IGN1(__ign1), IGN2(__ign2),		\
 		"=d" (__ign3), "=S" (__ign4), "=D" (__ign5)		\
 		: "1" ((long)(a1)), "2" ((long)(a2)),			\
 		  "3" ((long)(a3)), "4" ((long)(a4)),			\
-		  "5" ((long)(a5)),					\
-		  [call] "m" (hypercall_page[__HYPERVISOR_##name])	\
-		: "memory" );						\
+		  "5" ((long)(a5))					\
+		: "memory");						\
 	(type)__res;							\
 })
 
+#endif
+
 #if defined(CONFIG_X86_64)
 #define MULTI_UVMFLAGS_INDEX 2
 #define MULTI_UVMDOMID_INDEX 3
-- 
1.5.4.1


linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch:

--- NEW FILE linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch ---
>From fb2ec61246be437b5a426d0289a2b9c867f92973 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 4 Dec 2007 17:01:56 -0200
Subject: [PATCH] xen x86_64 pda initialization

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b7e7b55..20efc56 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -45,6 +45,7 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/reboot.h>
+#include <asm/proto.h>
 
 #include "xen-ops.h"
 #include "mmu.h"
@@ -1242,6 +1243,19 @@ asmlinkage void __init xen_start_kernel(void)
 
 	BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0);
 
+#ifdef CONFIG_X86_64
+	{
+		/*FIXME: move this to common code
+		 * (it is duplicated on x86_64_start_kernel()
+		 */
+		int i;
+		for (i = 0; i < NR_CPUS; i++)
+			cpu_pda(i) = &boot_cpu_pda[i];
+
+		pda_init(0);
+	}
+#endif
+
 	/* Install Xen paravirt ops */
 	pv_info = xen_info;
 	pv_init_ops = xen_init_ops;
-- 
1.5.4.1


linux-2.6-xen-0042-Disable-early_printk-by-default.patch:

--- NEW FILE linux-2.6-xen-0042-Disable-early_printk-by-default.patch ---
>From 9064724b396f34a5a34a9f0da3939704fb188a7e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 5 Dec 2007 17:21:53 -0200
Subject: [PATCH] Disable early_printk() by default

Temporary until a better solution for automatically skipping the VGA
console is found.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/early_printk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 643fd86..6c3af4c 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -193,7 +193,7 @@ static struct console simnow_console = {
 };
 
 /* Direct interface for emergencies */
-static struct console *early_console = &early_vga_console;
+static struct console *early_console;
 static int early_console_initialized;
 
 void early_printk(const char *fmt, ...)
@@ -204,7 +204,8 @@ void early_printk(const char *fmt, ...)
 
 	va_start(ap, fmt);
 	n = vscnprintf(buf, 512, fmt, ap);
-	early_console->write(early_console, buf, n);
+	if (likely(early_console))
+		early_console->write(early_console, buf, n);
 	va_end(ap);
 }
 
-- 
1.5.4.1


linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch:

--- NEW FILE linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch ---
>From 46ac9177c96b62bcd96145ce933ff787f812541c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 5 Dec 2007 17:43:29 -0200
Subject: [PATCH] xen: Set __HYPERVISOR_VIRT_START for x86_64

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/interface.h |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h
index 6227000..a395448 100644
--- a/include/asm-x86/xen/interface.h
+++ b/include/asm-x86/xen/interface.h
@@ -96,10 +96,14 @@ DEFINE_GUEST_HANDLE(void);
  * Virtual addresses beyond this are not modifiable by guest OSes. The
  * machine->physical mapping table starts at this address, read-only.
  */
-#ifdef CONFIG_X86_PAE
-#define __HYPERVISOR_VIRT_START 0xF5800000
+#ifdef CONFIG_X86_64
+#define __HYPERVISOR_VIRT_START 0xFFFF800000000000
 #else
-#define __HYPERVISOR_VIRT_START 0xFC000000
+#  ifdef CONFIG_X86_PAE
+#    define __HYPERVISOR_VIRT_START 0xF5800000
+#  else
+#    define __HYPERVISOR_VIRT_START 0xFC000000
+#  endif
 #endif
 
 #ifndef HYPERVISOR_VIRT_START
-- 
1.5.4.1


linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch:

--- NEW FILE linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch ---
>From 68f6210ba6817abcb3be33b97fd5122c65e4cdfb Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 5 Dec 2007 17:45:55 -0200
Subject: [PATCH] Set __PAGE_OFFSET as required by Xen

This will need some discussion. __va() is used everywhere and calculated
on compile-time. What if some hypervisor somewhere needs a different
__PAGE_OFFSET too?

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/page_64.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index 6ea7285..35145d8 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -26,7 +26,7 @@
 #define PUD_PAGE_SIZE		(_AC(1, UL) << PUD_SHIFT)
 #define PUD_PAGE_MASK		(~(PUD_PAGE_SIZE-1))
 
-#define __PAGE_OFFSET           _AC(0xffff810000000000, UL)
+#define __PAGE_OFFSET           _AC(0xffff880000000000, UL)
 
 #define __PHYSICAL_START	CONFIG_PHYSICAL_START
 #define __KERNEL_ALIGN		0x200000
-- 
1.5.4.1


linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch:

--- NEW FILE linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch ---
>From d793f52a2b03b07d64650971f27ff0f9728a435e Mon Sep 17 00:00:00 2001
From: Stephen Tweedie <sct at redhat.com>
Date: Wed, 21 Nov 2007 18:40:31 +0000
Subject: [PATCH] DEBUG: Add xprintk to log directly via hypercall, for early debugging

Signed-off-by: Stephen Tweedie <sct at redhat.com>
---
 arch/x86/xen/enlighten.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 20efc56..ec70fd0 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -137,6 +137,37 @@ static void __init xen_vcpu_setup(int cpu)
 	}
 }
 
+static void kcons_write_dom0(const char *s, unsigned int count)
+{
+       int rc;
+
+       while ((count > 0) &&
+              ((rc = HYPERVISOR_console_io(
+                       CONSOLEIO_write, count, (char *)s)) > 0)) {
+               count -= rc;
+               s += rc;
+       }
+}
+
+
+/*** Useful function for console debugging -- goes straight to Xen. ***/
+asmlinkage int xprintk(const char *fmt, ...)
+{
+       va_list args;
+       int printk_len;
+       static char printk_buf[1024];
+
+       /* Emit the output into the temporary buffer */
+       va_start(args, fmt);
+       printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
+       va_end(args);
+
+       /* Send the processed output directly to Xen. */
+       kcons_write_dom0(printk_buf, printk_len);
+
+       return 0;
+}
+
 static void __init xen_banner(void)
 {
 	printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
-- 
1.5.4.1


linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch:

--- NEW FILE linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch ---
>From 59ece049722a2719797124bb604f06015da1dc24 Mon Sep 17 00:00:00 2001
From: Stephen Tweedie <sct at redhat.com>
Date: Tue, 27 Nov 2007 12:56:49 +0000
Subject: [PATCH] DEBUG: Add xprintk debugging-printk prototype to hvc-console.h.

Signed-off-by: Stephen Tweedie <sct at redhat.com>
---
 arch/x86/xen/enlighten.c  |    1 +
 include/xen/hvc-console.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index ec70fd0..0b8207c 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -33,6 +33,7 @@
 #include <xen/interface/sched.h>
 #include <xen/features.h>
 #include <xen/page.h>
+#include <xen/hvc-console.h>
 
 #include <asm/paravirt.h>
 #include <asm/page.h>
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
index 21c0ecf..cb7a3c9 100644
--- a/include/xen/hvc-console.h
+++ b/include/xen/hvc-console.h
@@ -2,5 +2,6 @@
 #define XEN_HVC_CONSOLE_H
 
 extern struct console xenboot_console;
+extern asmlinkage int xprintk(const char *fmt, ...);
 
 #endif	/* XEN_HVC_CONSOLE_H */
-- 
1.5.4.1


linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch:

--- NEW FILE linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch ---
>From a2bd8cc5dcbb1f337261272f5cbc2423861ae8f6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 11 Dec 2007 12:00:09 -0200
Subject: [PATCH] Use __pgd() on mk_kernel_pgd()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgtable_64.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index 0785137..c6b8885 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -195,7 +195,7 @@ static inline int pmd_bad(pmd_t pmd)
 #define pgd_offset_k(address) (init_level4_pgt + pgd_index((address)))
 #define pgd_present(pgd) (pgd_val(pgd) & _PAGE_PRESENT)
 static inline int pgd_large(pgd_t pgd) { return 0; }
-#define mk_kernel_pgd(address) ((pgd_t){ (address) | _KERNPG_TABLE })
+#define mk_kernel_pgd(address) (__pgd((address) | _KERNPG_TABLE))
 
 /* PUD - Level3 access */
 /* to find an entry in a page-table-directory. */
-- 
1.5.4.1


linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch:

--- NEW FILE linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch ---
>From e61497e66573c839c61744f65d61494ef7e022d4 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 11 Dec 2007 12:02:11 -0200
Subject: [PATCH] Include user page tables on head_64.S

This will need to be conditional on Xen being enabled.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/head_64.S |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 27d8f6e..b735c6d 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -348,6 +348,18 @@ NEXT_PAGE(init_level4_pgt)
 	/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
 	.quad	level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE
 
+
+	/*
+	 * We update two pgd entries to make kernel and user pgd consistent
+	 * at pgd_populate(). It can be used for kernel modules. So we place 
+	 * this page here for those cases to avoid memory corruption.
+	 * We also use this page to establish the initiali mapping for
+	 * vsyscall area.
+	 */
+NEXT_PAGE(init_level4_user_pgt)
+	.fill	512,8,0
+
+
 NEXT_PAGE(level3_ident_pgt)
 	.quad	level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
 	.fill	511,8,0
@@ -358,6 +370,14 @@ NEXT_PAGE(level3_kernel_pgt)
 	.quad	level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
 	.quad	level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
 
+	/*
+	 * This is used for vsyscall area mapping as we have a different
+	 * level4 page table for user.
+	 */
+NEXT_PAGE(level3_user_pgt)
+	.fill	512,8,0
+
+
 NEXT_PAGE(level2_fixmap_pgt)
 	.fill	506,8,0
 	.quad	level1_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
-- 
1.5.4.1


linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch:

--- NEW FILE linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch ---
>From 488634c6f8aff1bfa23ffdad8c80683056ca8bb9 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 11 Dec 2007 16:06:14 -0200
Subject: [PATCH] Avoid using mk_unsigned_long()

This is just to avoid diving into the header file mess to make
the macro available.

The constants aren't used on assembly code, anyway, so just append
UL to them.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/interface.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h
index a395448..daab389 100644
--- a/include/asm-x86/xen/interface.h
+++ b/include/asm-x86/xen/interface.h
@@ -97,17 +97,17 @@ DEFINE_GUEST_HANDLE(void);
  * machine->physical mapping table starts at this address, read-only.
  */
 #ifdef CONFIG_X86_64
-#define __HYPERVISOR_VIRT_START 0xFFFF800000000000
+#define __HYPERVISOR_VIRT_START 0xFFFF800000000000UL
 #else
 #  ifdef CONFIG_X86_PAE
-#    define __HYPERVISOR_VIRT_START 0xF5800000
+#    define __HYPERVISOR_VIRT_START 0xF5800000UL
 #  else
-#    define __HYPERVISOR_VIRT_START 0xFC000000
+#    define __HYPERVISOR_VIRT_START 0xFC000000UL
 #  endif
 #endif
 
 #ifndef HYPERVISOR_VIRT_START
-#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
+#define HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START
 #endif
 
 #ifndef machine_to_phys_mapping
-- 
1.5.4.1


linux-2.6-xen-0050-Lots-of-unrelated-changes.patch:

--- NEW FILE linux-2.6-xen-0050-Lots-of-unrelated-changes.patch ---
>From af54f6e5adbc847ef79837f5eb2087667253d468 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 11 Dec 2007 16:14:09 -0200
Subject: [PATCH] Lots of unrelated changes

Debugging + changes to make pagetable initialization code work.

This must be splitted in smaller changesets and changed to avoid adding
a new .c file just for the xen_init_pt() function.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/Makefile      |    6 ++
 arch/x86/xen/enlighten.c   |   41 +++++++++-
 arch/x86/xen/init.h        |   10 +++
 arch/x86/xen/init_32.c     |    3 +
 arch/x86/xen/init_64.c     |  188 ++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/xen/mmu.c         |   55 ++++++++++++-
 arch/x86/xen/mmu.h         |    8 ++
 arch/x86/xen/multicalls.c  |   13 ++-
 arch/x86/xen/xen-ops.h     |    5 +
 include/asm-x86/xen/page.h |    8 ++-
 10 files changed, 328 insertions(+), 9 deletions(-)
 create mode 100644 arch/x86/xen/init.h
 create mode 100644 arch/x86/xen/init_32.c
 create mode 100644 arch/x86/xen/init_64.c

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 3d8df98..0fdb30b 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -1,4 +1,10 @@
 obj-y		:= enlighten.o setup.o multicalls.o mmu.o \
 			time.o manage.o xen-asm.o grant-table.o
 
+ifeq ($(CONFIG_X86_32),y)
+obj-y 	+= init_32.o
+else
+obj-y	+= init_64.o
+endif
+
 obj-$(CONFIG_SMP)	+= smp.o
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0b8207c..db8a7d5 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -51,6 +51,7 @@
 #include "xen-ops.h"
 #include "mmu.h"
 #include "multicalls.h"
+#include "init.h"
 
 EXPORT_SYMBOL_GPL(hypercall_page);
 
@@ -714,6 +715,25 @@ static void xen_write_cr3(unsigned long cr3)
 	xen_mc_issue(PARAVIRT_LAZY_CPU);  /* interrupts restored */
 }
 
+static void xen_new_user_baseptr(unsigned long pfn)
+{
+	struct mmuext_op *op;
+	struct multicall_space mcs;
+	unsigned long mfn = pfn_to_mfn(PFN_DOWN(pfn));
+
+	xprintk("%s: %lx\n", __func__, pfn);
+
+	mcs = xen_mc_entry(sizeof(*op));  /* disables interrupts */
+
+	op = mcs.args;
+	op->cmd = MMUEXT_NEW_USER_BASEPTR;
+	op->arg1.mfn = mfn;
+
+	MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
+
+	xen_mc_issue(PARAVIRT_LAZY_CPU);  /* interrupts restored */
+}
+
 /* Early in boot, while setting up the initial pagetable, assume
    everything is pinned. */
 static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn)
@@ -974,10 +994,12 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
 	goto patch_site
 
 	switch (type) {
+#ifdef CONFIG_X86_32
 		SITE(pv_irq_ops, irq_enable);
 		SITE(pv_irq_ops, irq_disable);
 		SITE(pv_irq_ops, save_fl);
 		SITE(pv_irq_ops, restore_fl);
+#endif
 #undef SITE
 
 	patch_site:
@@ -1174,7 +1196,8 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
 	.make_pte = xen_make_pte,
 	.make_pgd = xen_make_pgd,
 
-#ifdef CONFIG_X86_PAE
+#ifdef CONFIG_X86_32
+#  ifdef CONFIG_X86_PAE
 	.set_pte_atomic = xen_set_pte_atomic,
 	.set_pte_present = xen_set_pte_at,
 	.set_pud = xen_set_pud,
@@ -1183,7 +1206,14 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
 
 	.make_pmd = xen_make_pmd,
 	.pmd_val = xen_pmd_val,
-#endif	/* PAE */
+#  endif	/* PAE */
+#else
+	.set_pgd = xen_set_pgd,
+	.make_pud = xen_make_pud,
+
+	.make_pmd = xen_make_pmd,
+	.pmd_val = xen_pmd_val,
+#endif
 
 	.activate_mm = xen_activate_mm,
 	.dup_mmap = xen_dup_mmap,
@@ -1275,6 +1305,8 @@ asmlinkage void __init xen_start_kernel(void)
 
 	BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0);
 
+	xprintk("hello, world!\n");
+
 #ifdef CONFIG_X86_64
 	{
 		/*FIXME: move this to common code
@@ -1315,6 +1347,7 @@ asmlinkage void __init xen_start_kernel(void)
 	pgd = (pgd_t *)xen_start_info->pt_base;
 
 #ifdef CONFIG_X86_32
+	/*FIXME: x86_64 equivalent */
 	init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
 #endif
 
@@ -1329,6 +1362,10 @@ asmlinkage void __init xen_start_kernel(void)
 	   possible map and a non-dummy shared_info. */
 	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
 
+	xprintk("xen_init_pt:\n");
+	xen_init_pt();
+	xprintk("xen_init_pt returned.\n");
+
 	pv_info.kernel_rpl = 1;
 	if (xen_feature(XENFEAT_supervisor_mode_kernel))
 		pv_info.kernel_rpl = 0;
diff --git a/arch/x86/xen/init.h b/arch/x86/xen/init.h
new file mode 100644
index 0000000..9cd3954
--- /dev/null
+++ b/arch/x86/xen/init.h
@@ -0,0 +1,10 @@
+#ifndef __X86_XEN_INIT_H
+#define __X86_XEN_INIT_H
+
+void xen_init_pt(void);
+
+extern pud_t level3_user_pgt[512];
+extern pgd_t init_level4_user_pgt[];
+
+
+#endif /* __X86_XEN_INIT_H */
diff --git a/arch/x86/xen/init_32.c b/arch/x86/xen/init_32.c
new file mode 100644
index 0000000..6b49e40
--- /dev/null
+++ b/arch/x86/xen/init_32.c
@@ -0,0 +1,3 @@
+void xen_init_pt(void)
+{
+}
diff --git a/arch/x86/xen/init_64.c b/arch/x86/xen/init_64.c
new file mode 100644
index 0000000..f025c21
--- /dev/null
+++ b/arch/x86/xen/init_64.c
@@ -0,0 +1,188 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <asm/pgtable.h>
+
+#include <asm/xen/hypercall.h>
+#include <xen/page.h>
+#include <xen/hvc-console.h>
+
+#include "xen-ops.h"
+#include "init.h"
+#include "mmu.h"
+
+#define addr_to_page(addr, page)				\
+	(addr) &= PHYSICAL_PAGE_MASK;				\
+	(page) = ((unsigned long *) ((unsigned long)		\
+	(((mfn_to_pfn((addr) >> PAGE_SHIFT)) << PAGE_SHIFT) +	\
+	__START_KERNEL_map)))
+
+
+static void __meminit early_make_page_readonly(void *va, unsigned int feature)
+{
+	unsigned long addr, _va = (unsigned long)va;
+	int r;
+	unsigned long idx;
+	pte_t pte, *ptep;
+	unsigned long *page = (unsigned long *) init_level4_pgt;
+
+	if (xen_feature(feature))
+		return;
+
+	idx = pgd_index(_va);
+
+	addr = (unsigned long) page[idx];
+	addr_to_page(addr, page);
+
+	idx = pud_index(_va);
+	addr = page[idx];
+
+	addr_to_page(addr, page);
+
+	idx = pmd_index(_va);
+	addr = page[idx];
+	addr_to_page(addr, page);
+
+	idx =pte_index(_va);
+	ptep = (pte_t *) &page[idx];
+
+	pte.pte = ptep->pte & ~_PAGE_RW;
+
+	if ( (r = HYPERVISOR_update_va_mapping(_va, pte, 0)) ) {
+		xprintk("%s: failure: %d :(\n", __func__, r);
+		BUG();
+	}
+}
+
+
+
+void __init xen_init_pt(void)
+{
+	unsigned long addr, *page;
+
+	xprintk("%s starting\n", __func__);
+
+	xprintk("xen_cr3: %lx. xen_cur_cr3: %lx\n", x86_read_percpu(xen_cr3), x86_read_percpu(xen_current_cr3));
+
+	/* Find the initial pte page that was built for us. */
+	page = (unsigned long *)xen_start_info->pt_base;
+	xprintk("page1: %p\n", page);
+	addr = page[pgd_index(__START_KERNEL_map)];
+	xprintk("addr1: %lx\n", addr);
+	addr_to_page(addr, page);
+	xprintk("addr1, page2: %lx, %p\n", addr, page);
+
+	addr = page[pud_index(__START_KERNEL_map)];
+	xprintk("addr2: %lx\n", addr);
+
+	addr_to_page(addr, page);
+	xprintk("addr2,page2: %lx, %p\n", addr, page);
+
+
+#if 0  /* CONFIG_XEN_COMPAT <= 0x030002 */
+	/* On Xen 3.0.2 and older we may need to explicitly specify _PAGE_USER
+	   in kernel PTEs. We check that here. */
+	if (HYPERVISOR_xen_version(XENVER_version, NULL) <= 0x30000) {
+		unsigned long *pg;
+		pte_t pte;
+
+		/* Mess with the initial mapping of page 0. It's not needed. */
+		BUILD_BUG_ON(__START_KERNEL <= __START_KERNEL_map);
+		addr = page[pmd_index(__START_KERNEL_map)];
+		addr_to_page(addr, pg);
+		pte.pte = pg[pte_index(__START_KERNEL_map)];
+		BUG_ON(!(pte.pte & _PAGE_PRESENT));
+
+		/* If _PAGE_USER isn't set, we obviously do not need it. */
+		if (pte.pte & _PAGE_USER) {
+			/* _PAGE_USER is needed, but is it set implicitly? */
+			pte.pte &= ~_PAGE_USER;
+			if ((HYPERVISOR_update_va_mapping(__START_KERNEL_map,
+							  pte, 0) != 0) ||
+			    !(pg[pte_index(__START_KERNEL_map)] & _PAGE_USER))
+				/* We need to explicitly specify _PAGE_USER. */
+				__kernel_page_user = _PAGE_USER;
+		}
+	}
+#endif
+
+	xprintk("l4pgt: %p\n", init_level4_pgt);
+
+	/* The page tables are pre-initialized with values that are not
+	 * usable by Xen. Zero them out.
+	 */
+	memset(init_level4_pgt, 0, PAGE_SIZE);
+	memset(level3_kernel_pgt, 0, PAGE_SIZE);
+	memset(level2_kernel_pgt, 0, PAGE_SIZE);
+
+	xprintk("%s going change init_level4_pgt\n", __func__);
+
+	/* Construct mapping of initial pte page in our own directories. */
+	init_level4_pgt[pgd_index(__START_KERNEL_map)] = 
+		mk_kernel_pgd(__pa_symbol(level3_kernel_pgt));
+
+	xprintk("pointed l4 to l3kpgt\n");
+
+	xprintk("l3pgt: %p\n", level3_kernel_pgt);
+
+
+	{
+	unsigned long pi = pud_index(__START_KERNEL_map);
+	pud_t newp;
+	/*int i;
+	for (i = 0; i < PTRS_PER_PUD; i++)
+		xprintk("l3[%d] (%p)= %lx\n", i, &level3_kernel_pgt[i], (unsigned long)level3_kernel_pgt[i].pud);*/
+
+	xprintk("pud index: %lx\n", pi);
+	xprintk("writing to %p\n", &level3_kernel_pgt[pi]);
+	newp = __pud(__pa_symbol(level2_kernel_pgt) |
+		      _KERNPG_TABLE);
+	xprintk("new pud: %lx\n", (unsigned long)newp.pud);
+	level3_kernel_pgt[pi] = newp;
+
+	}
+	xprintk("pointed l3 to l2kpgt\n");
+
+	xprintk("l2pgt: %p\n", level2_kernel_pgt);
+	memcpy((void *)level2_kernel_pgt, page, PAGE_SIZE);
+	xprintk("copied l2kpgt from page\n");
+
+
+	xprintk("%s: going to pin\n", __func__);
+
+	early_make_page_readonly(init_level4_user_pgt,
+				 XENFEAT_writable_page_tables);
+	early_make_page_readonly(level3_user_pgt,
+				 XENFEAT_writable_page_tables);
+
+	xprintk("%s going to make pages readonly\n", __func__);
+	early_make_page_readonly(init_level4_pgt,
+				 XENFEAT_writable_page_tables);
+	early_make_page_readonly(level3_kernel_pgt,
+				 XENFEAT_writable_page_tables);
+	early_make_page_readonly(level2_kernel_pgt,
+				 XENFEAT_writable_page_tables);
+
+	xprintk("%s going to pin pgds\n", __func__);
+	if (!xen_feature(XENFEAT_writable_page_tables)) {
+		xprintk("kernel:\n");
+		xen_do_pin(MMUEXT_PIN_L4_TABLE, PFN_DOWN(__pa_symbol(init_level4_pgt)));
+		xprintk("user:\n");
+		xen_do_pin(MMUEXT_PIN_L4_TABLE, PFN_DOWN(__pa_symbol(init_level4_user_pgt)));
+	}
+
+
+	/*FIXME: check why this isn't set before xen_pgd_pin() on
+	 * x86_64 XenSource code
+	 */
+	xprintk("%s: set_pgd:\n", __func__);
+	set_pgd((pgd_t *)(init_level4_user_pgt + 511), 
+		mk_kernel_pgd(__pa_symbol(level3_user_pgt)));
+	xprintk("%s: returning.\n", __func__);
+
+	xprintk("going to load new pagetable:\n");
+	write_cr3(__pa(init_level4_pgt));
+	xprintk("loaded new pagetable\n");
+}
+
+
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 77692cb..599394c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -53,6 +53,8 @@
 #include <xen/page.h>
 #include <xen/interface/xen.h>
 
+#include <xen/hvc-console.h>
+
 #include "multicalls.h"
 #include "mmu.h"
 
@@ -198,7 +200,12 @@ pmdval_t xen_pmd_val(pmd_t pmd)
 		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 	return ret;
 }
-#ifdef CONFIG_X86_PAE
+
+
+#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64)
+
+/*FIXME: merge functions where possible */
+
 void xen_set_pud(pud_t *ptr, pud_t val)
 {
 	struct multicall_space mcs;
@@ -217,6 +224,46 @@ void xen_set_pud(pud_t *ptr, pud_t val)
 	preempt_enable();
 }
 
+
+#ifdef CONFIG_X86_64
+
+void xen_set_pte(pte_t *ptep, pte_t pte)
+{
+	ptep->pte = pte.pte;
+	//smp_wmb();
+}
+
+void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
+{
+	set_64bit((unsigned long *)ptep, pte_val_ma(pte));
+}
+
+void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+{
+	ptep->pte = 0;
+}
+
+void xen_set_pgd(pgd_t *ptr, pgd_t val)
+{
+	struct multicall_space mcs;
+	struct mmu_update *u;
+
+	preempt_disable();
+
+	mcs = xen_mc_entry(sizeof(*u));
+	u = mcs.args;
+
+	u->ptr = virt_to_machine(ptr).maddr;
+	u->val = pgd_val_ma(val);
+
+	MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF);
+
+	xen_mc_issue(PARAVIRT_LAZY_MMU);
+
+	preempt_enable();
+}
+#else
+
 void xen_set_pte(pte_t *ptep, pte_t pte)
 {
 	ptep->pte_high = pte.pte_high;
@@ -236,6 +283,8 @@ void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 	ptep->pte_high = 0;
 }
 
+#endif
+
 void xen_pmd_clear(pmd_t *pmdp)
 {
 	xen_set_pmd(pmdp, __pmd(0));
@@ -248,7 +297,9 @@ pmd_t xen_make_pmd(pmdval_t pmd)
 
 	return native_make_pmd(pmd);
 }
+
 #else  /* !PAE */
+
 void xen_set_pte(pte_t *ptep, pte_t pte)
 {
 	*ptep = pte;
@@ -349,7 +400,7 @@ static void do_unlock(void *v)
 	spin_unlock(ptl);
 }
 
-static void xen_do_pin(unsigned level, unsigned long pfn)
+void xen_do_pin(unsigned level, unsigned long pfn)
 {
 	struct mmuext_op *op;
 	struct multicall_space mcs;
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index ce425a4..62a325c 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -36,13 +36,17 @@ void xen_exit_mmap(struct mm_struct *mm);
 
 void xen_pgd_pin(pgd_t *pgd);
 //void xen_pgd_unpin(pgd_t *pgd);
+//
+void xen_do_pin(unsigned level, unsigned long pfn);
 
 pteval_t xen_pte_val(pte_t);
 pmdval_t xen_pmd_val(pmd_t);
+pudval_t xen_pud_val(pud_t);
 pgdval_t xen_pgd_val(pgd_t);
 
 pte_t xen_make_pte(pteval_t);
 pmd_t xen_make_pmd(pmdval_t);
+pud_t xen_make_pud(pudval_t);
 pgd_t xen_make_pgd(pgdval_t);
 
 #ifdef CONFIG_X86_PAE
@@ -55,4 +59,8 @@ void xen_pmd_clear(pmd_t *pmdp);
 
 #endif
 
+#ifdef CONFIG_X86_64
+void xen_set_pgd(pgd_t *pgdp, pgd_t pgdval);
+#endif
+
 #endif	/* _XEN_MMU_H */
diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
index 5791eb2..88f60dc 100644
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -24,6 +24,8 @@
 
 #include <asm/xen/hypercall.h>
 
+#include <xen/hvc-console.h>
+
 #include "multicalls.h"
 
 #define MC_DEBUG	1
@@ -60,6 +62,8 @@ void xen_mc_flush(void)
 	   something in the middle */
 	local_irq_save(flags);
 
+	xprintk("xen_mc_flush called. mcidx: %u\n", b->mcidx);
+
 	if (b->mcidx) {
 #if MC_DEBUG
 		memcpy(b->debug, b->entries,
@@ -72,19 +76,20 @@ void xen_mc_flush(void)
 			if (b->entries[i].result < 0)
 				ret++;
 
-#if MC_DEBUG
+		xprintk("multicall ret: %d\n", ret);
+//#if MC_DEBUG
 		if (ret) {
-			printk(KERN_ERR "%d multicall(s) failed: cpu %d\n",
+			xprintk("%d multicall(s) failed: cpu %d\n",
 			       ret, smp_processor_id());
 			for (i = 0; i < b->mcidx; i++) {
-				printk("  call %2d/%d: op=%lu arg=[%lx] result=%ld\n",
+				xprintk("  call %2d/%d: op=%lu arg=[%lx] result=%ld\n",
 				       i+1, b->mcidx,
 				       b->debug[i].op,
 				       b->debug[i].args[0],
 				       b->entries[i].result);
 			}
 		}
-#endif
+//#endif
 
 		b->mcidx = 0;
 		b->argidx = 0;
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index f1063ae..2bacadd 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -4,6 +4,11 @@
 #include <linux/init.h>
 #include <linux/irqreturn.h>
 #include <xen/xen-ops.h>
+#include <linux/types.h>
+#include <asm/percpu.h>
+
+#include <xen/interface/xen.h>
+#include <asm/xen/interface.h>
 
 /* These are code, but not functions.  Defined in entry.S */
 extern const char xen_hypervisor_callback[];
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index 3b5ba6e..69841fd 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -7,6 +7,9 @@
 #include <asm/pgtable.h>
 
 #include <xen/features.h>
+#include <asm/xen/interface.h>
+#include <xen/hvc-console.h>
+
 
 /* Xen machine address */
 typedef struct xmaddr {
@@ -58,6 +61,8 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 #endif
 
 	pfn = 0;
+	xprintk("mfn_to_pfn(%lx):\n", mfn);
+
 	/*
 	 * The array access can fail (e.g., device space beyond end of RAM).
 	 * In such cases it doesn't matter what we return (we return garbage),
@@ -65,6 +70,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 	 */
 	__get_user(pfn, &machine_to_phys_mapping[mfn]);
 
+	xprintk("mfn_to_pfn(%lx) = %lx\n", mfn, pfn);
 	return pfn;
 }
 
@@ -151,11 +157,11 @@ static inline pte_t __pte_ma(pteval_t x)
 }
 
 #ifdef CONFIG_X86_PAE
-#define pud_val_ma(v) ((v).pgd.pgd)
 #define __pmd_ma(x)	((pmd_t) { (x) } )
 #endif	/* CONFIG_X86_PAE */
 
 #define pgd_val_ma(x)	((x).pgd)
+#define pud_val_ma(x)	(native_pud_val((x)))
 #define pmd_val_ma(x)	(native_pmd_val((x)))
 
 
-- 
1.5.4.1


linux-2.6-xen-0051-Hack-disable-vsmp.patch:

--- NEW FILE linux-2.6-xen-0051-Hack-disable-vsmp.patch ---
>From fda42a9d97fe46eb5621341d03e3c6274a8a8204 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 12 Dec 2007 16:19:02 -0200
Subject: [PATCH] Hack: disable vsmp

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ad8bba8..2de2db6 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -337,6 +337,7 @@ config X86_RDC321X
 config X86_VSMP
 	bool "Support for ScaleMP vSMP"
 	select PARAVIRT
+	depends on !XEN
 	depends on X86_64
 	help
 	  Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
-- 
1.5.4.1


linux-2.6-xen-0052-Export-early_make_page_readonly.patch:

--- NEW FILE linux-2.6-xen-0052-Export-early_make_page_readonly.patch ---
>From 8ba89f1e7c8f5fc6e3640ba83b62dfa2a93f7688 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 12 Dec 2007 16:23:34 -0200
Subject: [PATCH] Export early_make_page_readonly()

Used by mm/init_64.c

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/init.h    |    3 +++
 arch/x86/xen/init_64.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/init.h b/arch/x86/xen/init.h
index 9cd3954..ee22051 100644
--- a/arch/x86/xen/init.h
+++ b/arch/x86/xen/init.h
@@ -6,5 +6,8 @@ void xen_init_pt(void);
 extern pud_t level3_user_pgt[512];
 extern pgd_t init_level4_user_pgt[];
 
+extern unsigned long start_pfn;
+
+void early_make_page_readonly(void *va, unsigned int feature);
 
 #endif /* __X86_XEN_INIT_H */
diff --git a/arch/x86/xen/init_64.c b/arch/x86/xen/init_64.c
index f025c21..872c152 100644
--- a/arch/x86/xen/init_64.c
+++ b/arch/x86/xen/init_64.c
@@ -18,7 +18,7 @@
 	__START_KERNEL_map)))
 
 
-static void __meminit early_make_page_readonly(void *va, unsigned int feature)
+void __meminit early_make_page_readonly(void *va, unsigned int feature)
 {
 	unsigned long addr, _va = (unsigned long)va;
 	int r;
-- 
1.5.4.1


linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch:

--- NEW FILE linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch ---
>From c3aafdc2a3f46b756f9a8bc246655fc483f40f04 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 12 Dec 2007 16:24:08 -0200
Subject: [PATCH] Disable multicalls.c too-verbose debugging

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/multicalls.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
index 88f60dc..777c4b8 100644
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -62,7 +62,7 @@ void xen_mc_flush(void)
 	   something in the middle */
 	local_irq_save(flags);
 
-	xprintk("xen_mc_flush called. mcidx: %u\n", b->mcidx);
+	//xprintk("xen_mc_flush called. mcidx: %u\n", b->mcidx);
 
 	if (b->mcidx) {
 #if MC_DEBUG
@@ -76,8 +76,8 @@ void xen_mc_flush(void)
 			if (b->entries[i].result < 0)
 				ret++;
 
-		xprintk("multicall ret: %d\n", ret);
-//#if MC_DEBUG
+		//xprintk("multicall ret: %d\n", ret);
+#if MC_DEBUG
 		if (ret) {
 			xprintk("%d multicall(s) failed: cpu %d\n",
 			       ret, smp_processor_id());
@@ -89,7 +89,7 @@ void xen_mc_flush(void)
 				       b->entries[i].result);
 			}
 		}
-//#endif
+#endif
 
 		b->mcidx = 0;
 		b->argidx = 0;
-- 
1.5.4.1


linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch:

--- NEW FILE linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch ---
>From e1aff6614b58926bf6192ecc544c4f83d7d783b1 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 12:00:39 -0200
Subject: [PATCH] Xen 64-bit-ready MMU operations

Lots of unification of functions.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   18 ++++----
 arch/x86/xen/mmu.c       |  103 +++++++++++++++++++++++++++-------------------
 arch/x86/xen/mmu.h       |   26 ++++++------
 3 files changed, 82 insertions(+), 65 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index db8a7d5..daaf39c 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1196,23 +1196,23 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
 	.make_pte = xen_make_pte,
 	.make_pgd = xen_make_pgd,
 
-#ifdef CONFIG_X86_32
-#  ifdef CONFIG_X86_PAE
+#ifdef CONFIG_X86_PAE
 	.set_pte_atomic = xen_set_pte_atomic,
 	.set_pte_present = xen_set_pte_at,
-	.set_pud = xen_set_pud,
 	.pte_clear = xen_pte_clear,
 	.pmd_clear = xen_pmd_clear,
 
-	.make_pmd = xen_make_pmd,
-	.pmd_val = xen_pmd_val,
-#  endif	/* PAE */
-#else
-	.set_pgd = xen_set_pgd,
-	.make_pud = xen_make_pud,
+#endif	/* PAE */
 
+#if PAGETABLE_LEVELS >= 3
 	.make_pmd = xen_make_pmd,
 	.pmd_val = xen_pmd_val,
+	.set_pud = xen_set_pud,
+#endif
+#if PAGETABLE_LEVELS >= 4
+	.make_pud = xen_make_pud,
+	.pud_val = xen_pud_val,
+	.set_pgd = xen_set_pgd,
 #endif
 
 	.activate_mm = xen_activate_mm,
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 599394c..5ac5569 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -167,14 +167,6 @@ pteval_t xen_pte_val(pte_t pte)
 	return ret;
 }
 
-pgdval_t xen_pgd_val(pgd_t pgd)
-{
-	pgdval_t ret = pgd.pgd;
-	if (ret & _PAGE_PRESENT)
-		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
-	return ret;
-}
-
 pte_t xen_make_pte(pteval_t pte)
 {
 	if (pte & _PAGE_PRESENT) {
@@ -185,26 +177,29 @@ pte_t xen_make_pte(pteval_t pte)
 	return (pte_t){ .pte = pte };
 }
 
-pgd_t xen_make_pgd(pgdval_t pgd)
-{
-	if (pgd & _PAGE_PRESENT)
-		pgd = phys_to_machine(XPADDR(pgd)).maddr;
+/*FIXME: re-check all pgtable functions and the patches that touch them */
 
-	return (pgd_t){ pgd };
-}
+#if PAGETABLE_LEVELS >= 3
 
 pmdval_t xen_pmd_val(pmd_t pmd)
 {
 	pmdval_t ret = native_pmd_val(pmd);
+
+	/*FIXME: handle attr bits properly (especially NX) */
 	if (ret & _PAGE_PRESENT)
 		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 	return ret;
 }
 
+pmd_t xen_make_pmd(pmdval_t pmd)
+{
+	/*FIXME: handle attr bits properly (especially NX) */
+	if (pmd & _PAGE_PRESENT)
+		pmd = phys_to_machine(XPADDR(pmd)).maddr;
 
-#if defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64)
+	return (pmd_t){ pmd };
+}
 
-/*FIXME: merge functions where possible */
 
 void xen_set_pud(pud_t *ptr, pud_t val)
 {
@@ -224,23 +219,28 @@ void xen_set_pud(pud_t *ptr, pud_t val)
 	preempt_enable();
 }
 
+#endif
 
-#ifdef CONFIG_X86_64
 
-void xen_set_pte(pte_t *ptep, pte_t pte)
-{
-	ptep->pte = pte.pte;
-	//smp_wmb();
-}
+#if PAGETABLE_LEVELS >= 4
 
-void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
+pudval_t xen_pud_val(pud_t pud)
 {
-	set_64bit((unsigned long *)ptep, pte_val_ma(pte));
+	pudval_t ret = pud_val_ma(pud);
+
+	/*FIXME: handle attr bits properly (especially NX) */
+	if (ret)
+		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	return ret;
 }
 
-void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+pud_t xen_make_pud(pudval_t pud)
 {
-	ptep->pte = 0;
+	/*FIXME: handle attr bits properly (especially NX) */
+	if (pud & _PAGE_PRESENT)
+		pud = phys_to_machine(XPADDR(pud)).maddr;
+
+	return native_make_pud(pud);
 }
 
 void xen_set_pgd(pgd_t *ptr, pgd_t val)
@@ -262,7 +262,32 @@ void xen_set_pgd(pgd_t *ptr, pgd_t val)
 
 	preempt_enable();
 }
-#else
+
+#endif
+
+pgdval_t xen_pgd_val(pgd_t pgd)
+{
+	pgdval_t ret = pgd_val_ma(pgd);
+
+	/*FIXME: handle attr bits properly (especially NX) */
+	if (ret & _PAGE_PRESENT)
+		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	return ret;
+}
+
+pgd_t xen_make_pgd(pgdval_t pgd)
+{
+	/*FIXME: handle attr bits properly (especially NX) */
+	if (pgd & _PAGE_PRESENT)
+		pgd = phys_to_machine(XPADDR(pgd)).maddr;
+
+	return native_make_pgd(pgd);
+}
+
+
+#ifdef CONFIG_X86_PAE
+
+/* Some operations need special handling on x86_32 under PAE */
 
 void xen_set_pte(pte_t *ptep, pte_t pte)
 {
@@ -271,11 +296,6 @@ void xen_set_pte(pte_t *ptep, pte_t pte)
 	ptep->pte_low = pte.pte_low;
 }
 
-void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
-{
-	set_64bit((u64 *)ptep, pte_val_ma(pte));
-}
-
 void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 {
 	ptep->pte_low = 0;
@@ -283,28 +303,25 @@ void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 	ptep->pte_high = 0;
 }
 
-#endif
-
-void xen_pmd_clear(pmd_t *pmdp)
+void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
 {
-	xen_set_pmd(pmdp, __pmd(0));
+	set_64bit((u64 *)ptep, pte_val_ma(pte));
 }
 
-pmd_t xen_make_pmd(pmdval_t pmd)
+void xen_pmd_clear(pmd_t *pmdp)
 {
-	if (pmd & _PAGE_PRESENT)
-		pmd = phys_to_machine(XPADDR(pmd)).maddr;
-
-	return native_make_pmd(pmd);
+	xen_set_pmd(pmdp, __pmd(0));
 }
 
-#else  /* !PAE */
+#else  /* non-PAE */
 
 void xen_set_pte(pte_t *ptep, pte_t pte)
 {
 	*ptep = pte;
 }
-#endif	/* CONFIG_X86_PAE */
+
+#endif
+
 
 /*
   (Yet another) pagetable walker.  This one is intended for pinning a
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index 62a325c..b25b8e4 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -28,7 +28,6 @@ void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
 void xen_set_pte(pte_t *ptep, pte_t pteval);
 void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
 		    pte_t *ptep, pte_t pteval);
-void xen_set_pmd(pmd_t *pmdp, pmd_t pmdval);
 
 void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next);
 void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
@@ -40,27 +39,28 @@ void xen_pgd_pin(pgd_t *pgd);
 void xen_do_pin(unsigned level, unsigned long pfn);
 
 pteval_t xen_pte_val(pte_t);
-pmdval_t xen_pmd_val(pmd_t);
-pudval_t xen_pud_val(pud_t);
-pgdval_t xen_pgd_val(pgd_t);
-
 pte_t xen_make_pte(pteval_t);
+void xen_set_pmd(pmd_t *pmdp, pmd_t pmdval);
+
+#if PAGETABLE_LEVELS >= 3
+pmdval_t xen_pmd_val(pmd_t);
 pmd_t xen_make_pmd(pmdval_t);
+void xen_set_pud(pud_t *ptr, pud_t val);
+#endif
+
+#if PAGETABLE_LEVELS >= 4
+pudval_t xen_pud_val(pud_t);
 pud_t xen_make_pud(pudval_t);
+void xen_set_pgd(pgd_t *pgdp, pgd_t pgdval);
+#endif
+
+pgdval_t xen_pgd_val(pgd_t);
 pgd_t xen_make_pgd(pgdval_t);
 
 #ifdef CONFIG_X86_PAE
-void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
-		    pte_t *ptep, pte_t pteval);
 void xen_set_pte_atomic(pte_t *ptep, pte_t pte);
-void xen_set_pud(pud_t *ptr, pud_t val);
 void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
 void xen_pmd_clear(pmd_t *pmdp);
-
-#endif
-
-#ifdef CONFIG_X86_64
-void xen_set_pgd(pgd_t *pgdp, pgd_t pgdval);
 #endif
 
 #endif	/* _XEN_MMU_H */
-- 
1.5.4.1


linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch:

--- NEW FILE linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch ---
>From 175e76b3755b54c98a3f2d29d2b5b80a5c0e62e2 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 12 Dec 2007 16:26:01 -0200
Subject: [PATCH] Some xen mmu pv-ops implemented

- Lots of debugging messages
- Lots of #ifdefs

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index daaf39c..54e0e5d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1351,12 +1351,19 @@ asmlinkage void __init xen_start_kernel(void)
 	init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
 #endif
 
+#ifdef CONFIG_X86_64
+	/* used by alloc_low_page() */
+	start_pfn = PFN_UP(__pa_symbol(xen_start_info->pt_base)) + xen_start_info->nr_pt_frames;
+#endif
+
+#ifdef CONFIG_X86_32
 	init_mm.pgd = pgd; /* use the Xen pagetables to start */
 
 	/* keep using Xen gdt for now; no urgent need to change it */
 
 	x86_write_percpu(xen_cr3, __pa(pgd));
 	x86_write_percpu(xen_current_cr3, __pa(pgd));
+#endif
 
 	/* Don't do the full vcpu_info placement stuff until we have a
 	   possible map and a non-dummy shared_info. */
-- 
1.5.4.1


linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch:

--- NEW FILE linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch ---
>From 5f7ac5de88af1cf91e500a2202838015bcecf90d Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 12 Dec 2007 16:26:56 -0200
Subject: [PATCH] Trying to make the pagetable initialization code work under Xen

To be fixed:

- Lots of #ifdef CONFIG_XEN that will break bare metal
- Make it actually work

Wrt. pse_available() in pgtable_64.h:

- Probably we may use the CPU feature code to handle this
- We need it to be variable (not constant 0) if Xen is supported

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c      |  153 ++++++++++++++++++++++++++++++++++++++++++--
 include/asm-x86/paravirt.h |   10 +++
 include/asm-x86/pgalloc.h  |    2 +
 include/asm-x86/pgtable.h  |    4 +
 4 files changed, 162 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9b15da2..382b82a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -47,6 +47,22 @@
 #include <asm/numa.h>
 #include <asm/cacheflush.h>
 
+#ifdef CONFIG_XEN
+/*FIXME: ouch. */
+#include <xen/features.h>
+#include <xen/page.h>
+#include <xen/hvc-console.h>
+#include <asm/xen/hypercall.h>
+#include "../xen/init.h"
+#include "../xen/xen-ops.h"
+#endif
+
+#ifdef CONFIG_XEN
+/*FIXME: ouch again */
+#define PTE_SIZE  PAGE_SIZE
+#else
+#endif
+
 static unsigned long dma_reserve __initdata;
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -116,6 +132,9 @@ void show_mem(void)
 
 int after_bootmem;
 
+static unsigned long __initdata table_start;
+static unsigned long __meminitdata table_end;
+
 static __init void *spp_getpage(void)
 {
 	void *ptr;
@@ -245,8 +264,75 @@ native_set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
 	__native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, prot));
 }
 
-static unsigned long __initdata table_start;
-static unsigned long __meminitdata table_end;
+
+#ifdef CONFIG_XEN
+
+/*FIXME: this code should be enabled at runtime, somehow */
+
+unsigned long start_pfn;
+
+static __meminit void *alloc_low_page(unsigned long *phys)
+{
+	unsigned long pfn;
+	void *adr;
+
+	if (after_bootmem) {
+		adr = (void *)get_zeroed_page(GFP_ATOMIC);
+		*phys = __pa(adr);
+		return adr;
+	}
+
+	pfn = start_pfn++;
+	*phys  = pfn << PAGE_SHIFT;
+
+	/* The address returned by __va() is not available yet.
+	 * This function is used by init_memory_mapping(). We will
+	 * use the mapping that was set by Xen for us.
+	 */
+	adr = (void*)((*phys) + __START_KERNEL_map);
+	memset(adr, 0, PAGE_SIZE);
+
+	return adr;
+}
+
+
+static inline void __set_pte(pte_t *dst, pte_t val)
+{
+	*dst = val;
+}
+
+
+int make_readonly(unsigned long paddr)
+{
+	extern char __vsyscall_0;
+	int readonly = 0;
+
+	/* Make new page tables read-only. */
+	if (!xen_feature(XENFEAT_writable_page_tables)
+	    && (paddr >= (table_start << PAGE_SHIFT))
+	    && (paddr < (table_end << PAGE_SHIFT)))
+		readonly = 1;
+	/* Make old page tables read-only. */
+	if (!xen_feature(XENFEAT_writable_page_tables)
+	    && (paddr >= (xen_start_info->pt_base - __START_KERNEL_map))
+	    && (paddr < (start_pfn << PAGE_SHIFT)))
+		readonly = 1;
+
+	/*
+	 * No need for writable mapping of kernel image. This also ensures that
+	 * page and descriptor tables embedded inside don't have writable
+	 * mappings. Exclude the vsyscall area here, allowing alternative
+	 * instruction patching to work.
+	 */
+	if ((paddr >= __pa_symbol(&_text)) && (paddr < __pa_symbol(&_end))
+	    && !(paddr >= __pa_symbol(&__vsyscall_0)
+	         && paddr < __pa_symbol(&__vsyscall_0) + PAGE_SIZE))
+		readonly = 1;
+
+	return readonly;
+}
+
+#else /* !XEN */
 
 static __meminit void *alloc_low_page(unsigned long *phys)
 {
@@ -269,12 +355,18 @@ static __meminit void *alloc_low_page(unsigned long *phys)
 	return adr;
 }
 
+#endif  /* !XEN */
+
+
 static __meminit void unmap_low_page(void *adr)
 {
 	if (after_bootmem)
 		return;
 
+#ifndef CONFIG_XEN
+	/*FIXME: this behaviour should be changed in runtime, also */
 	early_iounmap(adr, PAGE_SIZE);
+#endif
 }
 
 /* Must run before zap_low_mappings */
@@ -297,8 +389,9 @@ __meminit void *early_ioremap(unsigned long addr, unsigned long size)
 		vaddr += addr & ~PMD_MASK;
 		addr &= PMD_MASK;
 
-		for (i = 0; i < pmds; i++, addr += PMD_SIZE)
+		for (i = 0; i < pmds; i++, addr += PMD_SIZE) {
 			set_pmd(pmd+i, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
+		} /* for pmds */
 		__flush_tlb_all();
 
 		return (void *)vaddr;
@@ -334,7 +427,7 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end)
 {
 	int i = pmd_index(address);
 
-	for (; i < PTRS_PER_PMD; i++, address += PMD_SIZE) {
+	for (; i < PTRS_PER_PMD; i++) {
 		pmd_t *pmd = pmd_page + pmd_index(address);
 
 		if (address >= end) {
@@ -348,8 +441,46 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end)
 		if (pmd_val(*pmd))
 			continue;
 
-		set_pte((pte_t *)pmd,
-			pfn_pte(address >> PAGE_SHIFT, PAGE_KERNEL_LARGE));
+		if (pse_available()) {
+			/* Lucky us :) */
+			set_pte((pte_t *)pmd,
+				pfn_pte(address >> PAGE_SHIFT,
+				PAGE_KERNEL_LARGE));
+			address += PMD_SIZE;
+		} else {
+			/* No PSE support. Must make lots of PTEs */
+			unsigned long pte_phys;
+			pte_t *pte, *pte_save;
+			int k;
+
+			pte = alloc_low_page(&pte_phys);
+			pte_save = pte;
+			for (k = 0; k < PTRS_PER_PTE; pte++, k++, address += PTE_SIZE) {
+				pteval_t attrs;
+				if ((address >= end)) {
+					__set_pte(pte, __pte(0));
+					continue;
+				}
+
+				/*FIXME: _PAGE_GLOBAL is skipped here,
+				 * but this is Xen-specific. Use pvops
+				 * to handle this
+				 */
+				attrs = __PAGE_KERNEL;
+
+				/*FIXME: somehow we need to make those
+				 * pages readonly on some other place
+				 */
+				if (make_readonly(address))
+					attrs &= ~_PAGE_RW;
+				__set_pte(pte, __pte(address | attrs));
+			}
+			pte = pte_save;
+
+			/*FIXME: this should be done somewhere else */
+			early_make_page_readonly(pte, XENFEAT_writable_page_tables);
+			set_pmd(pmd, pfn_pmd(pte_phys>>PAGE_SHIFT, PAGE_KERNEL));
+		} /* !pse_available() */
 	}
 	return address;
 }
@@ -381,11 +512,14 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end)
 		if (addr >= end)
 			break;
 
+#ifndef CONFIG_XEN
+		/*FIXME: how to make this enabled on runtime */
 		if (!after_bootmem &&
 				!e820_any_mapped(addr, addr+PUD_SIZE, 0)) {
 			set_pud(pud, __pud(0));
 			continue;
 		}
+#endif
 
 		if (pud_val(*pud)) {
 			if (!pud_large(*pud))
@@ -401,6 +535,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end)
 		}
 
 		pmd = alloc_low_page(&pmd_phys);
+		/*FIXME: this (making page readonly) should be done somewhere else */
+		early_make_page_readonly(pmd, XENFEAT_writable_page_tables);
 
 		spin_lock(&init_mm.page_table_lock);
 		set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE));
@@ -591,8 +727,11 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 
 		if (after_bootmem)
 			pud = pud_offset(pgd, start & PGDIR_MASK);
-		else
+		else {
 			pud = alloc_low_page(&pud_phys);
+			/*FIXME: this (making page readonly) should be done somewhere else */
+			early_make_page_readonly(pud, XENFEAT_writable_page_tables);
+		}
 
 		next = start + PGDIR_SIZE;
 		if (next > end)
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index a37fc2d..ebc35de 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -153,6 +153,16 @@ struct pv_cpu_ops {
 	struct pv_lazy_ops lazy_mode;
 };
 
+
+#ifdef CONFIG_XEN
+/*FIXME: return 0 only if we are really running under Xen */
+#define pse_available() (0)
+#else
+/* No Xen support, PSE is always available */
+#define pse_available() (1)
+#endif
+
+
 struct pv_irq_ops {
 	void (*init_IRQ)(void);
 
diff --git a/include/asm-x86/pgalloc.h b/include/asm-x86/pgalloc.h
index 91e4641..91d7753 100644
--- a/include/asm-x86/pgalloc.h
+++ b/include/asm-x86/pgalloc.h
@@ -5,6 +5,8 @@
 #include <linux/mm.h>		/* for struct page */
 #include <linux/pagemap.h>
 
+#include <asm/vsyscall.h>
+
 #ifdef CONFIG_PARAVIRT
 #include <asm/paravirt.h>
 #else
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 97c271b..636d087 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -349,6 +349,10 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
 
 #define pte_update(mm, addr, ptep)              do { } while (0)
 #define pte_update_defer(mm, addr, ptep)        do { } while (0)
+
+/*FIXME: this have a better place than here */
+#define pse_available() (1)
+
 #endif	/* CONFIG_PARAVIRT */
 
 #endif	/* __ASSEMBLY__ */
-- 
1.5.4.1


linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch:

--- NEW FILE linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch ---
>From 6319a7825ab129905e3946536f6fc515f2b46533 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 12:15:58 -0200
Subject: [PATCH] Xen-specific find_early_table_space() (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 382b82a..fbc84c9 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -550,6 +550,35 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end)
 	return last_map_addr >> PAGE_SHIFT;
 }
 
+#ifdef CONFIG_XEN
+/*FIXME: Yet Another Xen #ifdef that needs to be done at runtime */
+
+static void __init find_early_table_space(unsigned long end)
+{
+	unsigned long puds, pmds, ptes, tables;
+
+	puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
+	pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
+	ptes = (end + PTE_SIZE - 1) >> PAGE_SHIFT;
+
+	tables = round_up(puds * 8, PAGE_SIZE) + 
+		round_up(pmds * 8, PAGE_SIZE) + 
+		round_up(ptes * 8, PAGE_SIZE); 
+
+	/*FIXME: what does this do? */
+	//extend_init_mapping(tables);
+
+	table_start = start_pfn;
+	table_end = table_start + (tables>>PAGE_SHIFT);
+
+	early_printk("kernel direct mapping tables up to %lx @ %lx-%lx\n",
+		end, table_start << PAGE_SHIFT,
+		(table_start << PAGE_SHIFT) + tables);
+}
+
+
+#else /* XEN */
+
 static void __init find_early_table_space(unsigned long end)
 {
 	unsigned long puds, pmds, tables, start;
@@ -575,6 +604,8 @@ static void __init find_early_table_space(unsigned long end)
 	table_end = table_start;
 }
 
+#endif /* !XEN */
+
 static void __init init_gbpages(void)
 {
 	if (direct_gbpages && cpu_has_gbpages)
-- 
1.5.4.1


linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch:

--- NEW FILE linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch ---
>From 75a5007106d901af4ba122aab1821620ad046ca3 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 17 Dec 2007 18:08:13 -0200
Subject: [PATCH] Xen: call e820_print_map() when setting up memory

The memory_setup() behaviour of x86_64 is different, right now.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 1c28b77..ebf9346 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -21,6 +21,8 @@
 #include <xen/interface/physdev.h>
 #include <xen/features.h>
 
+#include <asm/proto.h>
+
 #include "xen-ops.h"
 #include "vdso.h"
 
@@ -47,6 +49,10 @@ char * __init xen_memory_setup(void)
 	add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
 #endif
 
+#ifdef CONFIG_X86_64
+	early_printk(KERN_INFO "Xen-provided physical RAM map:\n");
+	e820_print_map("Xen");
+#endif
 	return "Xen";
 }
 
-- 
1.5.4.1


linux-2.6-xen-0059-Comment-debugging-msgs.patch:

--- NEW FILE linux-2.6-xen-0059-Comment-debugging-msgs.patch ---
>From 8a9823625f95d2333b3830f39e2ac07a5fb745ed Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 17 Dec 2007 18:08:43 -0200
Subject: [PATCH] Comment debugging msgs

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/page.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index 69841fd..ead46b2 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -61,7 +61,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 #endif
 
 	pfn = 0;
-	xprintk("mfn_to_pfn(%lx):\n", mfn);
+	//xprintk("mfn_to_pfn(%lx):\n", mfn);
 
 	/*
 	 * The array access can fail (e.g., device space beyond end of RAM).
@@ -70,7 +70,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
 	 */
 	__get_user(pfn, &machine_to_phys_mapping[mfn]);
 
-	xprintk("mfn_to_pfn(%lx) = %lx\n", mfn, pfn);
+	//xprintk("mfn_to_pfn(%lx) = %lx\n", mfn, pfn);
 	return pfn;
 }
 
-- 
1.5.4.1


linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch:

--- NEW FILE linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch ---
>From d7982de72d4b4d7edd9133c6046829c5f2aa683e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 18 Dec 2007 10:21:45 -0200
Subject: [PATCH] Try to make pagetables read-only

Not working yet.  :(

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   82 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index fbc84c9..09834a3 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -87,6 +87,86 @@ static int __init parse_direct_gbpages_on(char *arg)
 }
 early_param("gbpages", parse_direct_gbpages_on);
 
+
+#ifdef CONFIG_XEN
+
+static void __make_page_readonly(void *va)
+{
+	pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t pte, *ptep;
+	unsigned long addr = (unsigned long) va;
+
+	xprintk("%s(%p)\n", __func__, va);
+
+	pgd = pgd_offset_k(addr);
+	pud = pud_offset(pgd, addr);
+	pmd = pmd_offset(pud, addr);
+	ptep = pte_offset_kernel(pmd, addr);
+
+	pte.pte = ptep->pte & ~_PAGE_RW;
+	xprintk("update_va_mapping: %lx, %lx\n", addr, pte);
+
+	if (HYPERVISOR_update_va_mapping(addr, pte, 0))
+		BUG(); //xen_l1_entry_update(ptep, pte); /* fallback */
+
+	if ((addr >= VMALLOC_START) && (addr < VMALLOC_END))
+		__make_page_readonly(__va(pte_pfn(pte) << PAGE_SHIFT));
+}
+
+static void __make_page_writable(void *va)
+{
+	pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t pte, *ptep;
+	unsigned long addr = (unsigned long) va;
+
+	pgd = pgd_offset_k(addr);
+	pud = pud_offset(pgd, addr);
+	pmd = pmd_offset(pud, addr);
+	ptep = pte_offset_kernel(pmd, addr);
+
+	pte.pte = ptep->pte | _PAGE_RW;
+	if (HYPERVISOR_update_va_mapping(addr, pte, 0))
+		BUG();//xen_l1_entry_update(ptep, pte); /* fallback */
+
+	if ((addr >= VMALLOC_START) && (addr < VMALLOC_END))
+		__make_page_writable(__va(pte_pfn(pte) << PAGE_SHIFT));
+}
+
+void make_page_readonly(void *va, unsigned int feature)
+{
+	if (!xen_feature(feature))
+		__make_page_readonly(va);
+}
+
+void make_page_writable(void *va, unsigned int feature)
+{
+	if (!xen_feature(feature))
+		__make_page_writable(va);
+}
+
+void make_pages_readonly(void *va, unsigned nr, unsigned int feature)
+{
+	if (xen_feature(feature))
+		return;
+
+	while (nr-- != 0) {
+		__make_page_readonly(va);
+		va = (void*)((unsigned long)va + PAGE_SIZE);
+	}
+}
+
+void make_pages_writable(void *va, unsigned nr, unsigned int feature)
+{
+	if (xen_feature(feature))
+		return;
+
+	while (nr-- != 0) {
+		__make_page_writable(va);
+		va = (void*)((unsigned long)va + PAGE_SIZE);
+	}
+}
+
+
+#endif
+
 /*
  * NOTE: pagetable_init alloc all the fixmap pagetables contiguous on the
  * physical space so we can cache the place of the first one and move
@@ -164,6 +244,7 @@ set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t pteval)
 	pud = pud_page + pud_index(vaddr);
 	if (pud_none(*pud)) {
 		pmd = (pmd_t *) spp_getpage();
+		make_page_readonly(pmd, XENFEAT_writable_page_tables);
 		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
 		if (pmd != pmd_offset(pud, 0)) {
 			printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
@@ -174,6 +255,7 @@ set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t pteval)
 	pmd = pmd_offset(pud, vaddr);
 	if (pmd_none(*pmd)) {
 		pte = (pte_t *) spp_getpage();
+		make_page_readonly(pte, XENFEAT_writable_page_tables);
 		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
 		if (pte != pte_offset_kernel(pmd, 0)) {
 			printk(KERN_ERR "PAGETABLE BUG #02!\n");
-- 
1.5.4.1


linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch:

--- NEW FILE linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch ---
>From d1a7038ea87ef00a8290db95c10bb93ce9d86bf9 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 18 Dec 2007 12:34:36 -0200
Subject: [PATCH] Debug: dump pgtables on make_page_readonly()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   68 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 09834a3..9e8d927 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -90,6 +90,71 @@ early_param("gbpages", parse_direct_gbpages_on);
 
 #ifdef CONFIG_XEN
 
+//#define vvva(p) ((void*)((p) + __START_KERNEL_map))
+#define vvva(p) __va((p))
+
+void show_pgtable1(pte_t *tbl, unsigned long addr)
+{
+	pte_t *pte = tbl + pte_index(addr);
+	pte_val_t pv;
+	unsigned long *page;
+
+	xprintk("\npte: %p\n", pte);
+	xprintk("\npte val: %lx\n", pte->pte);
+
+	pv = pte_val(*pte);
+	if (!(pv & _PAGE_PRESENT))
+		return;
+
+	page = vvva(pv & PHYSICAL_PAGE_MASK);
+
+	xprintk("\npage: %p\n", page);
+	xprintk("\npage val: %lx\n", *page);
+}
+
+void show_pgtable2(pmd_t *tbl, unsigned long addr)
+{
+	pmd_t *pmd = tbl + pmd_index(addr);
+	pmd_val_t pv;
+
+	xprintk("\npmd: %p\n", pmd);
+	xprintk("\npmd val: %lx\n", pmd->pmd);
+
+	pv = pmd_val(*pmd);
+	if (!(pv & _PAGE_PRESENT))
+		return;
+
+	show_pgtable1((pte_t*)vvva(pv & PHYSICAL_PAGE_MASK), addr);
+}
+
+void show_pgtable3(pud_t *tbl, unsigned long addr)
+{
+	pud_t *pud = tbl + pud_index(addr);
+
+	xprintk("\npud: %p\n", pud);
+	xprintk("pud value: %lx\n", pud->pud);
+
+	show_pgtable2((pmd_t*)vvva(pud_val(*pud) & PHYSICAL_PAGE_MASK), addr);
+}
+
+void show_pgtable4(pgd_t *tbl, unsigned long addr)
+{
+	pgd_t *pgd = tbl + pgd_index(addr);
+
+	xprintk("\npgd: %p\n", pgd);
+	xprintk("pgd value: %lx\n", pgd->pgd);
+
+	show_pgtable3((pud_t*)vvva(pgd_val(*pgd) & PHYSICAL_PAGE_MASK), addr);
+}
+
+void show_pgtable(unsigned long addr)
+{
+	xprintk("\nshowing pgtable for %lx\n", addr);
+
+	show_pgtable4(init_level4_pgt, addr);
+}
+
+
 static void __make_page_readonly(void *va)
 {
 	pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t pte, *ptep;
@@ -110,6 +175,9 @@ static void __make_page_readonly(void *va)
 
 	if ((addr >= VMALLOC_START) && (addr < VMALLOC_END))
 		__make_page_readonly(__va(pte_pfn(pte) << PAGE_SHIFT));
+
+	//show_pgtable(addr);
+	//show_pgtable(__START_KERNEL_map + __pa(va));
 }
 
 static void __make_page_writable(void *va)
-- 
1.5.4.1


linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch:

--- NEW FILE linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch ---
>From ce082962ead23cb7e3b7fbbf24209b04118cf424 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 18 Dec 2007 16:54:43 -0200
Subject: [PATCH] Disable apic at compile time (FIXME)

More code that will need to be disabled at runtime.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 6dff128..62c3c69 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -507,7 +507,10 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	if (smp_found_config)
 		get_smp_config();
+#ifndef CONFIG_XEN
+	/*FIXME: pvops */
 	init_apic_mappings();
+#endif
 	ioapic_init_mappings();
 
 	kvm_guest_init();
-- 
1.5.4.1


linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch:

--- NEW FILE linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch ---
>From cb735fc262a2548630bce0cc42e9b5b7d93c776b Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 18 Dec 2007 17:38:40 -0200
Subject: [PATCH] Parse early params after init_memory_mapping()

The xen console needs __va() to be working.

The question is: is this the case for other early_printk() handlers?

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 62c3c69..8ca3313 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -359,8 +359,6 @@ void __init setup_arch(char **cmdline_p)
 
 	parse_setup_data();
 
-	parse_early_param();
-
 #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 	if (init_ohci1394_dma_early)
 		init_ohci1394_dma_on_all_controllers();
@@ -393,6 +391,8 @@ void __init setup_arch(char **cmdline_p)
 	check_efer();
 
 	max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT));
+	parse_early_param();
+
 	if (efi_enabled)
 		efi_init();
 
-- 
1.5.4.1


linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch:

--- NEW FILE linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch ---
>From c481e82ac2da523d244c5196c350f48ecdf1d496 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 18 Dec 2007 17:40:35 -0200
Subject: [PATCH] xen: Move addr_to_page() to init.h

Needed on arch/x86/mm/init_64.c

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/init.h    |    7 +++++++
 arch/x86/xen/init_64.c |    7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/xen/init.h b/arch/x86/xen/init.h
index ee22051..fee0c05 100644
--- a/arch/x86/xen/init.h
+++ b/arch/x86/xen/init.h
@@ -10,4 +10,11 @@ extern unsigned long start_pfn;
 
 void early_make_page_readonly(void *va, unsigned int feature);
 
+
+#define addr_to_page(addr, page)				\
+	(addr) &= PHYSICAL_PAGE_MASK;				\
+	(page) = ((unsigned long *) ((unsigned long)		\
+	(((mfn_to_pfn((addr) >> PAGE_SHIFT)) << PAGE_SHIFT) +	\
+	__START_KERNEL_map)))
+
 #endif /* __X86_XEN_INIT_H */
diff --git a/arch/x86/xen/init_64.c b/arch/x86/xen/init_64.c
index 872c152..1e53c59 100644
--- a/arch/x86/xen/init_64.c
+++ b/arch/x86/xen/init_64.c
@@ -11,13 +11,6 @@
 #include "init.h"
 #include "mmu.h"
 
-#define addr_to_page(addr, page)				\
-	(addr) &= PHYSICAL_PAGE_MASK;				\
-	(page) = ((unsigned long *) ((unsigned long)		\
-	(((mfn_to_pfn((addr) >> PAGE_SHIFT)) << PAGE_SHIFT) +	\
-	__START_KERNEL_map)))
-
-
 void __meminit early_make_page_readonly(void *va, unsigned int feature)
 {
 	unsigned long addr, _va = (unsigned long)va;
-- 
1.5.4.1


linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch:

--- NEW FILE linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch ---
>From b7abb05f8b9665f44a9a0eeab52d0b8fb45c7410 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 12:31:46 -0200
Subject: [PATCH] Make xen_pxx_val() and xen_make_pxx() handle attr bits safely

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |   60 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 5ac5569..17c9d91 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -170,7 +170,10 @@ pteval_t xen_pte_val(pte_t pte)
 pte_t xen_make_pte(pteval_t pte)
 {
 	if (pte & _PAGE_PRESENT) {
-		pte = phys_to_machine(XPADDR(pte)).maddr;
+		/* preserve all other pte bits */
+		pteval_t m = phys_to_machine(XPADDR(pte & PHYSICAL_PAGE_MASK)).maddr;
+		pte &= ~PHYSICAL_PAGE_MASK;
+		pte |= m;
 		pte &= ~(_PAGE_PCD | _PAGE_PWT);
 	}
 
@@ -185,17 +188,23 @@ pmdval_t xen_pmd_val(pmd_t pmd)
 {
 	pmdval_t ret = native_pmd_val(pmd);
 
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (ret & _PAGE_PRESENT)
-		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
+	if (ret & _PAGE_PRESENT) {
+		/* preserve all other pmd bits */
+		pmdval_t m = machine_to_phys(XMADDR(ret & PHYSICAL_PAGE_MASK)).paddr;
+		ret &= ~PHYSICAL_PAGE_MASK;
+		ret |= m;
+	}
 	return ret;
 }
 
 pmd_t xen_make_pmd(pmdval_t pmd)
 {
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (pmd & _PAGE_PRESENT)
-		pmd = phys_to_machine(XPADDR(pmd)).maddr;
+	if (pmd & _PAGE_PRESENT) {
+		/* preserve all other pmd bits */
+		pmdval_t m = phys_to_machine(XPADDR(pmd & PHYSICAL_PAGE_MASK)).maddr;
+		pmd &= ~PHYSICAL_PAGE_MASK;
+		pmd |= m;
+	}
 
 	return (pmd_t){ pmd };
 }
@@ -228,17 +237,23 @@ pudval_t xen_pud_val(pud_t pud)
 {
 	pudval_t ret = pud_val_ma(pud);
 
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (ret)
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	if (ret & _PAGE_PRESENT) {
+		/* preserve all other pud bits */
+		pudval_t m = machine_to_phys(XMADDR(ret & PHYSICAL_PAGE_MASK)).paddr;
+		ret &= ~PHYSICAL_PAGE_MASK;
+		ret |= m;
+	}
 	return ret;
 }
 
 pud_t xen_make_pud(pudval_t pud)
 {
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (pud & _PAGE_PRESENT)
-		pud = phys_to_machine(XPADDR(pud)).maddr;
+	if (pud & _PAGE_PRESENT) {
+		/* preserve all other pud bits */
+		pudval_t m = phys_to_machine(XPADDR(pud & PHYSICAL_PAGE_MASK)).maddr;
+		pud &= ~PHYSICAL_PAGE_MASK;
+		pud |= m;
+	}
 
 	return native_make_pud(pud);
 }
@@ -269,17 +284,24 @@ pgdval_t xen_pgd_val(pgd_t pgd)
 {
 	pgdval_t ret = pgd_val_ma(pgd);
 
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (ret & _PAGE_PRESENT)
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	if (ret & _PAGE_PRESENT) {
+		/* preserve all other pgd bits */
+		pgdval_t m = machine_to_phys(XMADDR(ret & PHYSICAL_PAGE_MASK)).paddr;
+		ret &= ~PHYSICAL_PAGE_MASK;
+		ret |= m;
+	}
 	return ret;
 }
 
 pgd_t xen_make_pgd(pgdval_t pgd)
 {
-	/*FIXME: handle attr bits properly (especially NX) */
-	if (pgd & _PAGE_PRESENT)
-		pgd = phys_to_machine(XPADDR(pgd)).maddr;
+	if (pgd & _PAGE_PRESENT) {
+		/* preserve all other pgd bits */
+		pgdval_t m = phys_to_machine(XPADDR(pgd & PHYSICAL_PAGE_MASK)).maddr;
+		pgd &= ~PHYSICAL_PAGE_MASK;
+		pgd |= m;
+	}
+
 
 	return native_make_pgd(pgd);
 }
-- 
1.5.4.1


linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch:

--- NEW FILE linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch ---
>From 83308251811ad7d13dd7e18f2411e34816528c94 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:20:18 -0200
Subject: [PATCH] Pull xen_finish_init_mappin() from XS upstream

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   86 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 85 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9e8d927..310f7dd 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -482,6 +482,85 @@ int make_readonly(unsigned long paddr)
 	return readonly;
 }
 
+static void xen_finish_init_mapping(void)
+{
+	/*FIXME: move this to pvops */
+	unsigned long i, start, end;
+
+	xprintk("messing with start_info:\n");
+
+	/* Re-vector virtual addresses pointing into the initial
+	   mapping to the just-established permanent ones. */
+	xen_start_info = __va(__pa(xen_start_info));
+	xen_start_info->pt_base = (unsigned long)
+		__va(__pa(xen_start_info->pt_base));
+	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
+		phys_to_machine_mapping =
+			__va(__pa(xen_start_info->mfn_list));
+		xen_start_info->mfn_list = (unsigned long)
+			phys_to_machine_mapping;
+	}
+	if (xen_start_info->mod_start)
+		xen_start_info->mod_start = (unsigned long)
+			__va(__pa(xen_start_info->mod_start));
+
+	xprintk("messed with start_info.\n");
+	xprintk("unmapping:\n");
+
+	/* Destroy the Xen-created mappings beyond the kernel image as
+	 * well as the temporary mappings created above. Prevents
+	 * overlap with modules area (if init mapping is very big).
+	 */
+	start = PAGE_ALIGN((unsigned long)_end);
+	end   = __START_KERNEL_map + (table_end << PAGE_SHIFT);
+
+	xprintk("from %lx to %lx\n", start, end);
+	for (; start < end; start += PAGE_SIZE)
+		WARN_ON(HYPERVISOR_update_va_mapping(
+			start, __pte_ma(0), 0));
+
+	/* Allocate pte's for initial fixmaps from 'start_pfn' allocator. */
+	table_end = ~0UL;
+
+
+	xprintk("set_fixmaps:\n");
+
+	/*
+	 * Prefetch pte's for the bt_ioremap() area. It gets used before the
+	 * boot-time allocator is online, so allocate-on-demand would fail.
+	 */
+	for (i = FIX_BTMAP_END; i <= FIX_BTMAP_BEGIN; i++)
+		clear_fixmap(i);
+
+	xprintk("btmap end.\n");
+
+	/* Switch to the real shared_info page, and clear the dummy page. */
+#if 0
+	set_fixmap_mfn(FIX_SHARED_INFO, xen_start_info->shared_info);
+	HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
+#endif
+
+	memset(empty_zero_page, 0, sizeof(empty_zero_page));
+	xprintk("isamaps:\n");
+
+	/* Set up mapping of lowest 1MB of physical memory. */
+	for (i = 0; i < NR_FIX_ISAMAPS; i++)
+		if (is_initial_xendomain())
+			__native_set_fixmap(FIX_ISAMAP_BEGIN - i,
+					    mfn_pte(i * PAGE_SIZE, PAGE_KERNEL));
+		else
+			__native_set_fixmap(FIX_ISAMAP_BEGIN - i,
+					    pfn_pte(__pa(empty_zero_page)
+					        >> PAGE_SHIFT,
+					    PAGE_KERNEL_RO));
+
+	/* Disable the 'start_pfn' allocator. */
+	table_end = start_pfn;
+
+	xprintk("finished!\n");
+}
+
+
 #else /* !XEN */
 
 static __meminit void *alloc_low_page(unsigned long *phys)
@@ -923,8 +1002,13 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 		unmap_low_page(pud);
 	}
 
-	if (!after_bootmem)
+	if (!after_bootmem) {
+#ifdef CONFIG_XEN
+		BUG_ON(start_pfn != table_end);
+		xen_finish_init_mapping();
+#endif
 		mmu_cr4_features = read_cr4();
+	}
 	__flush_tlb_all();
 
 	if (!after_bootmem)
-- 
1.5.4.1


linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch:

--- NEW FILE linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch ---
>From 03a453eae1ceb135f6a64af32b05b671ed3eb8eb Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:21:20 -0200
Subject: [PATCH] Pull spp_getpage() changes from XS upstream (REVIEWME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 310f7dd..8a6667e 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -289,7 +289,11 @@ static __init void *spp_getpage(void)
 
 	if (after_bootmem)
 		ptr = (void *) get_zeroed_page(GFP_ATOMIC);
-	else
+	else if (start_pfn < table_end) {
+		ptr = __va(start_pfn << PAGE_SHIFT);
+		start_pfn++;
+		memset(ptr, 0, PAGE_SIZE);
+	} else
 		ptr = alloc_bootmem_pages(PAGE_SIZE);
 
 	if (!ptr || ((unsigned long)ptr & ~PAGE_MASK)) {
-- 
1.5.4.1


linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch:

--- NEW FILE linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch ---
>From 784b124fc85921b6e57bb892cf27aa3330448be5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:22:29 -0200
Subject: [PATCH] Pull xen_extend_init_mapping() from XS upstream (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 8a6667e..b44f661 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -564,6 +564,60 @@ static void xen_finish_init_mapping(void)
 	xprintk("finished!\n");
 }
 
+static void __init xen_extend_init_mapping(unsigned long tables_space)
+{
+	unsigned long va = __START_KERNEL_map;
+	unsigned long phys, addr, *pte_page;
+	pmd_t *pmd;
+	pte_t *pte, new_pte;
+	unsigned long *page = (unsigned long *)init_level4_pgt;
+
+	addr = page[pgd_index(va)];
+	addr_to_page(addr, page);
+	addr = page[pud_index(va)];
+	addr_to_page(addr, page);
+
+	/* Kill mapping of low 1MB. */
+	while (va < (unsigned long)&_text) {
+		HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+		va += PAGE_SIZE;
+	}
+
+	/* Ensure init mappings cover kernel text/data and initial tables. */
+	while (va < (__START_KERNEL_map
+		     + (start_pfn << PAGE_SHIFT)
+		     + tables_space)) {
+		pmd = (pmd_t *)&page[pmd_index(va)];
+		if (pmd_none(*pmd)) {
+			pte_page = alloc_low_page(&phys);
+			early_make_page_readonly(
+				pte_page, XENFEAT_writable_page_tables);
+			set_pmd(pmd, __pmd(phys | _KERNPG_TABLE));
+		} else {
+			addr = page[pmd_index(va)];
+			addr_to_page(addr, pte_page);
+		}
+		pte = (pte_t *)&pte_page[pte_index(va)];
+		if (pte_none(*pte)) {
+			new_pte = pfn_pte(
+				(va - __START_KERNEL_map) >> PAGE_SHIFT, 
+				__pgprot(_KERNPG_TABLE));
+			set_pte_at(&init_mm, va, pte, new_pte);
+		}
+		va += PAGE_SIZE;
+	}
+
+	/* Finally, blow away any spurious initial mappings. */
+	while (1) {
+		pmd = (pmd_t *)&page[pmd_index(va)];
+		if (pmd_none(*pmd))
+			break;
+		HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
+		va += PAGE_SIZE;
+	}
+}
+
+
 
 #else /* !XEN */
 
@@ -799,7 +853,7 @@ static void __init find_early_table_space(unsigned long end)
 		round_up(ptes * 8, PAGE_SIZE); 
 
 	/*FIXME: what does this do? */
-	//extend_init_mapping(tables);
+	xen_extend_init_mapping(tables);
 
 	table_start = start_pfn;
 	table_end = table_start + (tables>>PAGE_SHIFT);
-- 
1.5.4.1


linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch ---
>From e69ad7a5a03f4daa1342671901ef6f19856d6c1f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:28:40 -0200
Subject: [PATCH] New enum fixed_addresses values (REVIEWME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/fixmap_32.h |    3 +++
 include/asm-x86/fixmap_64.h |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/fixmap_32.h b/include/asm-x86/fixmap_32.h
index 0878fba..b02a7cf 100644
--- a/include/asm-x86/fixmap_32.h
+++ b/include/asm-x86/fixmap_32.h
@@ -89,6 +89,9 @@ enum fixed_addresses {
 #ifdef CONFIG_PARAVIRT
 	FIX_PARAVIRT_BOOTMAP,
 #endif
+#define NR_FIX_ISAMAPS	256
+	FIX_ISAMAP_END,
+	FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
 	__end_of_permanent_fixed_addresses,
 	/*
 	 * 256 temporary boot-time mappings, used by early_ioremap(),
diff --git a/include/asm-x86/fixmap_64.h b/include/asm-x86/fixmap_64.h
index 8436081..472383c 100644
--- a/include/asm-x86/fixmap_64.h
+++ b/include/asm-x86/fixmap_64.h
@@ -52,6 +52,15 @@ enum fixed_addresses {
 #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 	FIX_OHCI1394_BASE,
 #endif
+#define NR_FIX_ISAMAPS	256
+	FIX_ISAMAP_END,
+	FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
+	__end_of_permanent_fixed_addresses,
+	/* temporary boot-time mappings, used before ioremap() is functional */
+#define NR_FIX_BTMAPS	16
+	FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
+	FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
+	FIX_WP_TEST,
 	__end_of_fixed_addresses
 };
 
-- 
1.5.4.1


linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch:

--- NEW FILE linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch ---
>From 105c5f62ca3e8129435c230929c6398c3e20e716 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 20 Dec 2007 16:03:58 -0200
Subject: [PATCH] Reserve bootmem areas used by Xen (FIXME)

Should be moved to pvops code.

Debugging needs to be removed.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 8ca3313..90c6efa 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -79,6 +79,12 @@
 #define ARCH_SETUP
 #endif
 
+
+/*FIXME: remove xen-specific code here */
+#include <xen/page.h>
+#include <asm/xen/hypervisor.h>
+
+
 /*
  * Machine setup..
  */
@@ -456,6 +462,22 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled)
 		efi_reserve_bootmem();
 
+#ifdef CONFIG_XEN
+	/*FIXME: pvops */
+	/* Reserve phys_to_machine_mapping */
+	reserve_bootmem(__pa(phys_to_machine_mapping),
+			sizeof(unsigned long *)*xen_start_info->nr_pages,
+			BOOTMEM_DEFAULT);
+
+	/* Reserve initial pagetables*/
+	/*FIXME: probably they are not used anymore and may be made
+	 * writeable again after the kernel page tables are set up.
+	 */
+	reserve_bootmem(__pa(xen_start_info->pt_base),
+			xen_start_info->nr_pt_frames*PAGE_SIZE,
+			BOOTMEM_DEFAULT);
+#endif
+
        /*
 	* Find and reserve possible boot-time SMP configuration:
 	*/
-- 
1.5.4.1


linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch:

--- NEW FILE linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch ---
>From f56578be4f7009c261122d20ff9cd041c9073564 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 20 Dec 2007 16:45:51 -0200
Subject: [PATCH] xen_convert_trap_info(): use sizeof(struct gate_desc)

This will make it consider the corect size depending on the architecture.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 54e0e5d..c825f81 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -475,7 +475,7 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
 {
 	unsigned in, out, count;
 
-	count = (desc->size+1) / 8;
+	count = (desc->size+1) / sizeof(gate_desc);
 	BUG_ON(count > 256);
 
 	for (in = out = 0; in < count; in++) {
-- 
1.5.4.1


linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch:

--- NEW FILE linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch ---
>From 6be089cc29c9b730299b02fcb2ad63e5b884aa4d Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 21 Dec 2007 11:57:55 -0200
Subject: [PATCH] Call paravirt_pagetable_setup_{start,done} (REVIEW)

These paravirt_ops functions were not being called
on x86_64.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 90c6efa..9041779 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -510,7 +510,9 @@ void __init setup_arch(char **cmdline_p)
 
 	reserve_ibft_region();
 
+	paravirt_pagetable_setup_start(swapper_pg_dir);
 	paging_init();
+	paravirt_pagetable_setup_done(swapper_pg_dir);
 	map_vsyscall();
 
 	early_quirks();
-- 
1.5.4.1


linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch ---
>From 6b7dde13064b3cf27355cb666b0dc0da9ace3c2c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:34:59 -0200
Subject: [PATCH] ifdef CONFIG_X86_32 on xen/enlighten.c (REVIEWME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index c825f81..7c6ccb1 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -853,12 +853,18 @@ static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
 
 static __init void xen_pagetable_setup_start(pgd_t *base)
 {
+#ifdef CONFIG_X86_32
 	pgd_t *xen_pgd = (pgd_t *)xen_start_info->pt_base;
+#endif
 
 	/* special set_pte for pagetable initialization */
 	pv_mmu_ops.set_pte = xen_set_pte_init;
 
 	init_mm.pgd = base;
+
+#ifdef CONFIG_X86_32
+	/*FIXME: for x86_64, pull the mm/init_64.c code here */
+
 	/*
 	 * copy top-level of Xen-supplied pagetable into place.	 For
 	 * !PAE we can use this as-is, but for PAE it is a stand-in
@@ -897,6 +903,7 @@ static __init void xen_pagetable_setup_start(pgd_t *base)
 	 * added to the table can be prepared properly for Xen.
 	 */
 	xen_write_cr3(__pa(base));
+#endif
 
 	/* Unpin initial Xen pagetable */
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
@@ -940,6 +947,9 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
 
 	setup_shared_info();
 
+#ifdef CONFIG_X86_32
+	/*FIXME: for x86_64, code needs to be pulled from mm/init_64.c */
+
 	/* Actually pin the pagetable down, but we can't set PG_pinned
 	   yet because the page structures don't exist yet. */
 	{
@@ -953,6 +963,7 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
 
 		pin_pagetable_pfn(level, PFN_DOWN(__pa(base)));
 	}
+#endif
 }
 
 /* This is called once we have the cpu_possible_map */
-- 
1.5.4.1


linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch:

--- NEW FILE linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch ---
>From 6494f02cc2c93cc82857445d3f399ead9e54bbb3 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 24 Dec 2007 17:22:58 -0200
Subject: [PATCH] Handle Xen exception stack (it is different from baremetal stack) (FIXME)

Now Oopses make sense!  :D

FIXME: This needs to be handled differently at runtime, not compile time.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 3fedbd6..d026834 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -728,11 +728,28 @@ ENTRY(spurious_interrupt)
 	apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
 END(spurious_interrupt)
 				
+
+/* Xen register handling */
+#ifdef CONFIG_XEN
+	/*FIXME: select this at runtime */
+	.macro xen_fix_stack
+	movq (%rsp),%rcx
+	CFI_RESTORE rcx
+	movq 8(%rsp),%r11
+	CFI_RESTORE r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+	CFI_ADJUST_CFA_OFFSET -0x10
+	.endm
+#else
+	.macro xen_fix_stack
+	.endm
+#endif
 /*
  * Exception entry points.
  */ 		
 	.macro zeroentry sym
 	INTR_FRAME
+	xen_fix_stack
 	pushq $0	/* push error code/oldrax */ 
 	CFI_ADJUST_CFA_OFFSET 8
 	pushq %rax	/* push real oldrax to the rdi slot */ 
@@ -745,6 +762,7 @@ END(spurious_interrupt)
 
 	.macro errorentry sym
 	XCPT_FRAME
+	xen_fix_stack
 	pushq %rax
 	CFI_ADJUST_CFA_OFFSET 8
 	CFI_REL_OFFSET rax,0
-- 
1.5.4.1


linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch:

--- NEW FILE linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch ---
>From 97ae27f16b24ae003912073bc3b36ba6e2500dc7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 26 Dec 2007 15:51:34 -0200
Subject: [PATCH] Implement 64-bit version of HYPERVISOR_set_callbacks() (IFDEF?)

HYPERVISOR_set_callbacks() interface is different on x86_64.

(More #ifdef abuse).

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c            |    6 ++++++
 include/asm-x86/xen/hypercall.h |   12 ++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index ebf9346..140d143 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -113,8 +113,14 @@ void __init xen_arch_setup(void)
 	if (!xen_feature(XENFEAT_auto_translated_physmap))
 		HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_pae_extended_cr3);
 
+#ifdef CONFIG_X86_32
 	HYPERVISOR_set_callbacks(__KERNEL_CS, (unsigned long)xen_hypervisor_callback,
 				 __KERNEL_CS, (unsigned long)xen_failsafe_callback);
+#else
+	HYPERVISOR_set_callbacks((unsigned long)xen_hypervisor_callback,
+				 (unsigned long)xen_failsafe_callback,
+				 (unsigned long)system_call);
+#endif
 
 	xen_enable_sysenter();
 
diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index 2ee807b..c3359e7 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -226,6 +226,7 @@ HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
 	return _hypercall2(int, stack_switch, ss, esp);
 }
 
+#ifdef CONFIG_X86_32
 static inline int
 HYPERVISOR_set_callbacks(unsigned long event_selector,
 			 unsigned long event_address,
@@ -236,6 +237,17 @@ HYPERVISOR_set_callbacks(unsigned long event_selector,
 			   event_selector, event_address,
 			   failsafe_selector, failsafe_address);
 }
+#else  /* CONFIG_X86_64 */
+static inline int
+HYPERVISOR_set_callbacks(unsigned long event_address,
+			unsigned long failsafe_address,
+			unsigned long syscall_address)
+{
+	return _hypercall3(int, set_callbacks,
+			   event_address, failsafe_address,
+			   syscall_address);
+}
+#endif  /* CONFIG_X86_{32,64} */
 
 static inline int
 HYPERVISOR_callback_op(int cmd, void *arg)
-- 
1.5.4.1


linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch:

--- NEW FILE linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch ---
>From b8617d563c0031f4c25b41c0e6f558db5ff6911f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 27 Dec 2007 17:33:32 -0200
Subject: [PATCH] Make arch_vcpu_info be of the right size on both 32 and 64 bits

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/interface.h |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h
index daab389..cd28b0f 100644
--- a/include/asm-x86/xen/interface.h
+++ b/include/asm-x86/xen/interface.h
@@ -195,8 +195,16 @@ struct arch_shared_info {
 };
 
 struct arch_vcpu_info {
-    unsigned long cr2;
-    unsigned long pad[5]; /* sizeof(struct vcpu_info) == 64 */
+    union {
+        struct {
+            /* The "real" struct */
+            unsigned long cr2;
+        };
+        struct {
+            /* force struct size to 16 bytes */
+            char fill[16];
+        };
+    };
 };
 
 struct xen_callback {
-- 
1.5.4.1


linux-2.6-xen-0077-Implement-asm-xen_iret.patch:

--- NEW FILE linux-2.6-xen-0077-Implement-asm-xen_iret.patch ---
>From 7e59245cea788c23ce4e8dabfb02ce4f37d1672e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 11 Feb 2008 11:59:29 -0200
Subject: [PATCH] Implement asm xen_iret

Not optimized yet. Always return through the hypervisor.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/xen-asm_64.S |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
index 38443b8..8f28a91 100644
--- a/arch/x86/xen/xen-asm_64.S
+++ b/arch/x86/xen/xen-asm_64.S
@@ -6,3 +6,10 @@ check_events:
 ENTRY(xen_iret_direct)
 	/*FIXME: implement me! */
 	ud2a
+
+ENTRY(xen_iret)
+	/*FIXME: the VGCF_in_syscall flag need to be handled here */
+	pushq $0
+	jmp hypercall_page + (__HYPERVISOR_iret * 32)
+END(xen_iret)
+
-- 
1.5.4.1


linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch:

--- NEW FILE linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch ---
>From 8582de8a72212623b1ae3842fbb648b7ec6ec2de Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:54:37 -0200
Subject: [PATCH] xen-64: xen_iret() use iretq directly if returning to kernel-space

Optimization pulled from upstream Xen.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/xen-asm.S    |    5 ++++
 arch/x86/xen/xen-asm_64.S |   49 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 2b4cd7d..5f00385 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -21,6 +21,11 @@
 #include <asm/asm-hack.h>
 
 #include <xen/interface/xen.h>
+#include <xen/interface/features.h>
+
+#include <asm/calling.h>
+#include <asm/processor-flags.h>
+
 
 #define RELOC(x, v)	.globl x##_reloc; x##_reloc=v
 #define ENDPATCH(x)	.globl x##_end; x##_end=.
diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
index 8f28a91..85c235c 100644
--- a/arch/x86/xen/xen-asm_64.S
+++ b/arch/x86/xen/xen-asm_64.S
@@ -7,7 +7,56 @@ ENTRY(xen_iret_direct)
 	/*FIXME: implement me! */
 	ud2a
 
+//FIXME: move to calling.h?
+#define IRETOFFSET RIP
+
 ENTRY(xen_iret)
+	/* Are we returning to kernel space? */
+	testb $3,CS-IRETOFFSET(%rsp)
+	jnz xen_iret_slow
+
+#if 0
+	/*FIXME: handle NMI callbacks */
+	testl $NMI_MASK,EFLAGS-IRETOFFSET(%rsp)
+	jnz xen_iret_slow
+#endif
+
+	/* If we are going to restore interrupts, we need to
+	 * return through the hypervisor, too.
+	 *
+	 * We may set evtchn_upcall_mask ourselves, but things get complicated
+	 * because we would need to avoid a stack overflow if we get
+	 * interrupts between upcall_mask being cleared and iret being
+	 * executed.
+	 */
+	testl $X86_EFLAGS_IF,EFLAGS-IRETOFFSET(%rsp)
+	jnz xen_iret_slow
+
+
+
+	/* Returning to kernel (RING0).
+	 * Use direct iret to kernel space after correcting CS and SS
+	 */
+
+	cmpb  $0,(xen_features+XENFEAT_supervisor_mode_kernel)(%rip)
+	/* supervisor_mode_kernel -> no need to correct CS and SS */
+	jne   xen_iretq
+
+	/* Direct iret to kernel space. Correct CS and SS. */
+	orl   $3,CS-IRETOFFSET(%rsp)
+	orl   $3,SS-IRETOFFSET(%rsp)
+xen_iretq:
+	iretq
+
+xen_iret_slow:
+	/* Slow iret via hypervisor */
+
+#if 0
+	/*FIXME: handle NMI callbacks */
+	andl  $~NMI_MASK, 2*8(%rsp)
+#endif
+
+	/* Xen has an additional value in the stack for iret */
 	/*FIXME: the VGCF_in_syscall flag need to be handled here */
 	pushq $0
 	jmp hypercall_page + (__HYPERVISOR_iret * 32)
-- 
1.5.4.1


linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch:

--- NEW FILE linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch ---
>From 4de23999c1637fdbb2deb0129cef7567b06366f6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 4 Feb 2008 18:06:53 -0200
Subject: [PATCH] Implement xen_irqenable_syscall_ret()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c  |    4 ++++
 arch/x86/xen/xen-asm_64.S |    8 ++++++++
 arch/x86/xen/xen-ops.h    |    1 +
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 7c6ccb1..2a8a1f6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1119,7 +1119,11 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
 	.read_pmc = native_read_pmc,
 
 	.iret = xen_iret,
+#ifdef CONFIG_X86_32
 	.irq_enable_syscall_ret = xen_sysexit,
+#else
+	.irq_enable_syscall_ret = xen_irqenable_syscall_ret,
+#endif
 
 	.load_tr_desc = paravirt_nop,
 	.set_ldt = xen_set_ldt,
diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
index 85c235c..9ceaeab 100644
--- a/arch/x86/xen/xen-asm_64.S
+++ b/arch/x86/xen/xen-asm_64.S
@@ -62,3 +62,11 @@ xen_iret_slow:
 	jmp hypercall_page + (__HYPERVISOR_iret * 32)
 END(xen_iret)
 
+#define VGCF_in_syscall (1<<8)
+
+ENTRY(xen_irqenable_syscall_ret)
+	orl $X86_EFLAGS_IF,EFLAGS-IRETOFFSET(%rsp)
+
+	pushq $VGCF_in_syscall
+	jmp hypercall_page + (__HYPERVISOR_iret * 32)
+END(xen_irqenable_syscall_ret)
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 2bacadd..4c0840f 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -74,5 +74,6 @@ DECL_ASM(void, xen_restore_fl_direct, unsigned long);
 
 void xen_iret(void);
 void xen_sysexit(void);
+void xen_irqenable_syscall_ret(void);
 
 #endif /* XEN_OPS_H */
-- 
1.5.4.1


linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch:

--- NEW FILE linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch ---
>From 755e69dbc05f8b6806a283cc53d4650144c5fab7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 4 Feb 2008 18:11:05 -0200
Subject: [PATCH] DEBUG: xen_iret: always return through the hypervisor

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/xen-asm_64.S |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
index 9ceaeab..95b3554 100644
--- a/arch/x86/xen/xen-asm_64.S
+++ b/arch/x86/xen/xen-asm_64.S
@@ -11,6 +11,9 @@ ENTRY(xen_iret_direct)
 #define IRETOFFSET RIP
 
 ENTRY(xen_iret)
+	/*FIXME: for debugging */
+	jmp xen_iret_slow
+
 	/* Are we returning to kernel space? */
 	testb $3,CS-IRETOFFSET(%rsp)
 	jnz xen_iret_slow
-- 
1.5.4.1


linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch:

--- NEW FILE linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch ---
>From b693da109b7b1e4a111e44ea542953ef1317ca06 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 11 Feb 2008 12:00:28 -0200
Subject: [PATCH] Implement some xen callbacks on xen/entry_64.S

hypervisor callback and failsafe callback. Not tested yet.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/entry_64.S |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
index c8c1473..927108c 100644
--- a/arch/x86/xen/entry_64.S
+++ b/arch/x86/xen/entry_64.S
@@ -1 +1,43 @@
-#error foo
+ENTRY(xen_hypervisor_callback)
+	zeroentry do_hypervisor_callback
+ENDPROC(xen_hypervisor_callback)
+
+ENTRY(xen_failsafe_callback)
+	/*FIXME: implement me! */
+	ud2a
+ENDPROC(xen_failsafe_callback)
+
+
+/*
+ * Copied from arch/xen/i386/kernel/entry.S
+ */               
+# A note on the "critical region" in our callback handler.
+# We want to avoid stacking callback handlers due to events occurring
+# during handling of the last event. To do this, we keep events disabled
+# until we've done all processing. HOWEVER, we must enable events before
+# popping the stack frame (can't be done atomically) and so it would still
+# be possible to get enough handler activations to overflow the stack.
+# Although unlikely, bugs of that kind are hard to track down, so we'd
+# like to avoid the possibility.
+# So, on entry to the handler we detect whether we interrupted an
+# existing activation in its critical region -- if so, we pop the current
+# activation and restart the handler using the previous one.
+ENTRY(do_hypervisor_callback)   # do_hypervisor_callback(struct *pt_regs)
+	CFI_STARTPROC
+# Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
+# see the correct pointer to the pt_regs
+	movq %rdi, %rsp            # we don't return, adjust the stack frame
+	CFI_ENDPROC
+	CFI_DEFAULT_STACK
+11:	incl %gs:pda_irqcount
+	movq %rsp,%rbp
+	CFI_DEF_CFA_REGISTER rbp
+	cmovzq %gs:pda_irqstackptr,%rsp
+	pushq %rbp			# backlink for old unwinder
+	call xen_evtchn_do_upcall
+	popq %rsp
+	CFI_DEF_CFA_REGISTER rsp
+	decl %gs:pda_irqcount
+	jmp  error_exit
+	CFI_ENDPROC
+END(do_hypervisor_callback)
-- 
1.5.4.1


linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch:

--- NEW FILE linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch ---
>From 2d70c17a8302722579cc3a3fbcd4247d461b69ec Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 11 Feb 2008 12:02:07 -0200
Subject: [PATCH] Xen-specific #ifdef hacks on kernel/entry_64.S (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index d026834..db76caa 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -922,13 +922,22 @@ error_sti:
 	call *%rax
 	/* ebx:	no swapgs flag (1: don't need swapgs, 0: need it) */
 error_exit:
+#ifndef CONFIG_XEN
+	/*FIXME: select at runtime */
 	movl %ebx,%eax
+#endif
 	RESTORE_REST
 	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
 	GET_THREAD_INFO(%rcx)	
+#ifndef CONFIG_XEN
+	/*FIXME: select at runtime */
 	testl %eax,%eax
 	jne  retint_kernel
+#else
+	testb $3,CS-ARGOFFSET(%rsp)
+	jz retint_kernel
+#endif
 	LOCKDEP_SYS_EXIT_IRQ
 	movl  threadinfo_flags(%rcx),%edx
 	movl  $_TIF_WORK_MASK,%edi
-- 
1.5.4.1


linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch:

--- NEW FILE linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch ---
>From 59643aad9471e4a7870d8f59fadf3e3e2dde91a3 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:30:17 -0200
Subject: [PATCH] Disable syscall32 code temporarily (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/vdso/vdso32-setup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index 8eb3ba0..a947011 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -210,6 +210,7 @@ static int use_sysenter __read_mostly = -1;
 /* May not be __init: called during resume */
 void syscall32_cpu_init(void)
 {
+#ifndef CONFIG_XEN
 	if (use_sysenter < 0) {
 		if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
 			use_sysenter = 1;
@@ -224,6 +225,7 @@ void syscall32_cpu_init(void)
 	checking_wrmsrl(MSR_IA32_SYSENTER_EIP, (u64)ia32_sysenter_target);
 
 	wrmsrl(MSR_CSTAR, ia32_cstar_target);
+#endif
 }
 
 #define compat_uses_vma		1
-- 
1.5.4.1


linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch:

--- NEW FILE linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch ---
>From 95182472a94e417c45c8e39be81198f6f70c4a07 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:35:15 -0200
Subject: [PATCH] Use __KERNEL_DS as SS when returning to a kernel thread (VERIFY)

This is needed when the kernel is running on RING3, such as under Xen.
x86_64 has a weird feature that makes it #GP on iret when SS is a null
descriptor.

This need to be tested on bare metal to make sure it doesn't cause any
problems. AMD specs say SS is always ignored (except on iret?).

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index db76caa..9f31c00 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -104,7 +104,8 @@ ENTRY(native_irq_enable_syscall_ret)
 	.macro FAKE_STACK_FRAME child_rip
 	/* push in order ss, rsp, eflags, cs, rip */
 	xorl %eax, %eax
-	pushq %rax /* ss */
+	/*FIXME: check if this causes problems on bare metal */
+	pushq $__KERNEL_DS /* ss */
 	CFI_ADJUST_CFA_OFFSET	8
 	/*CFI_REL_OFFSET	ss,0*/
 	pushq %rax /* rsp */
-- 
1.5.4.1


linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch:

--- NEW FILE linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch ---
>From 08a3b7ad411f05f71b37a3b14d4533adbaecf9cc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 13:37:35 -0200
Subject: [PATCH] Use apic_xen on genapic, by default (FIXME)

Needs to be handled at runtime.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/genapic_64.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index cbaaf69..9963c14 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -27,7 +27,14 @@
 
 DEFINE_PER_CPU(int, x2apic_extra_bits);
 
+
+#ifdef CONFIG_XEN
+/*FIXME: move to the proper header file */
+extern struct genapic apic_xen;
+struct genapic __read_mostly *genapic = &apic_xen;
+#else
 struct genapic __read_mostly *genapic = &apic_flat;
+#endif
 
 static enum uv_system_type uv_system_type;
 
@@ -36,6 +43,10 @@ static enum uv_system_type uv_system_type;
  */
 void __init setup_apic_routing(void)
 {
+#ifdef CONFIG_XEN
+	/*FIXME: handle this at runtime */
+	genapic = &apic_xen;
+#else
 	if (uv_system_type == UV_NON_UNIQUE_APIC)
 		genapic = &apic_x2apic_uv_x;
 	else
@@ -56,6 +67,7 @@ void __init setup_apic_routing(void)
 	else
 		genapic = &apic_physflat;
 
+#endif  /* CONFIG_XEN else */
 	printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name);
 }
 
-- 
1.5.4.1


linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch:

--- NEW FILE linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch ---
>From 87136c37c18648acfa61ba757f84fb3bd39c32bf Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:36:34 -0200
Subject: [PATCH] irq<->vector #ifdef chainsaw (FIXME)

Xen doesn't need the vector<->irq translation.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/irq_64.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 3aac154..f5e486c 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -167,7 +167,12 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
 
 	exit_idle();
 	irq_enter();
+#ifdef CONFIG_XEN
+	/*FIXME: make vector_irq[] make sense, at runtime */
+	irq = vector;
+#else
 	irq = __get_cpu_var(vector_irq)[vector];
+#endif
 
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
 	stack_overflow_check(regs);
-- 
1.5.4.1


linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch:

--- NEW FILE linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch ---
>From de785ffafddbbef217d466981eae07b98fca8319 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:39:15 -0200
Subject: [PATCH] ifdef chainsaw on syscall_init() (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup64.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c
index aee0e82..73a1f68 100644
--- a/arch/x86/kernel/setup64.c
+++ b/arch/x86/kernel/setup64.c
@@ -128,6 +128,8 @@ extern asmlinkage void ignore_sysret(void);
 /* May not be marked __init: used by software suspend */
 void syscall_init(void)
 {
+#ifndef CONFIG_XEN
+	/*FIXME: handle this using pvops */
 	/* 
 	 * LSTAR and STAR live in a bit strange symbiosis.
 	 * They both write to the same internal register. STAR allows to set CS/DS
@@ -136,14 +138,17 @@ void syscall_init(void)
 	wrmsrl(MSR_STAR,  ((u64)__USER32_CS)<<48  | ((u64)__KERNEL_CS)<<32); 
 	wrmsrl(MSR_LSTAR, system_call); 
 	wrmsrl(MSR_CSTAR, ignore_sysret);
+#endif
 
 #ifdef CONFIG_IA32_EMULATION   		
 	syscall32_cpu_init ();
 #endif
 
+#ifndef CONFIG_XEN
 	/* Flags to clear on syscall */
 	wrmsrl(MSR_SYSCALL_MASK,
 	       X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL);
+#endif
 }
 
 void __cpuinit check_efer(void)
-- 
1.5.4.1


linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch:

--- NEW FILE linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch ---
>From 4fa92bb44a6bc587dec25da5e07606b28038d5cb Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:40:38 -0200
Subject: [PATCH] Pull xen genapic implementation from upstream Xen

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/Makefile  |    2 +-
 arch/x86/xen/genapic.c |  190 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 191 insertions(+), 1 deletions(-)
 create mode 100644 arch/x86/xen/genapic.c

diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 0fdb30b..b24d9db 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -4,7 +4,7 @@ obj-y		:= enlighten.o setup.o multicalls.o mmu.o \
 ifeq ($(CONFIG_X86_32),y)
 obj-y 	+= init_32.o
 else
-obj-y	+= init_64.o
+obj-y	+= init_64.o genapic.o
 endif
 
 obj-$(CONFIG_SMP)	+= smp.o
diff --git a/arch/x86/xen/genapic.c b/arch/x86/xen/genapic.c
new file mode 100644
index 0000000..0b9e74e
--- /dev/null
+++ b/arch/x86/xen/genapic.c
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2004 James Cleverdon, IBM.
+ * Subject to the GNU Public License, v.2
+ *
+ * Xen APIC subarch code.  Maximum 8 CPUs, logical delivery.
+ *
+ * Hacked for x86-64 by James Cleverdon from i386 architecture code by
+ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
+ * James Cleverdon.
+ *
+ * Hacked to pieces for Xen by Chris Wright.
+ */
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/ctype.h>
+#include <linux/init.h>
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+#include <asm/smp.h>
+#include <asm/ipi.h>
+#else
+#include <asm/apic.h>
+#include <asm/apicdef.h>
+#endif
+#include <asm/genapic.h>
+#include <xen/events.h>
+
+DECLARE_PER_CPU(int, ipi_to_irq[XEN_NR_IPIS]);
+
+static inline void __send_IPI_one(unsigned int cpu, int vector)
+{
+	int irq = per_cpu(ipi_to_irq, cpu)[vector];
+	BUG_ON(irq < 0);
+	notify_remote_via_irq(irq);
+}
+
+void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
+{
+	int cpu;
+
+	switch (shortcut) {
+	case APIC_DEST_SELF:
+		__send_IPI_one(smp_processor_id(), vector);
+		break;
+	case APIC_DEST_ALLBUT:
+		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
+			if (cpu == smp_processor_id())
+				continue;
+			if (cpu_isset(cpu, cpu_online_map)) {
+				__send_IPI_one(cpu, vector);
+			}
+		}
+		break;
+	case APIC_DEST_ALLINC:
+		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
+			if (cpu_isset(cpu, cpu_online_map)) {
+				__send_IPI_one(cpu, vector);
+			}
+		}
+		break;
+	default:
+		printk("XXXXXX __send_IPI_shortcut %08x vector %d\n", shortcut,
+		       vector);
+		break;
+	}
+}
+
+static cpumask_t xen_target_cpus(void)
+{
+	return cpu_online_map;
+}
+
+static cpumask_t xen_vector_allocation_domain(int cpu)
+{
+	/* Careful. Some cpus do not strictly honor the set of cpus
+	 * specified in the interrupt destination when using lowest
+	 * priority interrupt delivery mode.
+	 *
+	 * In particular there was a hyperthreading cpu observed to
+	 * deliver interrupts to the wrong hyperthread when only one
+	 * hyperthread was specified in the interrupt desitination.
+	 */
+	cpumask_t domain = { { [0] = APIC_ALL_CPUS, } };
+	return domain;
+}
+
+/*
+ * Set up the logical destination ID.
+ * Do nothing, not called now.
+ */
+static void xen_init_apic_ldr(void)
+{
+	Dprintk("%s\n", __FUNCTION__);
+	return;
+}
+
+static void xen_send_IPI_mask(cpumask_t cpumask, int vector)
+{
+	unsigned long mask = cpus_addr(cpumask)[0];
+	unsigned int cpu;
+	unsigned long flags;
+
+	Dprintk("%s\n", __FUNCTION__);
+	local_irq_save(flags);
+	WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]);
+
+	for (cpu = 0; cpu < NR_CPUS; ++cpu) {
+		if (cpu_isset(cpu, cpumask)) {
+			__send_IPI_one(cpu, vector);
+		}
+	}
+	local_irq_restore(flags);
+}
+
+static void xen_send_IPI_allbutself(int vector)
+{
+#ifdef	CONFIG_HOTPLUG_CPU
+	int hotplug = 1;
+#else
+	int hotplug = 0;
+#endif
+	/*
+	 * if there are no other CPUs in the system then
+	 * we get an APIC send error if we try to broadcast.
+	 * thus we have to avoid sending IPIs in this case.
+	 */
+	Dprintk("%s\n", __FUNCTION__);
+	if (hotplug || vector == NMI_VECTOR) {
+		cpumask_t allbutme = cpu_online_map;
+
+		cpu_clear(smp_processor_id(), allbutme);
+
+		if (!cpus_empty(allbutme))
+			xen_send_IPI_mask(allbutme, vector);
+	} else if (num_online_cpus() > 1) {
+		xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
+	}
+}
+
+static void xen_send_IPI_all(int vector)
+{
+	Dprintk("%s\n", __FUNCTION__);
+	if (vector == NMI_VECTOR)
+		xen_send_IPI_mask(cpu_online_map, vector);
+	else
+		xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
+}
+
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+static int xen_apic_id_registered(void)
+{
+	/* better be set */
+	Dprintk("%s\n", __FUNCTION__);
+	return physid_isset(smp_processor_id(), phys_cpu_present_map);
+}
+#endif
+
+static unsigned int xen_cpu_mask_to_apicid(cpumask_t cpumask)
+{
+	Dprintk("%s\n", __FUNCTION__);
+	return cpus_addr(cpumask)[0] & APIC_ALL_CPUS;
+}
+
+static unsigned int phys_pkg_id(int index_msb)
+{
+	int ebx;
+	Dprintk("%s\n", __FUNCTION__);
+	ebx = cpuid_ebx(1);
+	return ((ebx >> 24) & 0xFF) >> index_msb;
+}
+
+struct genapic apic_xen =  {
+	.name = "xen",
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+	.int_delivery_mode = dest_LowestPrio,
+#endif
+	.int_dest_mode = (APIC_DEST_LOGICAL != 0),
+	.target_cpus = xen_target_cpus,
+	.vector_allocation_domain = xen_vector_allocation_domain,
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+	.apic_id_registered = xen_apic_id_registered,
+#endif
+	.init_apic_ldr = xen_init_apic_ldr,
+	.send_IPI_all = xen_send_IPI_all,
+	.send_IPI_allbutself = xen_send_IPI_allbutself,
+	.send_IPI_mask = xen_send_IPI_mask,
+	.cpu_mask_to_apicid = xen_cpu_mask_to_apicid,
+	.phys_pkg_id = phys_pkg_id,
+};
-- 
1.5.4.1


linux-2.6-xen-0089-Debugging-printk-s.patch:

--- NEW FILE linux-2.6-xen-0089-Debugging-printk-s.patch ---
>From c03690eba029710a2528d0b2af93e18d29e571ee Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:41:38 -0200
Subject: [PATCH] Debugging printk()s

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 init/main.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/init/main.c b/init/main.c
index e5ce967..744f815 100644
--- a/init/main.c
+++ b/init/main.c
@@ -610,18 +610,26 @@ asmlinkage void __init start_kernel(void)
 	rcu_init();
 	init_IRQ();
 	pidhash_init();
+	printk("init_timers:\n");
 	init_timers();
 	hrtimers_init();
 	softirq_init();
+	printk("timekeeping:\n");
 	timekeeping_init();
+	printk("time:\n");
 	time_init();
 	sched_clock_init();
+	printk("profile:\n");
 	profile_init();
+	printk("irqs_disabled:\n");
 	if (!irqs_disabled())
 		printk("start_kernel(): bug: interrupts were enabled early\n");
+	printk("early_boot_irqs_on:\n");
 	early_boot_irqs_on();
+	printk("local_irq_enable:\n");
 	local_irq_enable();
 
+	printk("console_init:\n");
 	/*
 	 * HACK ALERT! This is early. We're enabling the console before
 	 * we've done PCI setups etc, and console_init() must be aware of
@@ -660,7 +668,9 @@ asmlinkage void __init start_kernel(void)
 	numa_policy_init();
 	if (late_time_init)
 		late_time_init();
+	printk("calibrate_delay:\n");
 	calibrate_delay();
+	printk("pidmap_init:\n");
 	pidmap_init();
 	pgtable_cache_init();
 	prio_tree_init();
-- 
1.5.4.1


linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch:

--- NEW FILE linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch ---
>From 2fb6f44d67863203b1db8791b3937b1aa1e97416 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:43:40 -0200
Subject: [PATCH] Leave lazy_cpu_mode() on __switch_to()

Just like it is done on i386.

Note, We must leave lazy mode before switching the %fs and %gs
selectors.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/process_64.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index ac54ff5..2f0d6fa 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -590,6 +590,15 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 
 	load_TLS(next, cpu);
 
+	/*
+	 * Leave lazy mode, flushing any hypercalls made here.
+	 * This must be done before restoring TLS segments so
+	 * the GDT and LDT are properly updated, and must be
+	 * done before math_state_restore, so the TS bit is up
+	 * to date.
+	 */
+	arch_leave_lazy_cpu_mode();
+
 	/* 
 	 * Switch FS and GS.
 	 */
-- 
1.5.4.1


linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch:

--- NEW FILE linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch ---
>From 68d88dc3e8cd10eeb5e7351b5c9c48e85dcf4bb6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:45:33 -0200
Subject: [PATCH] xen-64: Handle %fs and %gs on xen_load_tls() properly

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 2a8a1f6..99e1aea 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -392,6 +392,7 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
 
 	xen_mc_issue(PARAVIRT_LAZY_CPU);
 
+#ifdef CONFIG_X86_32
 	/*
 	 * XXX sleazy hack: If we're being called in a lazy-cpu zone,
 	 * it means we're in a context switch, and %gs has just been
@@ -400,9 +401,21 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
 	 * Either way, it has been saved, and the new value will get
 	 * loaded properly.  This will go away as soon as Xen has been
 	 * modified to not save/restore %gs for normal hypercalls.
+	 *
+	 * This hack is not used on x86_64, because:
+	 * - For %gs: x86_64 gs points to KERNEL_GS_BASE (and uses it for PDA
+	 *   references), so we must not zero %gs on x86_64
+	 * - For %fs: x86_64 may have %fs pointing to TLS descriptors, but
+	 *   __switch_to() reads %fs after load_TLS(). We can't clear it
+	 *
+	 * FIXME: we need to be sure we don't _need_ the hack on x86_64.
+	 * Can we get a #GP when switch back from the hypervisor if
+	 * TLS descriptor is cleared but %fs still points to it?
 	 */
-	if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU)
+	if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) {
 		loadsegment(gs, 0);
+	}
+#endif
 }
 
 static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
-- 
1.5.4.1


linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch:

--- NEW FILE linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch ---
>From 46ec633fb9c22d63e86206f2579691a007fd8d89 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 11:46:49 -0200
Subject: [PATCH] Disable vcpu_info_placement temporarily (FIXME)

We are trying to make it work without it, first.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 99e1aea..69980df 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -121,6 +121,9 @@ static void __init xen_vcpu_setup(int cpu)
 	printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n",
 	       cpu, vcpup, info.mfn, info.offset);
 
+#ifdef CONFIG_x86_32
+	/*FIXME: implement this support on x86_64 */
+
 	/* Check to see if the hypervisor will put the vcpu_info
 	   structure where we want it, which allows direct access via
 	   a percpu-variable. */
@@ -137,6 +140,10 @@ static void __init xen_vcpu_setup(int cpu)
 		printk(KERN_DEBUG "cpu %d using vcpu_info at %p\n",
 		       cpu, vcpup);
 	}
+#else
+	have_vcpu_info_placement = 0;
+#endif
+
 }
 
 static void kcons_write_dom0(const char *s, unsigned int count)
-- 
1.5.4.1


linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch:

--- NEW FILE linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch ---
>From 4e09c390d03af3c41158ad2fce607bbcc56f073d Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 19:13:01 -0200
Subject: [PATCH] Fix typo on #ifdef (again)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 69980df..3efb4ca 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -121,7 +121,7 @@ static void __init xen_vcpu_setup(int cpu)
 	printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n",
 	       cpu, vcpup, info.mfn, info.offset);
 
-#ifdef CONFIG_x86_32
+#ifdef CONFIG_X86_32
 	/*FIXME: implement this support on x86_64 */
 
 	/* Check to see if the hypervisor will put the vcpu_info
-- 
1.5.4.1


linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch:

--- NEW FILE linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch ---
>From 3ea171b4c5f4a766466d2f6322427ef3d2725036 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 12:23:34 -0200
Subject: [PATCH] (DEBUG) Don't try to actually read the page on show_pgtable1()

It is crashing.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index b44f661..910f893 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -109,7 +109,7 @@ void show_pgtable1(pte_t *tbl, unsigned long addr)
 	page = vvva(pv & PHYSICAL_PAGE_MASK);
 
 	xprintk("\npage: %p\n", page);
-	xprintk("\npage val: %lx\n", *page);
+	//xprintk("\npage val: %lx\n", *page);
 }
 
 void show_pgtable2(pmd_t *tbl, unsigned long addr)
-- 
1.5.4.1


linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch:

--- NEW FILE linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch ---
>From 40abcc05d0f7543a18dc72b53ca430433ae80299 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 4 Jan 2008 12:33:43 -0200
Subject: [PATCH] Make load_gs_index() a paravirt operation

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |    4 ++--
 arch/x86/kernel/paravirt.c |    3 +++
 include/asm-x86/paravirt.h |   10 +++++++++-
 include/asm-x86/system.h   |    3 ++-
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 9f31c00..9952c3f 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -967,7 +967,7 @@ KPROBE_END(error_entry)
 	
        /* Reload gs selector with exception handling */
        /* edi:  new selector */ 
-ENTRY(load_gs_index)
+ENTRY(native_load_gs_index)
 	CFI_STARTPROC
 	pushf
 	CFI_ADJUST_CFA_OFFSET 8
@@ -981,7 +981,7 @@ gs_change:
 	CFI_ADJUST_CFA_OFFSET -8
         ret
 	CFI_ENDPROC
-ENDPROC(load_gs_index)
+ENDPROC(native_load_gs_index)
        
         .section __ex_table,"a"
         .align 8
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 0c077cd..8c4134c 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -324,6 +324,9 @@ struct pv_cpu_ops pv_cpu_ops = {
 	.store_idt = native_store_idt,
 	.store_tr = native_store_tr,
 	.load_tls = native_load_tls,
+#ifdef CONFIG_X86_64
+	.load_gs_index = native_load_gs_index,
+#endif
 	.write_ldt_entry = native_write_ldt_entry,
 	.write_gdt_entry = native_write_gdt_entry,
 	.write_idt_entry = native_write_idt_entry,
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ebc35de..f3384b5 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -118,6 +118,9 @@ struct pv_cpu_ops {
 #endif
 	unsigned long (*store_tr)(void);
 	void (*load_tls)(struct thread_struct *t, unsigned int cpu);
+#ifdef CONFIG_X86_64
+	void (*load_gs_index)(unsigned int idx);
+#endif
 	void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
 				const void *desc);
 	void (*write_gdt_entry)(struct desc_struct *,
@@ -815,7 +818,12 @@ static inline void load_TLS(struct thread_struct *t, unsigned cpu)
 {
 	PVOP_VCALL2(pv_cpu_ops.load_tls, t, cpu);
 }
-
+#ifdef CONFIG_X86_64
+static inline void load_gs_index(unsigned int idx)
+{
+	PVOP_VCALL1(pv_cpu_ops.load_gs_index, idx);
+}
+#endif
 static inline void write_ldt_entry(struct desc_struct *dt, int entry,
 				   const void *desc)
 {
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index a2f04cd..9f35c22 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -136,7 +136,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
 #define set_base(ldt, base) _set_base(((char *)&(ldt)) , (base))
 #define set_limit(ldt, limit) _set_limit(((char *)&(ldt)) , ((limit)-1))
 
-extern void load_gs_index(unsigned);
+extern void native_load_gs_index(unsigned); 
 
 /*
  * Load a segment. Fall back on loading the zero
@@ -282,6 +282,7 @@ static inline void native_wbinvd(void)
 #ifdef CONFIG_X86_64
 #define read_cr8()	(native_read_cr8())
 #define write_cr8(x)	(native_write_cr8(x))
+#define load_gs_index   native_load_gs_index
 #endif
 
 /* Clear the 'TS' bit */
-- 
1.5.4.1


linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch:

--- NEW FILE linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch ---
>From 2b24b3302a8a74a8f051f0c2f08ed8476f281dd8 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 7 Jan 2008 19:06:06 -0200
Subject: [PATCH] xen pgd_walk: use 'limit' argument instead of FIXADDR_TOP constant

Eliminating the usage of FIXADDR_TOP inside of pgd_walk(), so it
can become 64-bit-ready.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 17c9d91..081a118 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -368,11 +368,11 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return 0;
 
-	for (; addr != FIXADDR_TOP; pgd++, addr = pgd_next) {
+	for (; addr != limit; pgd++, addr = pgd_next) {
 		pud_t *pud;
 		unsigned long pud_limit, pud_next;
 
-		pgd_next = pud_limit = pgd_addr_end(addr, FIXADDR_TOP);
+		pgd_next = pud_limit = pgd_addr_end(addr, limit);
 
 		if (!pgd_val(*pgd))
 			continue;
@@ -386,12 +386,7 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
 			pmd_t *pmd;
 			unsigned long pmd_limit;
 
-			pud_next = pud_addr_end(addr, pud_limit);
-
-			if (pud_next < limit)
-				pmd_limit = pud_next;
-			else
-				pmd_limit = limit;
+			pud_next = pmd_limit = pud_addr_end(addr, pud_limit);
 
 			if (pud_none(*pud))
 				continue;
-- 
1.5.4.1


linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch:

--- NEW FILE linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch ---
>From ee7682d4aac622350639da702392a9ade1bb4cc1 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 7 Jan 2008 19:07:26 -0200
Subject: [PATCH] xen pgd_walk: Eliminate BUG_ON(limit > FIXADDR_TOP)

This BUG_ON() is 32-bit-specific.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 081a118..8f9edcb 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -363,8 +363,6 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
 	unsigned long addr = 0;
 	unsigned long pgd_next;
 
-	BUG_ON(limit > FIXADDR_TOP);
-
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return 0;
 
-- 
1.5.4.1


linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch:

--- NEW FILE linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch ---
>From 6084f07071a56f990c0364ecb46fc826aeb49279 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 7 Jan 2008 19:15:35 -0200
Subject: [PATCH] xen pgd_walk: accept 'start' parameter

Change usage of pgd_walk() to work under x86_64 also.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 8f9edcb..9e71196 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -356,16 +356,17 @@ void xen_set_pte(pte_t *ptep, pte_t pte)
   there, because then we start getting into Xen's ptes.
 */
 static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
-		    unsigned long limit)
+		    unsigned long start, unsigned long limit)
 {
-	pgd_t *pgd = pgd_base;
+	pgd_t *pgd;
 	int flush = 0;
-	unsigned long addr = 0;
+	unsigned long addr = start;
 	unsigned long pgd_next;
 
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return 0;
 
+	pgd = pgd_base + pgd_index(addr);
 	for (; addr != limit; pgd++, addr = pgd_next) {
 		pud_t *pud;
 		unsigned long pud_limit, pud_next;
@@ -493,7 +494,7 @@ void xen_pgd_pin(pgd_t *pgd)
 
 	xen_mc_batch();
 
-	if (pgd_walk(pgd, pin_page, TASK_SIZE)) {
+	if (pgd_walk(pgd, pin_page, 0, TASK_SIZE)) {
 		/* re-enable interrupts for kmap_flush_unused */
 		xen_mc_issue(0);
 		kmap_flush_unused();
@@ -520,9 +521,19 @@ static __init int mark_pinned(struct page *page, enum pt_level level)
 	return 0;
 }
 
+/* Addresses that will be walked on xen_mark_init_mm_pinned()
+ */
+#ifdef CONFIG_X86_32
+#  define INIT_MM_WALK_BEGIN 0
+#  define INIT_MM_WALK_END   FIXADDR_TOP
+#else
+#  define INIT_MM_WALK_BEGIN __START_KERNEL_map
+#  define INIT_MM_WALK_END   (__START_KERNEL_map + PGDIR_SIZE)
+#endif
+
 void __init xen_mark_init_mm_pinned(void)
 {
-	pgd_walk(init_mm.pgd, mark_pinned, FIXADDR_TOP);
+	pgd_walk(init_mm.pgd, mark_pinned, INIT_MM_WALK_BEGIN, INIT_MM_WALK_END);
 }
 
 static int unpin_page(struct page *page, enum pt_level level)
@@ -563,7 +574,7 @@ static void xen_pgd_unpin(pgd_t *pgd)
 
 	xen_do_pin(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
 
-	pgd_walk(pgd, unpin_page, TASK_SIZE);
+	pgd_walk(pgd, unpin_page, 0, TASK_SIZE);
 
 	xen_mc_issue(0);
 }
-- 
1.5.4.1


linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch:

--- NEW FILE linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch ---
>From 9d06ab6998bd632bf6370553faef0309b1d04ea8 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 19:51:36 -0200
Subject: [PATCH] xen-64: reserve_bootmem() xen_start_info area

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 9041779..52f82f7 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -476,6 +476,11 @@ void __init setup_arch(char **cmdline_p)
 	reserve_bootmem(__pa(xen_start_info->pt_base),
 			xen_start_info->nr_pt_frames*PAGE_SIZE,
 			BOOTMEM_DEFAULT);
+
+	/* Reserve xen_start_info area */
+	reserve_bootmem(__pa(xen_start_info),
+			sizeof(*xen_start_info),
+			BOOTMEM_DEFAULT);
 #endif
 
        /*
-- 
1.5.4.1


linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch:

--- NEW FILE linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch ---
>From d2898cd57e5f17b8bbb69ef0a972c87e9f7e7c80 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 19:52:23 -0200
Subject: [PATCH] pvops-64: call paravirt_post_allocator_init() on setup_arch()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 52f82f7..6831511 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -518,6 +518,8 @@ void __init setup_arch(char **cmdline_p)
 	paravirt_pagetable_setup_start(swapper_pg_dir);
 	paging_init();
 	paravirt_pagetable_setup_done(swapper_pg_dir);
+	paravirt_post_allocator_init();
+
 	map_vsyscall();
 
 	early_quirks();
-- 
1.5.4.1


linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch:

--- NEW FILE linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch ---
>From ba68c66704aa552d33c78ef7543d5570a6d82f23 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 19:53:14 -0200
Subject: [PATCH] use write_gdt_entry() on vsyscall_set_cpu() (CLEANME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/vsyscall_64.c |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 61efa2f..6d019fa 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -249,7 +249,8 @@ static ctl_table kernel_root_table2[] = {
    doesn't violate that. We'll find out if it does. */
 static void __cpuinit vsyscall_set_cpu(int cpu)
 {
-	unsigned long *d;
+	unsigned long v;
+	struct desc_struct *d;
 	unsigned long node = 0;
 #ifdef CONFIG_NUMA
 	node = cpu_to_node(cpu);
@@ -260,11 +261,27 @@ static void __cpuinit vsyscall_set_cpu(int cpu)
 	/* Store cpu number in limit so that it can be loaded quickly
 	   in user space in vgetcpu.
 	   12 bits for the CPU and 8 bits for the node. */
-	d = (unsigned long *)(get_cpu_gdt_table(cpu) + GDT_ENTRY_PER_CPU);
-	*d = 0x0f40000000000ULL;
-	*d |= cpu;
-	*d |= (node & 0xf) << 12;
-	*d |= (node >> 4) << 48;
+#if 0
+	d = (struct desc_struct*)&v;
+	d.limit0 = 0;
+	d.base0 = 0;
+	d.base1 = 0;
+	d.type = 4; //FIXME: constant?
+	d.s = 1;
+	d.dpl = 3;
+	d.p = 1;
+	d.limit = 0;
+	d.avl = d.l = d.d = d.g = 0;
+#else
+	v = 0x0000f40000000000ULL;
+#endif
+	v |= cpu;
+	v |= (node & 0xf) << 12;
+	v |= (node >> 4) << 48;
+
+	//printk("limit0: %lx, base0: %lx, base1: %lx, type: %lx, s: %d, dpl: %d, p: %d, limit: %lx, avl: %d, l: %d, d: %d, g: %d, base2: %lx\n", d->limit0, d->base0, d->base1, d->type, d->s, d->dpl, d->p, d->limit, d->avl, d->l, d->d, d->g, d->base2);
+
+	write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &v, sizeof(v));
 }
 
 static void __cpuinit cpu_vsyscall_init(void *arg)
-- 
1.5.4.1


linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch:

--- NEW FILE linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch ---
>From 782ba5167aee736be00f44f7d2772c038cbe8de0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 19:56:21 -0200
Subject: [PATCH] xen-64: implement xen_load_gs_index()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 3efb4ca..68104a3 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -425,6 +425,13 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
 #endif
 }
 
+#ifdef CONFIG_X86_64
+static void xen_load_gs_index(unsigned int idx)
+{
+	HYPERVISOR_set_segment_base(SEGBASE_GS_USER_SEL, idx);
+}
+#endif
+
 static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
 				const void *ptr)
 {
@@ -1153,6 +1160,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
 	.load_gdt = xen_load_gdt,
 	.load_idt = xen_load_idt,
 	.load_tls = xen_load_tls,
+#ifdef CONFIG_X86_64
+	.load_gs_index = xen_load_gs_index,
+#endif
 
 	.store_gdt = native_store_gdt,
 	.store_idt = native_store_idt,
-- 
1.5.4.1


linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch ---
>From 4b91fa663ad4aa18bc339d1e0ddf35be38f45ce5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 13 Jun 2008 17:55:49 -0300
Subject: [PATCH] Make xen_pgd_unpin() non-static  (REVIEWME)

It will be used later on pgd_free().

(Must check why it is being declared on two header files)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c         |    2 +-
 arch/x86/xen/mmu.h         |    2 ++
 include/asm-x86/xen/page.h |    3 +++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 9e71196..b8a32c6 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -568,7 +568,7 @@ static int unpin_page(struct page *page, enum pt_level level)
 }
 
 /* Release a pagetables pages back as normal RW */
-static void xen_pgd_unpin(pgd_t *pgd)
+void xen_pgd_unpin(pgd_t *pgd)
 {
 	xen_mc_batch();
 
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index b25b8e4..28e5225 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -63,4 +63,6 @@ void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
 void xen_pmd_clear(pmd_t *pmdp);
 #endif
 
+void xen_pgd_unpin(pgd_t *pgd);
+
 #endif	/* _XEN_MMU_H */
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index ead46b2..9664303 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -169,4 +169,7 @@ xmaddr_t arbitrary_virt_to_machine(unsigned long address);
 void make_lowmem_page_readonly(void *vaddr);
 void make_lowmem_page_readwrite(void *vaddr);
 
+extern void xen_pgd_unpin(pgd_t *pgd);
+
+
 #endif /* __XEN_PAGE_H */
-- 
1.5.4.1


linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch:

--- NEW FILE linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch ---
>From 59806fdcc115269e9b7620185e70de88eba74834 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 13 Jun 2008 17:57:18 -0300
Subject: [PATCH] Xen-64 pgd allocation hack  (FIXME)

Define __user_pgd() and alloc two PGDs on pgd_alloc().

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/pgtable.c     |   32 ++++++++++++++++++++++++++++++--
 include/asm-x86/pgalloc.h |   11 +++++++++++
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 5015976..b9d78f4 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -3,6 +3,15 @@
 #include <asm/pgtable.h>
 #include <asm/tlb.h>
 
+#ifdef CONFIG_XEN
+
+#include <xen/page.h>
+
+extern pud_t level3_user_pgt[512];
+
+#endif
+
+
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
 	return (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
@@ -210,7 +219,7 @@ static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgd)
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
+	pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
 
 	/* so that alloc_pmd can use it */
 	mm->pgd = pgd;
@@ -223,6 +232,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 		pgd = NULL;
 	}
 
+	memset(__user_pgd(pgd), 0, PAGE_SIZE); /* clean up user pgd */
+	/*
+	 * Set level3_user_pgt for vsyscall area
+	 */
+	set_pgd(__user_pgd(pgd) + pgd_index(VSYSCALL_START), 
+		mk_kernel_pgd(__pa_symbol(level3_user_pgt)));
+
+
 	return pgd;
 }
 
@@ -230,7 +247,18 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
 	pgd_mop_up_pmds(mm, pgd);
 	pgd_dtor(pgd);
-	free_page((unsigned long)pgd);
+
+#ifdef CONFIG_XEN
+	/* Unpin and make it read-write again, in the (likely) case
+	 * it was pinned
+	 *
+	 * FIXME: should be a paravirt_ops hook
+	 */
+	xen_pgd_unpin(pgd);
+	make_lowmem_page_readwrite(pgd);
+#endif
+
+	free_pages((unsigned long)pgd, 1);
 }
 
 int ptep_set_access_flags(struct vm_area_struct *vma,
diff --git a/include/asm-x86/pgalloc.h b/include/asm-x86/pgalloc.h
index 91d7753..52c5e32 100644
--- a/include/asm-x86/pgalloc.h
+++ b/include/asm-x86/pgalloc.h
@@ -7,6 +7,17 @@
 
 #include <asm/vsyscall.h>
 
+
+#ifdef CONFIG_X86_64
+#ifdef CONFIG_XEN
+/*FIXME: use pvops */
+static inline pgd_t *__user_pgd(pgd_t *pgd)
+{
+	return pgd + PTRS_PER_PGD;
+}
+#endif
+#endif
+
 #ifdef CONFIG_PARAVIRT
 #include <asm/paravirt.h>
 #else
-- 
1.5.4.1


linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch:

--- NEW FILE linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch ---
>From 6566adf2e9343dea2d4046bfd392a8394d2f8810 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 10 Jun 2008 18:10:18 -0300
Subject: [PATCH] Set both kernel and user PGDs on pgd_populate()  (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgalloc.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/pgalloc.h b/include/asm-x86/pgalloc.h
index 52c5e32..edb4811 100644
--- a/include/asm-x86/pgalloc.h
+++ b/include/asm-x86/pgalloc.h
@@ -103,6 +103,9 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
 {
 	paravirt_alloc_pud(mm, __pa(pud) >> PAGE_SHIFT);
 	set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud)));
+
+	/*FIXME: hook this on paravirt_ops somehow */
+	set_pgd(__user_pgd(pgd), __pgd(_PAGE_TABLE | __pa(pud)));
 }
 
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
-- 
1.5.4.1


linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch:

--- NEW FILE linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch ---
>From ebf8974d35318a89bc34c7c858d5f5a3af373bdf Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 20:02:02 -0200
Subject: [PATCH] Multi-pagetable write_cr3() implementation (FIXME)

x86_64-specific. Needs #ifdefs.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 68104a3..7c722d6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -37,6 +37,7 @@
 
 #include <asm/paravirt.h>
 #include <asm/page.h>
+#include <asm/pgalloc.h>
 #include <asm/xen/hypercall.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/fixmap.h>
@@ -723,7 +724,10 @@ static void xen_write_cr3(unsigned long cr3)
 
 	BUG_ON(preemptible());
 
-	mcs = xen_mc_entry(sizeof(*op));  /* disables interrupts */
+	xen_mc_batch();  /* disables interrupts */
+
+
+	mcs = __xen_mc_entry(sizeof(*op));
 
 	/* Update while interrupts are disabled, so its atomic with
 	   respect to ipis */
@@ -739,9 +743,32 @@ static void xen_write_cr3(unsigned long cr3)
 	   been submitted. */
 	xen_mc_callback(set_current_cr3, (void *)cr3);
 
+#ifdef CONFIG_X86_64
+	{
+	pgd_t *pgd = __va(cr3);
+	unsigned long user_mfn = virt_to_mfn(__user_pgd(pgd));
+
+	mcs = __xen_mc_entry(sizeof(*op));
+
+	op = mcs.args;
+	op->cmd = MMUEXT_NEW_USER_BASEPTR;
+	/* pgd_alloc() allocates two pages for us. the second one is the
+	 * user page table
+	 */
+	op->arg1.mfn = user_mfn;
+
+	MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
+	}
+#endif
+
 	xen_mc_issue(PARAVIRT_LAZY_CPU);  /* interrupts restored */
 }
 
+#ifdef CONFIG_X86_64
+#if 0
+/*
+ * FIXME: unused
+ */
 static void xen_new_user_baseptr(unsigned long pfn)
 {
 	struct mmuext_op *op;
@@ -760,6 +787,8 @@ static void xen_new_user_baseptr(unsigned long pfn)
 
 	xen_mc_issue(PARAVIRT_LAZY_CPU);  /* interrupts restored */
 }
+#endif
+#endif
 
 /* Early in boot, while setting up the initial pagetable, assume
    everything is pinned. */
-- 
1.5.4.1


linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch:

--- NEW FILE linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch ---
>From 133c6509195fbeaf2c379be19f87df44ba50cfff Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 15:15:34 -0200
Subject: [PATCH] Disable the weird count loop on kcons_write_dom0()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 7c722d6..e3c678b 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -149,6 +149,7 @@ static void __init xen_vcpu_setup(int cpu)
 
 static void kcons_write_dom0(const char *s, unsigned int count)
 {
+#if 0
        int rc;
 
        while ((count > 0) &&
@@ -157,6 +158,9 @@ static void kcons_write_dom0(const char *s, unsigned int count)
                count -= rc;
                s += rc;
        }
+#else
+	HYPERVISOR_console_io(CONSOLEIO_write, count, (char *)s);
+#endif
 }
 
 
-- 
1.5.4.1


linux-2.6-xen-0108-Make-xen_start_info-read-only.patch:

--- NEW FILE linux-2.6-xen-0108-Make-xen_start_info-read-only.patch ---
>From 1f4202af10f96ed734d050f225e5c30d038f9fda Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 14 Jan 2008 20:20:55 -0200
Subject: [PATCH] Make xen_start_info read-only

It will aid debugging, catching if anybody tries to write to it.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 910f893..f84c28b 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -509,6 +509,12 @@ static void xen_finish_init_mapping(void)
 			__va(__pa(xen_start_info->mod_start));
 
 	xprintk("messed with start_info.\n");
+	xprintk("making it read-only:\n");
+
+	/* Make it read-only to catch if anybody touches it by accident.
+	 */
+	__make_page_readonly(xen_start_info);
+
 	xprintk("unmapping:\n");
 
 	/* Destroy the Xen-created mappings beyond the kernel image as
-- 
1.5.4.1


linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch:

--- NEW FILE linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch ---
>From fb4818c73bde19865ae8cba10ddacef9ab236cf0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 18 Jan 2008 17:12:43 -0200
Subject: [PATCH] Hack to implement return to userspace without SWAPGS (CLEANME)

Implementing SWAPGS as nop wouldn't be good, because code using it may
really expect a swapgs operation to be done. It is better to make each
operation that use swapgs to be a paravirt op.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |   15 ++++++++++++++-
 arch/x86/xen/entry_64.S    |   10 ++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 9952c3f..1182250 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -66,6 +66,17 @@ ENTRY(native_irq_enable_syscall_ret)
 #endif /* CONFIG_PARAVIRT */
 
 
+/*FIXME: implement this as a paravirt op */
+#ifdef CONFIG_XEN
+#define retint_swapgs xen_retint_swapgs
+#define error_userspace error_sti
+#else
+#define retint_swapgs native_retint_swapgs
+#define error_userspace error_swapgs
+#endif
+
+
+
 .macro TRACE_IRQS_IRETQ offset=ARGOFFSET
 #ifdef CONFIG_TRACE_IRQFLAGS
 	bt   $9,EFLAGS-\offset(%rsp)	/* interrupts off? */
@@ -564,8 +575,9 @@ retint_check:
 	andl %edi,%edx
 	CFI_REMEMBER_STATE
 	jnz  retint_careful
+	jmp retint_swapgs
 
-retint_swapgs:		/* return to user-space */
+native_retint_swapgs:		/* return to user-space */
 	/*
 	 * The iretq could re-enable interrupts:
 	 */
@@ -912,6 +924,7 @@ KPROBE_ENTRY(error_entry)
 	xorl %ebx,%ebx	
 	testl $3,CS(%rsp)
 	je  error_kernelspace
+	jmp error_userspace
 error_swapgs:	
 	SWAPGS
 error_sti:	
diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
index 927108c..2a2a0a0 100644
--- a/arch/x86/xen/entry_64.S
+++ b/arch/x86/xen/entry_64.S
@@ -41,3 +41,13 @@ ENTRY(do_hypervisor_callback)   # do_hypervisor_callback(struct *pt_regs)
 	jmp  error_exit
 	CFI_ENDPROC
 END(do_hypervisor_callback)
+
+
+ENTRY(xen_retint_swapgs)		/* return to user-space */
+	/*
+	 * The iretq could re-enable interrupts:
+	 */
+	DISABLE_INTERRUPTS(CLBR_ANY)
+	TRACE_IRQS_IRETQ
+	jmp restore_args
+END(xen_retint_swapgs)
-- 
1.5.4.1


linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch:

--- NEW FILE linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch ---
>From 568fd09892ddf7ed67f1549abb29a3671dd420ba Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 15:36:24 -0200
Subject: [PATCH] Xen: SEGBASE_* defines

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/interface.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h
index cd28b0f..ac0bf04 100644
--- a/include/asm-x86/xen/interface.h
+++ b/include/asm-x86/xen/interface.h
@@ -120,6 +120,17 @@ DEFINE_GUEST_HANDLE(void);
 #ifndef __ASSEMBLY__
 
 /*
+ * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base)
+ *  @which == SEGBASE_*  ;  @base == 64-bit base address
+ * Returns 0 on success.
+ */
+#define SEGBASE_FS          0
+#define SEGBASE_GS_USER     1
+#define SEGBASE_GS_KERNEL   2
+#define SEGBASE_GS_USER_SEL 3 /* Set user %gs specified in base[15:0] */
+
+
+/*
  * Send an array of these to HYPERVISOR_set_trap_table()
  */
 #define TI_GET_DPL(_ti)		((_ti)->flags & 3)
-- 
1.5.4.1


linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch:

--- NEW FILE linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch ---
>From bcc723c526e47ba3f092c46003bd430dc8228eaa Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 15:37:20 -0200
Subject: [PATCH] Xen: HYPERVISOR_set_segment_base() implementation

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/xen/hypercall.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index c3359e7..e411fd3 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -406,6 +406,16 @@ HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
 	return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
 }
 
+#ifdef CONFIG_X86_64
+static inline int
+HYPERVISOR_set_segment_base(
+	int reg, unsigned long value)
+{
+	return _hypercall2(int, set_segment_base, reg, value);
+}
+#endif
+
+
 static inline int
 HYPERVISOR_suspend(unsigned long srec)
 {
-- 
1.5.4.1


linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch ---
>From 95802c98604935d9ba73489b237289fd7d332b9c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:02:24 -0200
Subject: [PATCH] Change signature of paravirt_alloc_{pt,pd} (REVIEWME)

Use 'unsigned long' instead of u32.

Question: will 'unsigned long' work on 32-bit PAE?

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c   |   17 +++++++++--------
 include/asm-x86/paravirt.h |   30 +++++++++++++++---------------
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index e3c678b..f403741 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -796,7 +796,7 @@ static void xen_new_user_baseptr(unsigned long pfn)
 
 /* Early in boot, while setting up the initial pagetable, assume
    everything is pinned. */
-static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn)
+static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
 {
 #ifdef CONFIG_FLATMEM
 	BUG_ON(mem_map);	/* should only be used early */
@@ -806,7 +806,7 @@ static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn)
 
 /* Early release_pte assumes that all pts are pinned, since there's
    only init_mm and anything attached to that is pinned. */
-static void xen_release_pte_init(u32 pfn)
+static void xen_release_pte_init(unsigned long pfn)
 {
 	make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
 }
@@ -822,7 +822,8 @@ static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
 
 /* This needs to make sure the new pte page is pinned iff its being
    attached to a pinned pagetable. */
-static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
+static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn,
+			     unsigned level)
 {
 	struct page *page = pfn_to_page(pfn);
 
@@ -840,18 +841,18 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
 	}
 }
 
-static void xen_alloc_pte(struct mm_struct *mm, u32 pfn)
+static void xen_alloc_pte(struct mm_struct *mm, unsigned long pfn)
 {
 	xen_alloc_ptpage(mm, pfn, PT_PTE);
 }
 
-static void xen_alloc_pmd(struct mm_struct *mm, u32 pfn)
+static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
 {
 	xen_alloc_ptpage(mm, pfn, PT_PMD);
 }
 
 /* This should never happen until we're OK to use struct page */
-static void xen_release_ptpage(u32 pfn, unsigned level)
+static void xen_release_ptpage(unsigned long pfn, unsigned level)
 {
 	struct page *page = pfn_to_page(pfn);
 
@@ -865,12 +866,12 @@ static void xen_release_ptpage(u32 pfn, unsigned level)
 	}
 }
 
-static void xen_release_pte(u32 pfn)
+static void xen_release_pte(unsigned long pfn)
 {
 	xen_release_ptpage(pfn, PT_PTE);
 }
 
-static void xen_release_pmd(u32 pfn)
+static void xen_release_pmd(unsigned long pfn)
 {
 	xen_release_ptpage(pfn, PT_PMD);
 }
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index f3384b5..240e28e 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -236,13 +236,13 @@ struct pv_mmu_ops {
 				 unsigned long va);
 
 	/* Hooks for allocating/releasing pagetable pages */
-	void (*alloc_pte)(struct mm_struct *mm, u32 pfn);
-	void (*alloc_pmd)(struct mm_struct *mm, u32 pfn);
-	void (*alloc_pmd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count);
-	void (*alloc_pud)(struct mm_struct *mm, u32 pfn);
-	void (*release_pte)(u32 pfn);
-	void (*release_pmd)(u32 pfn);
-	void (*release_pud)(u32 pfn);
+	void (*alloc_pte)(struct mm_struct *mm, unsigned long pfn);
+	void (*alloc_pmd)(struct mm_struct *mm, unsigned long pfn);
+	void (*alloc_pmd_clone)(unsigned long pfn, unsigned long clonepfn, unsigned long start, unsigned long count);
+	void (*alloc_pud)(struct mm_struct *mm, unsigned long pfn);
+	void (*release_pte)(unsigned long pfn);
+	void (*release_pmd)(unsigned long pfn);
+	void (*release_pud)(unsigned long pfn);
 
 	/* Pagetable manipulation functions */
 	void (*set_pte)(pte_t *ptep, pte_t pteval);
@@ -947,35 +947,35 @@ static inline void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
 	PVOP_VCALL3(pv_mmu_ops.flush_tlb_others, &cpumask, mm, va);
 }
 
-static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned pfn)
+static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn)
 {
 	PVOP_VCALL2(pv_mmu_ops.alloc_pte, mm, pfn);
 }
-static inline void paravirt_release_pte(unsigned pfn)
+static inline void paravirt_release_pte(unsigned long pfn)
 {
 	PVOP_VCALL1(pv_mmu_ops.release_pte, pfn);
 }
 
-static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned pfn)
+static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
 {
 	PVOP_VCALL2(pv_mmu_ops.alloc_pmd, mm, pfn);
 }
 
-static inline void paravirt_alloc_pmd_clone(unsigned pfn, unsigned clonepfn,
-					    unsigned start, unsigned count)
+static inline void paravirt_alloc_pmd_clone(unsigned long pfn, unsigned long clonepfn,
+					    unsigned long start, unsigned long count)
 {
 	PVOP_VCALL4(pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count);
 }
-static inline void paravirt_release_pmd(unsigned pfn)
+static inline void paravirt_release_pmd(unsigned long pfn)
 {
 	PVOP_VCALL1(pv_mmu_ops.release_pmd, pfn);
 }
 
-static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned pfn)
+static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn)
 {
 	PVOP_VCALL2(pv_mmu_ops.alloc_pud, mm, pfn);
 }
-static inline void paravirt_release_pud(unsigned pfn)
+static inline void paravirt_release_pud(unsigned long pfn)
 {
 	PVOP_VCALL1(pv_mmu_ops.release_pud, pfn);
 }
-- 
1.5.4.1


linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch:

--- NEW FILE linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch ---
>From 2054d7aed1adb07461c927d3a7a9d4942f593bd6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:03:11 -0200
Subject: [PATCH] Comment e820_print_map() call (TEMPORARY)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 140d143..f7ab336 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -51,7 +51,7 @@ char * __init xen_memory_setup(void)
 
 #ifdef CONFIG_X86_64
 	early_printk(KERN_INFO "Xen-provided physical RAM map:\n");
-	e820_print_map("Xen");
+	//e820_print_map("Xen");
 #endif
 	return "Xen";
 }
-- 
1.5.4.1


linux-2.6-xen-0114-Xen-missing-includes.patch:

--- NEW FILE linux-2.6-xen-0114-Xen-missing-includes.patch ---
>From 067536cb5467b5e629dcafa02e671a0ddde89e56 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:13:41 -0200
Subject: [PATCH] Xen: missing #includes

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/xen/events.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/xen/events.h b/include/xen/events.h
index acd8e06..e1349df 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -3,6 +3,8 @@
 
 #include <linux/interrupt.h>
 
+#include <asm/xen/interface.h>
+#include <xen/interface/xen.h>
 #include <xen/interface/event_channel.h>
 #include <asm/xen/hypercall.h>
 #include <asm/xen/events.h>
-- 
1.5.4.1


linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch:

--- NEW FILE linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch ---
>From c9e1ce9acdaacd4bf066aa7695e2d8cf93bb3e35 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:14:04 -0200
Subject: [PATCH] asm-x86/pgtable_64.h: #include <linux/spinlock.h>

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgtable_64.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index c6b8885..77fa715 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -11,6 +11,7 @@
 #include <asm/processor.h>
 #include <linux/bitops.h>
 #include <linux/threads.h>
+#include <linux/spinlock.h>
 #include <asm/pda.h>
 
 extern pud_t level3_kernel_pgt[512];
-- 
1.5.4.1


linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch:

--- NEW FILE linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch ---
>From bbf4347a211062f4ea62bc69027f00795153896c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:14:25 -0200
Subject: [PATCH] asm-x86/pgtable.h: #include <asm/page.h>

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgtable.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 636d087..3aba215 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_PGTABLE_H
 #define _ASM_X86_PGTABLE_H
 
+#include <asm/page.h>
+
 #define FIRST_USER_ADDRESS	0
 
 #define _PAGE_BIT_PRESENT	0	/* is present */
-- 
1.5.4.1


linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch:

--- NEW FILE linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch ---
>From 2fc13c75ad74e1bfcd20d911d191a616bf23dffb Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:15:55 -0200
Subject: [PATCH] fix pxxval_t usage on mm/init_64.c

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index f84c28b..891894b 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -96,7 +96,7 @@ early_param("gbpages", parse_direct_gbpages_on);
 void show_pgtable1(pte_t *tbl, unsigned long addr)
 {
 	pte_t *pte = tbl + pte_index(addr);
-	pte_val_t pv;
+	pteval_t pv;
 	unsigned long *page;
 
 	xprintk("\npte: %p\n", pte);
@@ -115,7 +115,7 @@ void show_pgtable1(pte_t *tbl, unsigned long addr)
 void show_pgtable2(pmd_t *tbl, unsigned long addr)
 {
 	pmd_t *pmd = tbl + pmd_index(addr);
-	pmd_val_t pv;
+	pmdval_t pv;
 
 	xprintk("\npmd: %p\n", pmd);
 	xprintk("\npmd val: %lx\n", pmd->pmd);
-- 
1.5.4.1


linux-2.6-xen-0118-Missing-Xen-include.patch:

--- NEW FILE linux-2.6-xen-0118-Missing-Xen-include.patch ---
>From 92b389e00309f8bf54bf14e9f9a33ca994f26422 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:18:18 -0200
Subject: [PATCH] Missing Xen #include

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 891894b..29c7808 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -53,6 +53,7 @@
 #include <xen/page.h>
 #include <xen/hvc-console.h>
 #include <asm/xen/hypercall.h>
+#include <asm/xen/hypervisor.h>
 #include "../xen/init.h"
 #include "../xen/xen-ops.h"
 #endif
-- 
1.5.4.1


linux-2.6-xen-0119-un-static-ipi_to_irq.patch:

--- NEW FILE linux-2.6-xen-0119-un-static-ipi_to_irq.patch ---
>From 6014bc89b5298010283453dcc6830b2bfc7e6b98 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 16:26:52 -0200
Subject: [PATCH] un-static ipi_to_irq

It is used by xen/genapic.c

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 1a8fa4b..41c93ee 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(irq_mapping_update_lock);
 static DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1};
 
 /* IRQ <-> IPI mapping */
-static DEFINE_PER_CPU(int, ipi_to_irq[XEN_NR_IPIS]) = {[0 ... XEN_NR_IPIS-1] = -1};
+DEFINE_PER_CPU(int, ipi_to_irq[XEN_NR_IPIS]) = {[0 ... XEN_NR_IPIS-1] = -1};
 
 /* Packed IRQ information: binding type, sub-type index, and event channel. */
 struct packed_irq
-- 
1.5.4.1


linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch:

--- NEW FILE linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch ---
>From fbd2c7e834d74f1ba9e99e1980eb6da99e6a4da7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 17:26:40 -0200
Subject: [PATCH] Don't use _PAGE_GLOBAL bit under Xen (FIXME)

This needs to be done using pvops.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgtable.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 3aba215..305fd0a 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -113,7 +113,12 @@ extern pteval_t __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
 #ifdef CONFIG_X86_32
 # define MAKE_GLOBAL(x)			__pgprot((x))
 #else
-# define MAKE_GLOBAL(x)			__pgprot((x) | _PAGE_GLOBAL)
+# ifdef CONFIG_XEN
+/*FIXME: this need to be handled at runtime using pvops */
+#  define MAKE_GLOBAL(x)			__pgprot((x))
+# else
+#  define MAKE_GLOBAL(x)			__pgprot((x) | _PAGE_GLOBAL)
+# endif
 #endif
 
 #define PAGE_KERNEL			MAKE_GLOBAL(__PAGE_KERNEL)
-- 
1.5.4.1


linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch:

--- NEW FILE linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch ---
>From f6b739a9d669475ce291b96d1af0711bcdeb2aa7 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 23 Jan 2008 18:51:58 -0200
Subject: [PATCH] Trying to organize the xen bootmem allocation mess (REVIEWME)

See comments added to code to understand this.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c    |   47 +++++++++++++++++++++++++++++++++------------
 arch/x86/xen/enlighten.c |   15 +++++++++++++-
 arch/x86/xen/init.h      |    2 +-
 3 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 29c7808..846dc4e 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -290,9 +290,9 @@ static __init void *spp_getpage(void)
 
 	if (after_bootmem)
 		ptr = (void *) get_zeroed_page(GFP_ATOMIC);
-	else if (start_pfn < table_end) {
-		ptr = __va(start_pfn << PAGE_SHIFT);
-		start_pfn++;
+	else if (xen_alloc_pfn < table_end) {
+		ptr = __va(xen_alloc_pfn << PAGE_SHIFT);
+		xen_alloc_pfn++;
 		memset(ptr, 0, PAGE_SIZE);
 	} else
 		ptr = alloc_bootmem_pages(PAGE_SIZE);
@@ -424,7 +424,7 @@ native_set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
 
 /*FIXME: this code should be enabled at runtime, somehow */
 
-unsigned long start_pfn;
+unsigned long xen_alloc_pfn;
 
 static __meminit void *alloc_low_page(unsigned long *phys)
 {
@@ -437,7 +437,7 @@ static __meminit void *alloc_low_page(unsigned long *phys)
 		return adr;
 	}
 
-	pfn = start_pfn++;
+	pfn = xen_alloc_pfn++;
 	*phys  = pfn << PAGE_SHIFT;
 
 	/* The address returned by __va() is not available yet.
@@ -470,7 +470,7 @@ int make_readonly(unsigned long paddr)
 	/* Make old page tables read-only. */
 	if (!xen_feature(XENFEAT_writable_page_tables)
 	    && (paddr >= (xen_start_info->pt_base - __START_KERNEL_map))
-	    && (paddr < (start_pfn << PAGE_SHIFT)))
+	    && (paddr < (xen_alloc_pfn << PAGE_SHIFT)))
 		readonly = 1;
 
 	/*
@@ -530,7 +530,7 @@ static void xen_finish_init_mapping(void)
 		WARN_ON(HYPERVISOR_update_va_mapping(
 			start, __pte_ma(0), 0));
 
-	/* Allocate pte's for initial fixmaps from 'start_pfn' allocator. */
+	/* Allocate pte's for initial fixmaps from 'xen_alloc_pfn' allocator. */
 	table_end = ~0UL;
 
 
@@ -565,8 +565,8 @@ static void xen_finish_init_mapping(void)
 					        >> PAGE_SHIFT,
 					    PAGE_KERNEL_RO));
 
-	/* Disable the 'start_pfn' allocator. */
-	table_end = start_pfn;
+	/* Disable the 'xen_alloc_pfn' allocator. */
+	table_end = xen_alloc_pfn;
 
 	xprintk("finished!\n");
 }
@@ -592,7 +592,7 @@ static void __init xen_extend_init_mapping(unsigned long tables_space)
 
 	/* Ensure init mappings cover kernel text/data and initial tables. */
 	while (va < (__START_KERNEL_map
-		     + (start_pfn << PAGE_SHIFT)
+		     + (xen_alloc_pfn << PAGE_SHIFT)
 		     + tables_space)) {
 		pmd = (pmd_t *)&page[pmd_index(va)];
 		if (pmd_none(*pmd)) {
@@ -767,6 +767,7 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end)
 				 */
 				if (make_readonly(address))
 					attrs &= ~_PAGE_RW;
+
 				__set_pte(pte, __pte(address | attrs));
 			}
 			pte = pte_save;
@@ -862,10 +863,10 @@ static void __init find_early_table_space(unsigned long end)
 	/*FIXME: what does this do? */
 	xen_extend_init_mapping(tables);
 
-	table_start = start_pfn;
+	table_start = xen_alloc_pfn;
 	table_end = table_start + (tables>>PAGE_SHIFT);
 
-	early_printk("kernel direct mapping tables up to %lx @ %lx-%lx\n",
+	printk("kernel direct mapping tables up to %lx @ %lx-%lx\n",
 		end, table_start << PAGE_SHIFT,
 		(table_start << PAGE_SHIFT) + tables);
 }
@@ -1069,13 +1070,32 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 
 	if (!after_bootmem) {
 #ifdef CONFIG_XEN
-		BUG_ON(start_pfn != table_end);
+		BUG_ON(xen_alloc_pfn != table_end);
 		xen_finish_init_mapping();
 #endif
 		mmu_cr4_features = read_cr4();
 	}
 	__flush_tlb_all();
 
+	/*FIXME: Xen early allocation is messy-messy-messy:
+	 *
+	 * - memory from spp_getpage() needs to be reserved
+	 * - memory from alloc_low_page() needs to be reserved
+	 * - memory from spp_getpage() is being reserved on
+	 *   xen_pagetable_setup_start(), using xen_alloc_pfn and
+	 *   xen_start_pfn
+	 * - memory from alloc_low_page() should be reserved here,
+	 *   like on non-Xen. But it is already being reserved
+	 *   with the spp_getpage() memory. This is why there is
+	 *   a #ifndef below
+	 *
+	 * - Probably keeping spp_getpage() as-is would work,
+	 *   but first I need to understand how the non-Xen version
+	 *   of it works and why XS upstream has different code
+	 *   - If that works, we may remove lots of xen-specific
+	 *     bootmem reservation
+	 */
+#ifndef CONFIG_XEN
 	if (!after_bootmem)
 		reserve_early(table_start << PAGE_SHIFT,
 				 table_end << PAGE_SHIFT, "PGTABLE");
@@ -1084,6 +1104,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 		early_memtest(start_phys, end_phys);
 
 	return last_map_addr;
+#endif
 }
 
 #ifndef CONFIG_NUMA
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index f403741..7d0ff1c 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -912,6 +912,11 @@ static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
 	xen_set_pte(ptep, pte);
 }
 
+
+#ifdef CONFIG_X86_64
+static unsigned long xen_start_pfn;
+#endif
+
 static __init void xen_pagetable_setup_start(pgd_t *base)
 {
 #ifdef CONFIG_X86_32
@@ -1025,6 +1030,12 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
 		pin_pagetable_pfn(level, PFN_DOWN(__pa(base)));
 	}
 #endif
+
+#ifdef CONFIG_X86_64
+	reserve_bootmem(xen_start_pfn << PAGE_SHIFT,
+			(xen_alloc_pfn - xen_start_pfn) << PAGE_SHIFT,
+			BOOTMEM_DEFAULT);
+#endif
 }
 
 /* This is called once we have the cpu_possible_map */
@@ -1374,6 +1385,8 @@ static void __init xen_reserve_top(void)
 #define xen_reserve_top() do { } while (0)
 #endif
 
+
+
 /* First C function to be called on Xen boot */
 asmlinkage void __init xen_start_kernel(void)
 {
@@ -1432,7 +1445,7 @@ asmlinkage void __init xen_start_kernel(void)
 
 #ifdef CONFIG_X86_64
 	/* used by alloc_low_page() */
-	start_pfn = PFN_UP(__pa_symbol(xen_start_info->pt_base)) + xen_start_info->nr_pt_frames;
+	xen_start_pfn = xen_alloc_pfn = PFN_UP(__pa_symbol(xen_start_info->pt_base)) + xen_start_info->nr_pt_frames;
 #endif
 
 #ifdef CONFIG_X86_32
diff --git a/arch/x86/xen/init.h b/arch/x86/xen/init.h
index fee0c05..6d91d3e 100644
--- a/arch/x86/xen/init.h
+++ b/arch/x86/xen/init.h
@@ -6,7 +6,7 @@ void xen_init_pt(void);
 extern pud_t level3_user_pgt[512];
 extern pgd_t init_level4_user_pgt[];
 
-extern unsigned long start_pfn;
+extern unsigned long xen_alloc_pfn;
 
 void early_make_page_readonly(void *va, unsigned int feature);
 
-- 
1.5.4.1


linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch:

--- NEW FILE linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch ---
>From 6487036ee224fae180dfbb8f6aa6900b2df6f78d Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Jan 2008 11:16:57 -0200
Subject: [PATCH] Xen: reserve_bootmem() xenstore and console interface pages

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/setup_64.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 6831511..6522392 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -481,6 +481,14 @@ void __init setup_arch(char **cmdline_p)
 	reserve_bootmem(__pa(xen_start_info),
 			sizeof(*xen_start_info),
 			BOOTMEM_DEFAULT);
+
+	if (!is_initial_xendomain()) {
+		/* Reserve the xenstore and console interface pages */
+		reserve_bootmem(mfn_to_pfn(xen_start_info->store_mfn) << PAGE_SHIFT,
+				PAGE_SIZE, BOOTMEM_DEFAULT);
+		reserve_bootmem(mfn_to_pfn(xen_start_info->console.domU.mfn) << PAGE_SHIFT,
+				PAGE_SIZE, BOOTMEM_DEFAULT);
+	}
 #endif
 
        /*
-- 
1.5.4.1


linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch:

--- NEW FILE linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch ---
>From ae1a852d19047fc79a769227c7638e15740401ba Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Jan 2008 12:01:11 -0200
Subject: [PATCH] pvops-64: call paravirt_activate_mm() on activate_mm()

This hook was forgotten on 64-bit paravirt_ops.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/mmu_context_64.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86/mmu_context_64.h b/include/asm-x86/mmu_context_64.h
index ca44c71..14003ce 100644
--- a/include/asm-x86/mmu_context_64.h
+++ b/include/asm-x86/mmu_context_64.h
@@ -65,8 +65,11 @@ do {						\
 	asm volatile("movl %0,%%fs"::"r"(0));	\
 } while (0)
 
-#define activate_mm(prev, next)			\
-	switch_mm((prev), (next), NULL)
+#define activate_mm(prev, next)				\
+	do {						\
+		paravirt_activate_mm((prev), (next));	\
+		switch_mm((prev), (next), NULL);	\
+	} while (0)
 
 
 #endif
-- 
1.5.4.1


linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch:

--- NEW FILE linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch ---
>From 72fa2b5e964216b1a65d57e7e2c716a0e4c5f078 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Jan 2008 12:04:10 -0200
Subject: [PATCH] Xen: 64-bit support on xen_pgd_pin()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index b8a32c6..8271fd4 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -501,7 +501,9 @@ void xen_pgd_pin(pgd_t *pgd)
 		xen_mc_batch();
 	}
 
-#ifdef CONFIG_X86_PAE
+#ifdef CONFIG_X86_64
+	level = MMUEXT_PIN_L4_TABLE;
+#elif defined(CONFIG_X86_PAE)
 	level = MMUEXT_PIN_L3_TABLE;
 #else
 	level = MMUEXT_PIN_L2_TABLE;
-- 
1.5.4.1


linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch:

--- NEW FILE linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch ---
>From 4ae1d2979bc1a21579cb84e51b87f7f423c0a81f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Jan 2008 12:05:30 -0200
Subject: [PATCH] Xen-64: pin user PGD on activate_mm() and dup_mmap()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 8271fd4..4c80287 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -585,6 +585,9 @@ void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next)
 {
 	spin_lock(&next->page_table_lock);
 	xen_pgd_pin(next->pgd);
+#ifdef CONFIG_X86_64
+	xen_pgd_pin(__user_pgd(next->pgd));
+#endif
 	spin_unlock(&next->page_table_lock);
 }
 
@@ -592,6 +595,9 @@ void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
 {
 	spin_lock(&mm->page_table_lock);
 	xen_pgd_pin(mm->pgd);
+#ifdef CONFIG_X86_64
+	xen_pgd_pin(__user_pgd(mm->pgd));
+#endif
 	spin_unlock(&mm->page_table_lock);
 }
 
-- 
1.5.4.1


linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch:

--- NEW FILE linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch ---
>From 7e81926e600633f0e46e536953f4e6bbe68e4a60 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Sun, 15 Jun 2008 18:48:47 -0300
Subject: [PATCH] Hack pgd_walk() to walk to TASK_SIZE+PAGE_SIZE on x86_64 (REVIEWME)

Need to check why this is needed.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 4c80287..27ccac8 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -363,6 +363,11 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
 	unsigned long addr = start;
 	unsigned long pgd_next;
 
+#ifdef CONFIG_X86_64
+	/*FIXME: investigate why walking to TASK_SIZE isn't enough on x86_64 */
+	limit += PAGE_SIZE;
+#endif
+
 	if (xen_feature(XENFEAT_auto_translated_physmap))
 		return 0;
 
-- 
1.5.4.1


linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch:

--- NEW FILE linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch ---
>From 48385d067ffb4503aa7f006a88698e9789e8a5fc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 8 Feb 2008 13:41:33 -0200
Subject: [PATCH] Xen-64: Unpin user pagetable on xen_pgd_unpin()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 27ccac8..c6dedef 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -579,8 +579,14 @@ void xen_pgd_unpin(pgd_t *pgd)
 {
 	xen_mc_batch();
 
+#ifdef CONFIG_X86_64
+	xen_do_pin(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(__user_pgd(pgd))));
+#endif
 	xen_do_pin(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
 
+#ifdef CONFIG_X86_64
+	pgd_walk(__user_pgd(pgd), unpin_page, 0, TASK_SIZE);
+#endif
 	pgd_walk(pgd, unpin_page, 0, TASK_SIZE);
 
 	xen_mc_issue(0);
-- 
1.5.4.1


linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch:

--- NEW FILE linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch ---
>From 6c989bd490a10445c112f1a65be60a23ca2ee44e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 13 Feb 2008 13:24:31 -0200
Subject: [PATCH] Use (un)pin_page() when (un)pinning pgd

This will check the PG_pinned flag, so we avoid unpinning or pinning
pages twice.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index c6dedef..f9d9c39 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -514,7 +514,7 @@ void xen_pgd_pin(pgd_t *pgd)
 	level = MMUEXT_PIN_L2_TABLE;
 #endif
 
-	xen_do_pin(level, PFN_DOWN(__pa(pgd)));
+	pin_page(virt_to_page(pgd), PT_PGD);
 
 	xen_mc_issue(0);
 }
@@ -580,9 +580,9 @@ void xen_pgd_unpin(pgd_t *pgd)
 	xen_mc_batch();
 
 #ifdef CONFIG_X86_64
-	xen_do_pin(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(__user_pgd(pgd))));
+	unpin_page(virt_to_page(__user_pgd(pgd)), PT_PGD);
 #endif
-	xen_do_pin(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
+	unpin_page(virt_to_page(pgd), PT_PGD);
 
 #ifdef CONFIG_X86_64
 	pgd_walk(__user_pgd(pgd), unpin_page, 0, TASK_SIZE);
-- 
1.5.4.1


linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch:

--- NEW FILE linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch ---
>From 259b3d1e40269ba6a11fe9d97340d880db298415 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 29 Feb 2008 13:07:13 -0300
Subject: [PATCH] Allow enabling Xen on x86_64

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/Kconfig |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index 12622e5..c6a6b83 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -5,7 +5,6 @@
 config XEN
 	bool "Xen guest support"
 	select PARAVIRT
-	depends on X86_32
 	depends on X86_CMPXCHG && X86_TSC && !(X86_VISWS || X86_VOYAGER)
 	help
 	  This is the Linux Xen port.  Enabling this will allow the
-- 
1.5.4.1


linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch:

--- NEW FILE linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch ---
>From ed78d886ef4bffdffe5b9ea802a23f601b3c0315 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 29 Feb 2008 13:21:11 -0300
Subject: [PATCH] Add #include <linux/spinlock_types.h> to asm-x86/pgtable.h

Needed for spinlock_t type.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/pgtable.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 305fd0a..000d1a4 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -155,6 +155,8 @@ extern pteval_t __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
 
 #ifndef __ASSEMBLY__
 
+#include <linux/spinlock_types.h>
+
 /*
  * ZERO_PAGE is a global shared page that is always zero: used
  * for zero-mapped memory areas etc..
-- 
1.5.4.1


linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch:

--- NEW FILE linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch ---
>From 6233b9e109df251fadea253e34525b0e607f8b13 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 29 Feb 2008 17:29:45 -0300
Subject: [PATCH] Restore some sanity on the initial pagetable bootmem reservation

One less #ifdef!  :)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c    |    8 +++-----
 arch/x86/xen/enlighten.c |    6 ------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 846dc4e..e69075a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -860,11 +860,11 @@ static void __init find_early_table_space(unsigned long end)
 		round_up(pmds * 8, PAGE_SIZE) + 
 		round_up(ptes * 8, PAGE_SIZE); 
 
-	/*FIXME: what does this do? */
+	table_start = xen_alloc_pfn;
+
 	xen_extend_init_mapping(tables);
 
-	table_start = xen_alloc_pfn;
-	table_end = table_start + (tables>>PAGE_SHIFT);
+	table_end = xen_alloc_pfn + (tables>>PAGE_SHIFT);
 
 	printk("kernel direct mapping tables up to %lx @ %lx-%lx\n",
 		end, table_start << PAGE_SHIFT,
@@ -1095,7 +1095,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 	 *   - If that works, we may remove lots of xen-specific
 	 *     bootmem reservation
 	 */
-#ifndef CONFIG_XEN
 	if (!after_bootmem)
 		reserve_early(table_start << PAGE_SHIFT,
 				 table_end << PAGE_SHIFT, "PGTABLE");
@@ -1104,7 +1103,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 		early_memtest(start_phys, end_phys);
 
 	return last_map_addr;
-#endif
 }
 
 #ifndef CONFIG_NUMA
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 7d0ff1c..5bc7536 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1030,12 +1030,6 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
 		pin_pagetable_pfn(level, PFN_DOWN(__pa(base)));
 	}
 #endif
-
-#ifdef CONFIG_X86_64
-	reserve_bootmem(xen_start_pfn << PAGE_SHIFT,
-			(xen_alloc_pfn - xen_start_pfn) << PAGE_SHIFT,
-			BOOTMEM_DEFAULT);
-#endif
 }
 
 /* This is called once we have the cpu_possible_map */
-- 
1.5.4.1


linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch:

--- NEW FILE linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch ---
>From 16e91805ec67822d7b756cc425fbe1ff09718fee Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Jan 2008 13:05:29 -0200
Subject: [PATCH] Xen: Use system_call_after_swapgs() as the syscall callback

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c    |    2 +-
 include/asm-x86/proto.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index f7ab336..1a3c468 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -119,7 +119,7 @@ void __init xen_arch_setup(void)
 #else
 	HYPERVISOR_set_callbacks((unsigned long)xen_hypervisor_callback,
 				 (unsigned long)xen_failsafe_callback,
-				 (unsigned long)system_call);
+				 (unsigned long)system_call_after_swapgs);
 #endif
 
 	xen_enable_sysenter();
diff --git a/include/asm-x86/proto.h b/include/asm-x86/proto.h
index 6c8b41b..2ecdf90 100644
--- a/include/asm-x86/proto.h
+++ b/include/asm-x86/proto.h
@@ -8,6 +8,7 @@
 extern void early_idt_handler(void);
 
 extern void system_call(void);
+extern void system_call_after_swapgs(void);
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
-- 
1.5.4.1


linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch:

--- NEW FILE linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch ---
>From 21d485f5e0eeb004cb8e835f68cb79b5b814e514 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 4 Feb 2008 17:26:46 -0200
Subject: [PATCH] Add a system_call_after_saveargs label to entry_64.S

It will be used by Xen syscall entry point.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 1182250..7961d22 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -252,8 +252,11 @@ ENTRY(system_call_after_swapgs)
 	 */
 	ENABLE_INTERRUPTS(CLBR_NONE)
 	SAVE_ARGS 8,1
-	movq  %rax,ORIG_RAX-ARGOFFSET(%rsp) 
 	movq  %rcx,RIP-ARGOFFSET(%rsp)
+
+system_call_after_saveargs:
+
+	movq  %rax,ORIG_RAX-ARGOFFSET(%rsp) 
 	CFI_REL_OFFSET rip,RIP-ARGOFFSET
 	GET_THREAD_INFO(%rcx)
 	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
-- 
1.5.4.1


linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch:

--- NEW FILE linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch ---
>From e971dd1461a8496510acc3b365181dd51135bf6e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 4 Feb 2008 17:36:08 -0200
Subject: [PATCH] Create xen-specific syscall entry

The stack and register saving for syscall entry is very different under
xen. xen_system_call_entry just handle the register saving and jumps
to system_call_after_saveargs, inside system_call.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/entry_64.S |   15 +++++++++++++++
 arch/x86/xen/setup.c    |    2 +-
 arch/x86/xen/xen-ops.h  |    1 +
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
index 2a2a0a0..5c8910b 100644
--- a/arch/x86/xen/entry_64.S
+++ b/arch/x86/xen/entry_64.S
@@ -51,3 +51,18 @@ ENTRY(xen_retint_swapgs)		/* return to user-space */
 	TRACE_IRQS_IRETQ
 	jmp restore_args
 END(xen_retint_swapgs)
+
+
+ENTRY(xen_system_call_entry)
+	CFI_STARTPROC	simple
+
+	//FIXME: CFI directives here
+
+	// We need additional space for orig_ax.
+	// That would be SAVE_ARGS 8, but we already have
+	// r11 and rcx saved on the stack
+	SAVE_ARGS -8
+
+	jmp system_call_after_saveargs
+	CFI_ENDPROC
+END(xen_system_call_entry)
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 1a3c468..6fd8d9b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -119,7 +119,7 @@ void __init xen_arch_setup(void)
 #else
 	HYPERVISOR_set_callbacks((unsigned long)xen_hypervisor_callback,
 				 (unsigned long)xen_failsafe_callback,
-				 (unsigned long)system_call_after_swapgs);
+				 (unsigned long)xen_system_call_entry);
 #endif
 
 	xen_enable_sysenter();
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 4c0840f..9d8cecf 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -76,4 +76,5 @@ void xen_iret(void);
 void xen_sysexit(void);
 void xen_irqenable_syscall_ret(void);
 
+void xen_system_call_entry(void);
 #endif /* XEN_OPS_H */
-- 
1.5.4.1


linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch:

--- NEW FILE linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch ---
>From b0d6532aa3181255bfa0423399242700b9767880 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 4 Feb 2008 17:38:24 -0200
Subject: [PATCH] syscall-related Xen #ifdefs (FIXME)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/entry_64.S |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 7961d22..215b16d 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -96,20 +96,29 @@ ENTRY(native_irq_enable_syscall_ret)
 		
 	/* %rsp:at FRAMEEND */ 
 	.macro FIXUP_TOP_OF_STACK tmp
+#ifndef CONFIG_XEN
+	/*FIXME: check this at runtime */
 	movq	%gs:pda_oldrsp,\tmp
 	movq  	\tmp,RSP(%rsp)
+#endif
 	movq    $__USER_DS,SS(%rsp)
 	movq    $__USER_CS,CS(%rsp)
 	movq 	$-1,RCX(%rsp)
+#ifndef CONFIG_XEN
+	/*FIXME: check this at runtime */
 	movq	R11(%rsp),\tmp  /* get eflags */
 	movq	\tmp,EFLAGS(%rsp)
+#endif
 	.endm
 
 	.macro RESTORE_TOP_OF_STACK tmp,offset=0
+#ifndef CONFIG_XEN
+	/*FIXME: check this at runtime */
 	movq   RSP-\offset(%rsp),\tmp
 	movq   \tmp,%gs:pda_oldrsp
 	movq   EFLAGS-\offset(%rsp),\tmp
 	movq   \tmp,R11-\offset(%rsp)
+#endif
 	.endm
 
 	.macro FAKE_STACK_FRAME child_rip
@@ -288,7 +297,12 @@ sysret_check:
 	TRACE_IRQS_ON
 	movq RIP-ARGOFFSET(%rsp),%rcx
 	CFI_REGISTER	rip,rcx
+#ifndef CONFIG_XEN
+	/*FIXME: change this at runtime */
 	RESTORE_ARGS 0,-ARG_SKIP,1
+#else
+	RESTORE_ARGS 0,8,0
+#endif
 	/*CFI_REGISTER	rflags,r11*/
 	ENABLE_INTERRUPTS_SYSCALL_RET
 
-- 
1.5.4.1


linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch:

--- NEW FILE linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch ---
>From 5e37550e75f0d55cf68c2b5af979bdba8ae3d3ec Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 8 Feb 2008 12:36:28 -0200
Subject: [PATCH] Point set_pte() to xen_set_pte() since the beginning

On x86_64, set_pte() may end up being called before
paravirt_pagetable_setup_start().

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5bc7536..27b0895 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1270,7 +1270,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
 	.kmap_atomic_pte = xen_kmap_atomic_pte,
 #endif
 
-	.set_pte = NULL,	/* see xen_pagetable_setup_* */
+	.set_pte = xen_set_pte,
 	.set_pte_at = xen_set_pte_at,
 	.set_pmd = xen_set_pmd,
 
-- 
1.5.4.1


linux-2.6-xen-0137-DEBUG-slab-debugging.patch:

--- NEW FILE linux-2.6-xen-0137-DEBUG-slab-debugging.patch ---
>From faa73037702d5efd087f0969e0c4ae0118a2ed26 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 8 Feb 2008 16:37:16 -0200
Subject: [PATCH] DEBUG: slab debugging

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 mm/slab.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 1c12c35..fd88c4c 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3199,6 +3199,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 		STATS_INC_ALLOCHIT(cachep);
 		ac->touched = 1;
 		objp = ac->entry[--ac->avail];
+		if (!objp)
+			printk("really weird: avail objp for cache %s is null\n", cachep->name);
 	} else {
 		STATS_INC_ALLOCMISS(cachep);
 		objp = cache_alloc_refill(cachep, flags);
@@ -3462,8 +3464,10 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
 	unsigned long save_flags;
 	void *objp;
 
-	if (should_failslab(cachep, flags))
+	if (should_failslab(cachep, flags)) {
+		printk("cache %s should fail\n", cachep->name);
 		return NULL;
+	}
 
 	cache_alloc_debugcheck_before(cachep, flags);
 	local_irq_save(save_flags);
@@ -3475,6 +3479,8 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
 	if (unlikely((flags & __GFP_ZERO) && objp))
 		memset(objp, 0, obj_size(cachep));
 
+	if (!objp)
+		printk("allocation from cache %s failed!!!\n", cachep->name);
 	return objp;
 }
 
-- 
1.5.4.1


linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch:

--- NEW FILE linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch ---
>From 1604d634adcf556f80b60f888780194638186a4a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 20 Feb 2008 19:03:55 -0300
Subject: [PATCH] pvops-64: Include %rsi on the register clobber list for IRQ functions (REVIEWME)

The IRQ functions may be C functions, and they may clobber RSI.

Probably the best option will be saving it to avoid clobbering it after
the IRQ functions' call places are patched. Clobbering too much registers
when most IRQ functions will use none on few of them isn't a good idea.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/paravirt.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 240e28e..b5257c9 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1318,8 +1318,8 @@ extern struct paravirt_patch_site __parainstructions[],
  * caller saved registers but the argument parameter */
 #define PV_SAVE_REGS "pushq %%rdi;"
 #define PV_RESTORE_REGS "popq %%rdi;"
-#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rcx" , "rdx"
-#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rcx" , "rdx"
+#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rsi", "rcx" , "rdx"
+#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rsi", "rcx" , "rdx"
 #define PV_FLAGS_ARG "D"
 #endif
 
-- 
1.5.4.1


linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch:

--- NEW FILE linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch ---
>From 392a9bb0674e4dc90ad8d0c5be357c6493ce9e12 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 20 Feb 2008 19:04:43 -0300
Subject: [PATCH] Xen-64: quick, ugly hack to fix pgd_clear() pagetable unpinning (FIXME)

Should be fixed properly later.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/paravirt.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index b5257c9..ff3a08b 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1173,6 +1173,10 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
 static inline void pgd_clear(pgd_t *pgdp)
 {
 	set_pgd(pgdp, __pgd(0));
+#ifdef CONFIG_X86_64
+	/*FIXME: ugly ugly ugly ugly ugly ugly hack */
+	set_pgd((pgd_t*)(((unsigned long)pgdp)+PAGE_SIZE), __pgd(0));
+#endif
 }
 
 static inline void pud_clear(pud_t *pudp)
-- 
1.5.4.1


linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch:

--- NEW FILE linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch ---
>From 0042e45c3fa8250b77835e1f333739763787238e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 4 Mar 2008 16:59:21 -0300
Subject: [PATCH] Add missing acpi #include to xen/setup.c

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 6fd8d9b..48fa33a 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -22,6 +22,7 @@
 #include <xen/features.h>
 
 #include <asm/proto.h>
+#include <asm/acpi.h>
 
 #include "xen-ops.h"
 #include "vdso.h"
-- 
1.5.4.1


linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch:

--- NEW FILE linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch ---
>From d6de9f09c9384bd25b2c00ed5c7561cfffdc98aa Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 3 Mar 2008 14:46:56 -0300
Subject: [PATCH] Don't use FIX_VDSO on 64-bit

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 27b0895..a5b46d6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1119,7 +1119,9 @@ static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
 	case FIX_F00F_IDT:
 #endif
 	case FIX_WP_TEST:
+#ifndef CONFIG_X86_64
 	case FIX_VDSO:
+#endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	case FIX_APIC_BASE:	/* maps dummy local APIC */
 #endif
-- 
1.5.4.1


linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch:

--- NEW FILE linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch ---
>From 7d6eff6060f7008590e5e21760bef53e98c694fc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 3 Apr 2008 19:09:09 -0300
Subject: [PATCH] Mark init pages read-write again on free_init_pages()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index e69075a..f41242d 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1243,6 +1243,13 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
 		begin, PAGE_ALIGN(end));
 	set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
 #else
+	/*
+	 * We just marked the kernel text read only above, now that
+	 * we are going to free part of that, we need to make that
+	 * writeable first.
+	 */
+	set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
+
 	printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
 
 	for (; addr < end; addr += PAGE_SIZE) {
-- 
1.5.4.1


linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch:

--- NEW FILE linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch ---
>From 411be9b6ebdbd1749439f676fc946de381310063 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 3 Apr 2008 19:10:10 -0300
Subject: [PATCH] reserve_early() kernel text and data segments

Just like on start_kernel()

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a5b46d6..532e7fb 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -48,6 +48,7 @@
 #include <asm/tlbflush.h>
 #include <asm/reboot.h>
 #include <asm/proto.h>
+#include <asm/sections.h>
 
 #include "xen-ops.h"
 #include "mmu.h"
@@ -1457,6 +1458,8 @@ asmlinkage void __init xen_start_kernel(void)
 	   possible map and a non-dummy shared_info. */
 	per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
 
+	reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
+
 	xprintk("xen_init_pt:\n");
 	xen_init_pt();
 	xprintk("xen_init_pt returned.\n");
-- 
1.5.4.1


linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch:

--- NEW FILE linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch ---
>From 35aa0514a27fd390293cf6664966459bae1617a6 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 15 Apr 2008 17:59:31 -0300
Subject: [PATCH] Xen: Clear __START_KERNEL_map PTEs on free_init_pages() (REVIEWME)

We need to kill the __START_KERNEL_map aliases of the freed init pages
otherwise we won't be able to pin those pages as pagetables later, because
there will be a read-write alias even after make_lowpage_readonly().

Probably using set_memory_ro() instead of make_lowpage_readonly()
when pinning pages will be better.

This should fix the pagetable pinning problems reported at
https://bugzilla.redhat.com/show_bug.cgi?id=441543

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index f41242d..32cadb1 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1259,6 +1259,16 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
 			POISON_FREE_INITMEM, PAGE_SIZE);
 		free_page(addr);
 		totalram_pages++;
+		if (begin >= __START_KERNEL_map) {
+			pte_t *kpte;
+			unsigned int l;
+			/* __START_KERNEL_map addresses must be unmapped
+			 * because we map physical memory at __PAGE_OFFSET
+			 * and we don't want to keep aliases.
+			 */
+			kpte = lookup_address(addr, &l);
+			set_pte(kpte, __pte(0));
+		}
 	}
 #endif
 }
-- 
1.5.4.1


linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch:

--- NEW FILE linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch ---
>From 954a878d8c4eb861a91deaa86ce6dad6717abe87 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Apr 2008 11:59:45 -0300
Subject: [PATCH] Set pvops machine_ops for Xen on x86_64 also  (MERGEME)

I don't know why this code was commented out, in the first place. Maybe
machine_ops wasn't supported on x86_64 when I started working on this
code.

This should be merged with the commit that commented out the code
(that means both commits wil probably go away :)

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 532e7fb..e42be87 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1418,10 +1418,7 @@ asmlinkage void __init xen_start_kernel(void)
 	pv_apic_ops = xen_apic_ops;
 	pv_mmu_ops = xen_mmu_ops;
 
-#ifdef CONFIG_X86_32
-	/*FIXME: implement me! */
 	machine_ops = xen_machine_ops;
-#endif
 
 #ifdef CONFIG_SMP
 	smp_ops = xen_smp_ops;
-- 
1.5.4.1


linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch:

--- NEW FILE linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch ---
>From 7724e57bf0ca07950db14d7eadd5e68456078d87 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 9 May 2008 11:47:16 -0300
Subject: [PATCH] Pull xen_failsafe_callback implementation from XenSource tree

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/entry_64.S |   54 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
index 5c8910b..1ae3b10 100644
--- a/arch/x86/xen/entry_64.S
+++ b/arch/x86/xen/entry_64.S
@@ -2,11 +2,57 @@ ENTRY(xen_hypervisor_callback)
 	zeroentry do_hypervisor_callback
 ENDPROC(xen_hypervisor_callback)
 
+# Hypervisor uses this for application faults while it executes.
+# We get here for two reasons:
+#  1. Fault while reloading DS, ES, FS or GS
+#  2. Fault while executing IRET
+# Category 1 we do not need to fix up as Xen has already reloaded all segment
+# registers that could be reloaded and zeroed the others.
+# Category 2 we fix up by killing the current process. We cannot use the
+# normal Linux return path in this case because if we use the IRET hypercall
+# to pop the stack frame we end up in an infinite loop of failsafe callbacks.
+# We distinguish between categories by comparing each saved segment register
+# with its current contents: any discrepancy means we in category 1.
 ENTRY(xen_failsafe_callback)
-	/*FIXME: implement me! */
-	ud2a
-ENDPROC(xen_failsafe_callback)
-
+	_frame (RIP-0x30)
+	CFI_REL_OFFSET rcx, 0
+	CFI_REL_OFFSET r11, 8
+	movw %ds,%cx
+	cmpw %cx,0x10(%rsp)
+	CFI_REMEMBER_STATE
+	jne 1f
+	movw %es,%cx
+	cmpw %cx,0x18(%rsp)
+	jne 1f
+	movw %fs,%cx
+	cmpw %cx,0x20(%rsp)
+	jne 1f
+	movw %gs,%cx
+	cmpw %cx,0x28(%rsp)
+	jne 1f
+	/* All segments match their saved values => Category 2 (Bad IRET). */
+	movq (%rsp),%rcx
+	CFI_RESTORE rcx
+	movq 8(%rsp),%r11
+	CFI_RESTORE r11
+	addq $0x30,%rsp
+	CFI_ADJUST_CFA_OFFSET -0x30
+	movq $11,%rdi	/* SIGSEGV */
+	jmp do_exit			
+	CFI_RESTORE_STATE
+1:	/* Segment mismatch => Category 1 (Bad segment). Retry the IRET. */
+	movq (%rsp),%rcx
+	CFI_RESTORE rcx
+	movq 8(%rsp),%r11
+	CFI_RESTORE r11
+	addq $0x30,%rsp
+	CFI_ADJUST_CFA_OFFSET -0x30
+	pushq $0
+	CFI_ADJUST_CFA_OFFSET 8
+	SAVE_ALL
+	jmp error_exit
+	CFI_ENDPROC
+END(xen_failsafe_callback)
 
 /*
  * Copied from arch/xen/i386/kernel/entry.S
-- 
1.5.4.1


linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch:

--- NEW FILE linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch ---
>From 180daaa1358f86ccc7e91ed5d4484ba36de3c4b4 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 7 Apr 2008 15:40:43 -0300
Subject: [PATCH] Save %fs and %gs before load_TLS() and arch_leave_lazy_cpu_mode()

We must do this because load_TLS() may need to clear %fs and %gs,
such (e.g. under Xen).

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/process_64.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 2f0d6fa..408fc9e 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -566,6 +566,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 				 *next = &next_p->thread;
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
+	unsigned fsindex, gsindex;
 
 	/* we're going to use this soon, after a few expensive things */
 	if (next_p->fpu_counter>5)
@@ -588,6 +589,15 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	if (unlikely(next->ds | prev->ds))
 		loadsegment(ds, next->ds);
 
+
+	/* We must save %fs and %gs before load_TLS() because
+	 * %fs and %gs may be cleared by load_TLS().
+	 *
+	 * (e.g. xen_load_tls())
+	 */
+	asm volatile("movl %%fs,%0" : "=r" (fsindex)); 
+	asm volatile("movl %%gs,%0" : "=r" (gsindex)); 
+
 	load_TLS(next, cpu);
 
 	/*
@@ -603,8 +613,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	 * Switch FS and GS.
 	 */
 	{ 
-		unsigned fsindex;
-		asm volatile("movl %%fs,%0" : "=r" (fsindex)); 
 		/* segment register != 0 always requires a reload. 
 		   also reload when it has changed. 
 		   when prev process used 64bit base always reload
@@ -622,10 +630,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		if (next->fs) 
 			wrmsrl(MSR_FS_BASE, next->fs); 
 		prev->fsindex = fsindex;
-	}
-	{ 
-		unsigned gsindex;
-		asm volatile("movl %%gs,%0" : "=r" (gsindex)); 
+
 		if (unlikely(gsindex | next->gsindex | prev->gs)) {
 			load_gs_index(next->gsindex);
 			if (gsindex)
-- 
1.5.4.1


linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch:

--- NEW FILE linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch ---
>From 3f29b0e7a96accfe038d256755252fee01bb1038 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 7 Apr 2008 15:48:00 -0300
Subject: [PATCH] xen-64: Clear %fs on xen_load_tls()

We need to do this, otherwise we can get a GPF on hypercall return
after TLS descriptor is cleared but %fs is still pointing to it.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index e42be87..2b7cca1 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -405,7 +405,6 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
 
 	xen_mc_issue(PARAVIRT_LAZY_CPU);
 
-#ifdef CONFIG_X86_32
 	/*
 	 * XXX sleazy hack: If we're being called in a lazy-cpu zone,
 	 * it means we're in a context switch, and %gs has just been
@@ -415,20 +414,22 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
 	 * loaded properly.  This will go away as soon as Xen has been
 	 * modified to not save/restore %gs for normal hypercalls.
 	 *
-	 * This hack is not used on x86_64, because:
-	 * - For %gs: x86_64 gs points to KERNEL_GS_BASE (and uses it for PDA
-	 *   references), so we must not zero %gs on x86_64
-	 * - For %fs: x86_64 may have %fs pointing to TLS descriptors, but
-	 *   __switch_to() reads %fs after load_TLS(). We can't clear it
+	 * On x86_64, this hack is not used for %gs, because gs points
+	 * to KERNEL_GS_BASE (and uses it for PDA references), so we
+	 * must not zero %gs on x86_64
 	 *
-	 * FIXME: we need to be sure we don't _need_ the hack on x86_64.
-	 * Can we get a #GP when switch back from the hypervisor if
-	 * TLS descriptor is cleared but %fs still points to it?
+	 * For x86_64, we need to zero %fs, otherwise we may
+	 * get an exception between the new %fs descriptor being
+	 * loaded and %fs being effectively cleared at __switch_to().
 	 */
 	if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) {
+#ifdef CONFIG_X86_64
+		loadsegment(fs, 0);
+#endif
+#ifdef CONFIG_X86_32
 		loadsegment(gs, 0);
-	}
 #endif
+	}
 }
 
 #ifdef CONFIG_X86_64
-- 
1.5.4.1


linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch:

--- NEW FILE linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch ---
>From f1709e9e85b1905802d619ceb7193d78cbf78dfd Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 20 Mar 2008 18:44:54 -0300
Subject: [PATCH] ia32entry.S: Replace cli/sti cases with DISABLE_INTERRUPTS/DISABLE_INTERRUPTS

Replace almost all cases of cli/sti, except one more complicated case
involving sysexit.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/ia32/ia32entry.S |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index b5e329d..4d5e9ae 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -92,7 +92,7 @@ ENTRY(ia32_sysenter_target)
 	 * No need to follow this irqs on/off section: the syscall
 	 * disabled irqs, here we enable it straight after entry:
 	 */
-	sti	
+	ENABLE_INTERRUPTS(CLBR_NONE)
  	movl	%ebp,%ebp		/* zero extension */
 	pushq	$__USER32_DS
 	CFI_ADJUST_CFA_OFFSET 8
@@ -134,7 +134,7 @@ sysenter_do_call:
 	call	*ia32_sys_call_table(,%rax,8)
 	movq	%rax,RAX-ARGOFFSET(%rsp)
 	GET_THREAD_INFO(%r10)
-	cli
+	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
 	testl	$_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
 	jnz	int_ret_from_sys_call
@@ -208,7 +208,7 @@ ENTRY(ia32_cstar_target)
 	 * No need to follow this irqs on/off section: the syscall
 	 * disabled irqs and here we enable it straight after entry:
 	 */
-	sti
+	ENABLE_INTERRUPTS(CLBR_NONE)
 	SAVE_ARGS 8,1,1
 	movl 	%eax,%eax	/* zero extension */
 	movq	%rax,ORIG_RAX-ARGOFFSET(%rsp)
@@ -241,7 +241,7 @@ cstar_do_call:
 	call *ia32_sys_call_table(,%rax,8)
 	movq %rax,RAX-ARGOFFSET(%rsp)
 	GET_THREAD_INFO(%r10)
-	cli
+	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
 	testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
 	jnz  int_ret_from_sys_call
@@ -315,7 +315,7 @@ ENTRY(ia32_syscall)
 	 * No need to follow this irqs on/off section: the syscall
 	 * disabled irqs and here we enable it straight after entry:
 	 */
-	sti
+	ENABLE_INTERRUPTS(CLBR_NONE)
 	movl %eax,%eax
 	pushq %rax
 	CFI_ADJUST_CFA_OFFSET 8
-- 
1.5.4.1


linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch:

--- NEW FILE linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch ---
>From 76ee138d0d29bffc1342c37f814f3a540c2b3c06 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 20 Mar 2008 18:45:57 -0300
Subject: [PATCH] Introduce xen_ia32_syscall()

Used for ia32 emulation under Xen.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/ia32/ia32entry.S |   23 +++++++++++++++++++++++
 include/asm-x86/proto.h   |    1 +
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 4d5e9ae..3b25947 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -280,6 +280,27 @@ ia32_badarg:
 	jmp ia32_sysret
 	CFI_ENDPROC
 
+
+#ifdef CONFIG_XEN
+
+/* The entry point for Xen IA32 syscall
+ *
+ * The stack format is a bit different under Xen, so we restore
+ * RCX and R11 from the stack and then continue on the standard
+ * path.
+ */
+ENTRY(xen_ia32_syscall)
+	/* Restore rcx and r11 from stack */
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+
+	/* Continue on the normal path */
+	jmp ia32_syscall_after_swapgs
+
+#endif
+
+
 /* 
  * Emulated IA32 system calls via int 0x80. 
  *
@@ -311,6 +332,8 @@ ENTRY(ia32_syscall)
 	/*CFI_REL_OFFSET	cs,CS-RIP*/
 	CFI_REL_OFFSET	rip,RIP-RIP
 	swapgs
+
+ia32_syscall_after_swapgs:
 	/*
 	 * No need to follow this irqs on/off section: the syscall
 	 * disabled irqs and here we enable it straight after entry:
diff --git a/include/asm-x86/proto.h b/include/asm-x86/proto.h
index 2ecdf90..25a1d68 100644
--- a/include/asm-x86/proto.h
+++ b/include/asm-x86/proto.h
@@ -12,6 +12,7 @@ extern void system_call_after_swapgs(void);
 extern void syscall_init(void);
 
 extern void ia32_syscall(void);
+extern void xen_ia32_syscall(void);
 extern void ia32_cstar_target(void);
 extern void ia32_sysenter_target(void);
 
-- 
1.5.4.1


linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch:

--- NEW FILE linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch ---
>From 40c78ffa2d6b69c575c509677e7f178dd90226b2 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 20 Mar 2008 18:46:27 -0300
Subject: [PATCH] Use xen_ia32_syscall() if CONFIG_XEN is enabled (FIXME)

This needs to be implemented at runtime, also.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/traps_64.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index adff76e..4c05efc 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -1173,7 +1173,11 @@ void __init trap_init(void)
 	set_intr_gate(19,&simd_coprocessor_error);
 
 #ifdef CONFIG_IA32_EMULATION
+# ifdef CONFIG_XEN
+	set_system_gate(IA32_SYSCALL_VECTOR, xen_ia32_syscall);
+# else
 	set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
+# endif
 #endif
        
 	/*
-- 
1.5.4.1


linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch:

--- NEW FILE linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch ---
>From 43f7ff47e1cd3f9758cb51bfe7069cb35c935eef Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 26 Mar 2008 13:16:40 -0300
Subject: [PATCH] Make the int80 and syscall vdso32 implementations selectable by .config

This will allow us to enable it when needed under Xen, on a further patch.

This commit should be a no-op for existing code.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/Kconfig             |   19 +++++++++++++++++++
 arch/x86/vdso/Makefile       |    2 +-
 arch/x86/vdso/vdso32-setup.c |   18 +++++++++++++++++-
 arch/x86/vdso/vdso32.S       |   16 +++++++++++-----
 4 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2de2db6..1183585 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1307,6 +1307,25 @@ config COMPAT_VDSO
 
 	  If unsure, say Y.
 
+
+config VDSO_INT80
+	def_bool X86_32
+
+config VDSO_SYSCALL
+	def_bool !X86_32
+
+
+config VDSO_DEFAULT_INT80
+	bool
+	default X86_32
+	depends on VDSO_INT80
+
+config VDSO_DEFAULT_SYSCALL
+	bool
+	default !X86_32
+	depends on VDSO_SYSCALL
+
+
 endmenu
 
 config ARCH_ENABLE_MEMORY_HOTPLUG
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index b7ad9f8..106f9d2 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -62,7 +62,7 @@ $(obj)/%-syms.lds: $(obj)/%.so.dbg FORCE
 # Build multiple 32-bit vDSO images to choose from at boot time.
 #
 obj-$(VDSO32-y)			+= vdso32-syms.lds
-vdso32.so-$(CONFIG_X86_32)	+= int80
+vdso32.so-$(CONFIG_VDSO_INT80)	+= int80
 vdso32.so-$(CONFIG_COMPAT)	+= syscall
 vdso32.so-$(VDSO32-y)		+= sysenter
 
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index a947011..164885a 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -197,10 +197,26 @@ static __init void relocate_vdso(Elf32_Ehdr *ehdr)
  * These symbols are defined by vdso32.S to mark the bounds
  * of the ELF DSO images included therein.
  */
-extern const char vdso32_default_start, vdso32_default_end;
+#ifdef CONFIG_VDSO_INT80
+extern const char vdso32_int80_start, vdso32_int80_end;
+#endif
+#ifdef CONFIG_VDSO_SYSCALL
+extern const char vdso32_syscall_start, vdso32_syscall_end;
+#endif
 extern const char vdso32_sysenter_start, vdso32_sysenter_end;
 static struct page *vdso32_pages[1];
 
+
+#ifdef CONFIG_VDSO_DEFAULT_INT80
+# define vdso32_default_start vdso32_int80_start
+# define vdso32_default_end   vdso32_int80_end
+#elif defined(CONFIG_VDSO_DEFAULT_SYSCALL)
+# define vdso32_default_start vdso32_syscall_start
+# define vdso32_default_end   vdso32_syscall_end
+#else
+# error No CONFIG_VDSO_DEFAULT_ option is set
+#endif
+
 #ifdef CONFIG_X86_64
 
 static int use_sysenter __read_mostly = -1;
diff --git a/arch/x86/vdso/vdso32.S b/arch/x86/vdso/vdso32.S
index 1e36f72..d4485fb 100644
--- a/arch/x86/vdso/vdso32.S
+++ b/arch/x86/vdso/vdso32.S
@@ -2,14 +2,20 @@
 
 __INITDATA
 
-	.globl vdso32_default_start, vdso32_default_end
-vdso32_default_start:
-#ifdef CONFIG_X86_32
+#ifdef CONFIG_VDSO_INT80
+	.globl vdso32_int80_start, vdso32_int80_end
+vdso32_int80_start:
 	.incbin "arch/x86/vdso/vdso32-int80.so"
-#else
+vdso32_int80_end:
+#endif
+
+#ifdef CONFIG_VDSO_SYSCALL
+	.globl vdso32_syscall_start, vdso32_syscall_end
+vdso32_syscall_start:
 	.incbin "arch/x86/vdso/vdso32-syscall.so"
+vdso32_syscall_end:
 #endif
-vdso32_default_end:
+
 
 	.globl vdso32_sysenter_start, vdso32_sysenter_end
 vdso32_sysenter_start:
-- 
1.5.4.1


linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch:

--- NEW FILE linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch ---
>From 5bacf1ef98ee2c120c5ce3827ab6921eb8203c57 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 26 Mar 2008 13:25:35 -0300
Subject: [PATCH] Use vdso32-int80 by default if Xen is enabled (FIXME)

Temporary fix. This should be selected at runtime instead.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/Kconfig |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1183585..65cd3c5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1309,7 +1309,7 @@ config COMPAT_VDSO
 
 
 config VDSO_INT80
-	def_bool X86_32
+	def_bool X86_32 || XEN
 
 config VDSO_SYSCALL
 	def_bool !X86_32
@@ -1317,12 +1317,12 @@ config VDSO_SYSCALL
 
 config VDSO_DEFAULT_INT80
 	bool
-	default X86_32
+	default X86_32 || XEN
 	depends on VDSO_INT80
 
 config VDSO_DEFAULT_SYSCALL
 	bool
-	default !X86_32
+	default !X86_32 && !XEN
 	depends on VDSO_SYSCALL
 
 
-- 
1.5.4.1


linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch:

--- NEW FILE linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch ---
>From 24ecb927be4ffdaf664a21b193d1df466bf9ce63 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Fri, 25 Apr 2008 18:40:41 -0300
Subject: [PATCH] xen_pgd_pin(): use TASK_SIZE64 on x86_64

We need to walk the whole address space, even on 32-bit tasks.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/mmu.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index f9d9c39..392681c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -490,6 +490,14 @@ static int pin_page(struct page *page, enum pt_level level)
 	return flush;
 }
 
+
+#ifdef CONFIG_X86_64
+#  define PGD_WALK_SIZE TASK_SIZE64
+#else
+#  define PGD_WALK_SIZE TASK_SIZE
+#endif
+
+
 /* This is called just after a mm has been created, but it has not
    been used yet.  We need to make sure that its pagetable is all
    read-only, and can be pinned. */
@@ -499,7 +507,7 @@ void xen_pgd_pin(pgd_t *pgd)
 
 	xen_mc_batch();
 
-	if (pgd_walk(pgd, pin_page, 0, TASK_SIZE)) {
+	if (pgd_walk(pgd, pin_page, 0, PGD_WALK_SIZE)) {
 		/* re-enable interrupts for kmap_flush_unused */
 		xen_mc_issue(0);
 		kmap_flush_unused();
@@ -585,9 +593,9 @@ void xen_pgd_unpin(pgd_t *pgd)
 	unpin_page(virt_to_page(pgd), PT_PGD);
 
 #ifdef CONFIG_X86_64
-	pgd_walk(__user_pgd(pgd), unpin_page, 0, TASK_SIZE);
+	pgd_walk(__user_pgd(pgd), unpin_page, 0, PGD_WALK_SIZE);
 #endif
-	pgd_walk(pgd, unpin_page, 0, TASK_SIZE);
+	pgd_walk(pgd, unpin_page, 0, PGD_WALK_SIZE);
 
 	xen_mc_issue(0);
 }
-- 
1.5.4.1


linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch:

--- NEW FILE linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch ---
>From 05fd3ae2cca2413b32d18a3b362497a02ac6f7b9 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Wed, 28 May 2008 14:12:59 -0300
Subject: [PATCH] paravirt-ops-64: Save %rdi also on asm version of PV_SAVE_REGS

Function being called on ENABLE_INTERRUPTS may clobber %rdi, in
addition to the other registers that are already saved.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/paravirt.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ff3a08b..8ac3a00 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1415,8 +1415,8 @@ static inline unsigned long __raw_local_irq_save(void)
 
 
 #ifdef CONFIG_X86_64
-#define PV_SAVE_REGS   pushq %rax; pushq %rdi; pushq %rcx; pushq %rdx
-#define PV_RESTORE_REGS popq %rdx; popq %rcx; popq %rdi; popq %rax
+#define PV_SAVE_REGS   pushq %rax; pushq %rdi; pushq %rsi; pushq %rcx; pushq %rdx
+#define PV_RESTORE_REGS popq %rdx; popq %rcx; popq %rsi; popq %rdi; popq %rax
 #define PARA_PATCH(struct, off)        ((PARAVIRT_PATCH_##struct + (off)) / 8)
 #define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8)
 #else
-- 
1.5.4.1


linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch ---
>From d218862292fbba41835a5b42d87338ce9190208f Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 5 Jun 2008 17:06:57 -0300
Subject: [PATCH] X86_VSMP: make not depend on !XEN  (REVIEWME)

Workaround for Kconfig circular dependency. Probably not the best way
to fix it.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/Kconfig |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 65cd3c5..9104fa0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -337,7 +337,6 @@ config X86_RDC321X
 config X86_VSMP
 	bool "Support for ScaleMP vSMP"
 	select PARAVIRT
-	depends on !XEN
 	depends on X86_64
 	help
 	  Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
-- 
1.5.4.1


linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch:

--- NEW FILE linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch ---
>From 9daaf8e7d05ccb47c6c35f3b6b0739742b72e91a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 5 Jun 2008 18:26:58 -0300
Subject: [PATCH] Add do_IRQ() prototype to asm-x86/irq_64.h

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 include/asm-x86/irq_64.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/irq_64.h b/include/asm-x86/irq_64.h
index 083d35a..9b0a062 100644
--- a/include/asm-x86/irq_64.h
+++ b/include/asm-x86/irq_64.h
@@ -1,6 +1,9 @@
 #ifndef _ASM_IRQ_H
 #define _ASM_IRQ_H
 
+#include <linux/linkage.h>
+#include <asm/ptrace.h>
+
 /*
  *	linux/include/asm/irq.h
  *
@@ -48,4 +51,6 @@ extern void fixup_irqs(cpumask_t map);
 
 #define __ARCH_HAS_DO_SOFTIRQ 1
 
+asmlinkage unsigned int do_IRQ(struct pt_regs *regs);
+
 #endif /* _ASM_IRQ_H */
-- 
1.5.4.1


linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch:

--- NEW FILE linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch ---
>From 9822964e243cb000a244a0913da93f1451a79cb0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 5 Jun 2008 18:50:45 -0300
Subject: [PATCH] Disable sysenter on x86_64 (temporarily?) (REVIEWME)

xen_sysenter_target is not defined for 64-bit (yet?), so disable it
for now.

I must check the hypervisor path on sysenter for a 64-bit guest,
to find out if something is missing for sysenter on 64-bit.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/setup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 48fa33a..2e8af19 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -87,6 +87,7 @@ static void __init fiddle_vdso(void)
 
 void xen_enable_sysenter(void)
 {
+#ifdef CONFIG_X86_32
 	int cpu = smp_processor_id();
 	extern void xen_sysenter_target(void);
 	/* Mask events on entry, even though they get enabled immediately */
@@ -101,6 +102,7 @@ void xen_enable_sysenter(void)
 		clear_cpu_cap(&cpu_data(cpu), X86_FEATURE_SEP);
 		clear_cpu_cap(&boot_cpu_data, X86_FEATURE_SEP);
 	}
+#endif
 }
 
 void __init xen_arch_setup(void)
-- 
1.5.4.1


linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch:

--- NEW FILE linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch ---
>From fc30249c8756e1b5a31e685c76bc3122d7a88ac5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 5 Jun 2008 18:55:51 -0300
Subject: [PATCH] Add xen_{alloc,release}_pud() functions for x86_64 xen

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 2b7cca1..733036b 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -853,6 +853,13 @@ static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
 	xen_alloc_ptpage(mm, pfn, PT_PMD);
 }
 
+#if PAGETABLE_LEVELS >= 3
+static void xen_alloc_pud(struct mm_struct *mm, unsigned long pfn)
+{
+	xen_alloc_ptpage(mm, pfn, PT_PUD);
+}
+#endif
+
 /* This should never happen until we're OK to use struct page */
 static void xen_release_ptpage(unsigned long pfn, unsigned level)
 {
@@ -878,6 +885,13 @@ static void xen_release_pmd(unsigned long pfn)
 	xen_release_ptpage(pfn, PT_PMD);
 }
 
+#if PAGETABLE_LEVELS >=3 
+static void xen_release_pud(unsigned long pfn)
+{
+	xen_release_ptpage(pfn, PT_PUD);
+}
+#endif
+
 #ifdef CONFIG_HIGHPTE
 static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
 {
@@ -1009,8 +1023,14 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
 	   (which it hasn't) */
 	pv_mmu_ops.alloc_pte = xen_alloc_pte;
 	pv_mmu_ops.alloc_pmd = xen_alloc_pmd;
+#if PAGETABLE_LEVELS >= 3
+	pv_mmu_ops.alloc_pud = xen_alloc_pud;
+#endif
 	pv_mmu_ops.release_pte = xen_release_pte;
 	pv_mmu_ops.release_pmd = xen_release_pmd;
+#if PAGETABLE_LEVELS >= 3
+	pv_mmu_ops.release_pud = xen_release_pud;
+#endif
 	pv_mmu_ops.set_pte = xen_set_pte;
 
 	setup_shared_info();
-- 
1.5.4.1


linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch:

--- NEW FILE linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch ---
>From 98eb1cabefd8d19d18790a696c65dc96833a5485 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 9 Jun 2008 17:52:57 -0300
Subject: [PATCH] Extract reserve_initrd() from x86_64_start_kernel()

It will be reused by xen_start_kernel() later.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/head64.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index e25c57b..45cd9c4 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -53,6 +53,19 @@ static void __init copy_bootdata(char *real_mode_data)
 
 #define BIOS_LOWMEM_KILOBYTES 0x413
 
+static void __init reserve_initrd(void)
+{
+#ifdef CONFIG_BLK_DEV_INITRD
+	/* Reserve INITRD */
+	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
+		unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
+		unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
+		unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
+		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
+	}
+#endif
+}
+
 /*
  * The BIOS places the EBDA/XBDA at the top of conventional
  * memory, and usually decreases the reported amount of
@@ -164,16 +177,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
 
 	reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
 
-#ifdef CONFIG_BLK_DEV_INITRD
-	/* Reserve INITRD */
-	if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
-		unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
-		unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
-		unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
-		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
-	}
-#endif
-
+	reserve_initrd();
 	reserve_ebda_region();
 	reserve_setup_data();
 
-- 
1.5.4.1


linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch:

--- NEW FILE linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch ---
>From 271c9a0da21696ae990bc0aafd88c0943d735e7c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 9 Jun 2008 18:00:29 -0300
Subject: [PATCH] Make reserve_initrd() non-static

It will be used by xen_start_kernel().

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/kernel/head64.c |    2 +-
 include/asm-x86/setup.h  |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 45cd9c4..23fdd59 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -53,7 +53,7 @@ static void __init copy_bootdata(char *real_mode_data)
 
 #define BIOS_LOWMEM_KILOBYTES 0x413
 
-static void __init reserve_initrd(void)
+void __init reserve_initrd(void)
 {
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Reserve INITRD */
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h
index fa6763a..989933b 100644
--- a/include/asm-x86/setup.h
+++ b/include/asm-x86/setup.h
@@ -43,6 +43,8 @@ char *machine_specific_memory_setup(void);
  */
 extern struct boot_params boot_params;
 
+void __init reserve_initrd(void);
+
 #ifdef __i386__
 /*
  * Do NOT EVER look at the BIOS memory size location.
-- 
1.5.4.1


linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch:

--- NEW FILE linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch ---
>From 8581ce443fe65ea3be40619f649536324088a06b Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Mon, 9 Jun 2008 18:10:03 -0300
Subject: [PATCH] xen-64: Reserve initrd on xen_start_kernel() also

On x86_64, initrd is reserved on x86_64_start_kernel(). Hence we need
to do that on xen_start_kernel() also.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/xen/enlighten.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 733036b..431c5e4 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1507,6 +1507,10 @@ asmlinkage void __init xen_start_kernel(void)
 		add_preferred_console("hvc", 0, NULL);
 	}
 
+#ifdef CONFIG_X86_64
+	reserve_initrd();
+#endif
+
 	/* Start the world */
 	start_kernel();
 }
-- 
1.5.4.1



--- NEW FILE patch-2.6.26-rc6-git2.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info

iD8DBQBIU275yGugalF9Dw4RAm+XAJ47JKI4Iq4aWdeA52Z2ITYikI4ONQCfbad+
lL1Xd0DtRI0W+b7aIVSnFo4=
=NoZz
-----END PGP SIGNATURE-----


--- NEW FILE patch-2.6.26-rc6.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info

iD8DBQBIUaD5yGugalF9Dw4RAmxzAJ9ox7hv03xikx0JkXQlpEH90VD+swCfS/TK
vFhaEu4SOCxQANRRRsWYiog=
=MrKy
-----END PGP SIGNATURE-----


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/.cvsignore,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- .cvsignore	8 May 2008 08:57:47 -0000	1.17
+++ .cvsignore	16 Jun 2008 10:19:26 -0000	1.18
@@ -4,5 +4,6 @@
 temp-*
 kernel-2.6.25
 linux-2.6.25.tar.bz2
-patch-2.6.25.2.bz2
+patch-2.6.26-rc6.bz2
+patch-2.6.26-rc6-git2.bz2
 xen-3.2.0.tar.gz


Index: .gitignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/.gitignore,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- .gitignore	8 May 2008 08:57:47 -0000	1.7
+++ .gitignore	16 Jun 2008 10:19:26 -0000	1.8
@@ -4,5 +4,6 @@
 temp-*
 kernel-2.6.25
 linux-2.6.25.tar.bz2
-patch-2.6.25.2.bz2
+patch-2.6.26-rc6.bz2
+patch-2.6.26-rc6-git2.bz2
 xen-3.2.0.tar.gz


Index: Makefile
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/Makefile,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Makefile	29 May 2008 16:09:55 -0000	1.22
+++ Makefile	16 Jun 2008 10:19:26 -0000	1.23
@@ -39,7 +39,6 @@
 	@perl -pi -e 's/# CONFIG_SLUB_DEBUG_ON is not set/CONFIG_SLUB_DEBUG_ON=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_LOCK_STAT is not set/CONFIG_LOCK_STAT=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_STACK_USAGE is not set/CONFIG_DEBUG_STACK_USAGE=y/' config-nodebug
-	@perl -pi -e 's/# CONFIG_DEBUG_IGNORE_QUIET is not set/CONFIG_DEBUG_IGNORE_QUIET=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_SLAB is not set/CONFIG_DEBUG_SLAB=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_MUTEXES is not set/CONFIG_DEBUG_MUTEXES=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_RT_MUTEXES is not set/CONFIG_DEBUG_RT_MUTEXES=y/' config-nodebug
@@ -49,7 +48,6 @@
 	@perl -pi -e 's/# CONFIG_DEBUG_SPINLOCK is not set/CONFIG_DEBUG_SPINLOCK=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_VM is not set/CONFIG_DEBUG_VM=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_SLEEP_IN_IRQ is not set/CONFIG_DEBUG_SLEEP_IN_IRQ=y/' config-nodebug
-	@perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug
 	@perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
 	@perl -pi -e 's/# CONFIG_FAULT_INJECTION is not set/CONFIG_FAULT_INJECTION=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_FAILSLAB is not set/CONFIG_FAILSLAB=y/' config-nodebug
@@ -59,6 +57,12 @@
 	@perl -pi -e 's/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_DEBUG_SG is not set/CONFIG_DEBUG_SG=y/' config-nodebug
 	@perl -pi -e 's/# CONFIG_USB_DEBUG is not set/CONFIG_USB_DEBUG=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_DEBUG_WRITECOUNT is not set/CONFIG_DEBUG_WRITECOUNT=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_DEBUG_OBJECTS is not set/CONFIG_DEBUG_OBJECTS=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_FREE is not set/CONFIG_DEBUG_OBJECTS_FREE=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_TIMERS is not set/CONFIG_DEBUG_OBJECTS_TIMERS=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_X86_PTDUMP is not set/CONFIG_X86_PTDUMP=y/' config-nodebug
+	@perl -pi -e 's/# CONFIG_CAN_DEBUG_DEVICES is not set/CONFIG_CAN_DEBUG_DEVICES=y/' config-nodebug
 
 	@perl -pi -e 's/^%define debugbuildsenabled 1/%define debugbuildsenabled 0/' kernel.spec
 
@@ -66,7 +70,6 @@
 	@perl -pi -e 's/CONFIG_SLUB_DEBUG_ON=y/# CONFIG_SLUB_DEBUG_ON is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_LOCK_STAT=y/# CONFIG_LOCK_STAT is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_DEBUG_STACK_USAGE=y/# CONFIG_DEBUG_STACK_USAGE is not set/' config-nodebug
-	@perl -pi -e 's/CONFIG_DEBUG_IGNORE_QUIET=y/# CONFIG_DEBUG_IGNORE_QUIET is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_DEBUG_SLAB=y/# CONFIG_DEBUG_SLAB is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_DEBUG_MUTEXES=y/# CONFIG_DEBUG_MUTEXES is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_DEBUG_RT_MUTEXES=y/# CONFIG_DEBUG_RT_MUTEXES is not set/' config-nodebug
@@ -86,13 +89,19 @@
 	@perl -pi -e 's/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_DEBUG_SG=y/# CONFIG_DEBUG_SG is not set/' config-nodebug
 	@perl -pi -e 's/CONFIG_USB_DEBUG=y/# CONFIG_USB_DEBUG is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_DEBUG_WRITECOUNT=y/# CONFIG_DEBUG_WRITECOUNT is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_DEBUG_OBJECTS=y/# CONFIG_DEBUG_OBJECTS is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_DEBUG_OBJECTS_FREE=y/# CONFIG_DEBUG_OBJECTS_FREE is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_DEBUG_OBJECTS_TIMERS=y/# CONFIG_DEBUG_OBJECTS_TIMERS is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_X86_PTDUMP=y/# CONFIG_X86_PTDUMP is not set/' config-nodebug
+	@perl -pi -e 's/CONFIG_CAN_DEBUG_DEVICES=y/# CONFIG_CAN_DEBUG_DEVICES is not set/' config-nodebug
 
 	@perl -pi -e 's/^%define debugbuildsenabled 0/%define debugbuildsenabled 1/' kernel.spec
 
 
 reconfig:
 	@rm -f kernel-*-config
-	@VERSION="2.6.25" make -f Makefile.config configs
+	@VERSION="2.6.26" make -f Makefile.config configs
 	@scripts/reconfig.sh
 
 # since i386 isn't a target...




Index: config-debug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-debug,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-debug	1 Apr 2008 10:38:06 -0000	1.4
+++ config-debug	16 Jun 2008 10:19:26 -0000	1.5
@@ -3,7 +3,6 @@
 CONFIG_SND_DEBUG_DETECT=y
 CONFIG_SND_PCM_XRUN_DEBUG=y
 
-CONFIG_DEBUG_IGNORE_QUIET=y
 CONFIG_DEBUG_MUTEXES=y
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_LOCK_ALLOC=y
@@ -29,6 +28,16 @@
 
 CONFIG_DEBUG_SG=y
 
-# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUG_PAGEALLOC=y
 
 CONFIG_USB_DEBUG=y
+
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_OBJECTS=y
+# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
+CONFIG_DEBUG_OBJECTS_FREE=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+
+CONFIG_X86_PTDUMP=y
+
+CONFIG_CAN_DEBUG_DEVICES=y


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-generic,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- config-generic	8 May 2008 08:57:47 -0000	1.8
+++ config-generic	16 Jun 2008 10:19:26 -0000	1.9
@@ -61,6 +61,7 @@
 #
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 CONFIG_MODULE_SRCVERSION_ALL=y
@@ -103,6 +104,7 @@
 CONFIG_MMC=m
 CONFIG_MMC_BLOCK_BOUNCE=y
 CONFIG_SDIO_UART=m
+# CONFIG_MMC_TEST is not set
 # CONFIG_MMC_DEBUG is not set
 # CONFIG_MMC_UNSAFE_RESUME is not set
 CONFIG_MMC_BLOCK=m
@@ -155,6 +157,7 @@
 CONFIG_MTD=m
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_AR7_PARTS=m
 CONFIG_MTD_CONCAT=m
 CONFIG_MTD_CMDLINE_PARTS=y
 #
@@ -409,6 +412,7 @@
 CONFIG_VIRTIO_PCI=m
 CONFIG_VIRTIO_BALLOON=m
 CONFIG_VIRTIO_NET=m
+CONFIG_HW_RANDOM_VIRTIO=m
 
 #
 # SCSI device support
@@ -487,13 +491,16 @@
 CONFIG_MEGARAID_SAS=m
 
 CONFIG_ATA=m
+CONFIG_ATA_SFF=y
 CONFIG_ATA_PIIX=m
+CONFIG_ATA_ACPI=y
 CONFIG_BLK_DEV_SX8=m
 CONFIG_PDC_ADMA=m
 CONFIG_SATA_AHCI=m
 CONFIG_SATA_INIC162X=m
 CONFIG_SATA_MV=m
 CONFIG_SATA_NV=m
+CONFIG_SATA_PMP=y
 CONFIG_SATA_PROMISE=m
 CONFIG_SATA_QSTOR=m
 CONFIG_SATA_SIL=m
@@ -524,7 +531,7 @@
 CONFIG_PATA_HPT3X2N=m
 CONFIG_PATA_HPT3X3=m
 CONFIG_PATA_HPT3X3_DMA=y
-CONFIG_PATA_ISAPNP=m
+# CONFIG_PATA_ISAPNP is not set
 CONFIG_PATA_IT821X=m
 CONFIG_PATA_IT8213=m
 CONFIG_PATA_JMICRON=m
@@ -547,6 +554,7 @@
 # CONFIG_PATA_SC1200 is not set
 CONFIG_PATA_SERVERWORKS=m
 CONFIG_PATA_PDC2027X=m
+CONFIG_PATA_SCH=m
 CONFIG_PATA_SIL680=m
 CONFIG_PATA_SIS=m
 CONFIG_PATA_TRIFLEX=m
@@ -555,7 +563,7 @@
 
 CONFIG_SCSI_BUSLOGIC=m
 CONFIG_SCSI_INITIO=m
-# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+CONFIG_SCSI_FLASHPOINT=y
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -747,6 +755,8 @@
 CONFIG_IPV6_TUNNEL=m
 CONFIG_IPV6_SUBTREES=y
 CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_PIMSM_V2=y
 
 CONFIG_NET_9P=m
 CONFIG_NET_9P_FD=m
@@ -834,6 +844,7 @@
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_CT_PROTO_DCCP=m
 CONFIG_NF_CT_PROTO_SCTP=m
 CONFIG_NF_CT_NETLINK=m
 CONFIG_NF_CT_PROTO_UDPLITE=m
@@ -891,25 +902,26 @@
 # Bridge: Netfilter Configuration
 #
 CONFIG_BRIDGE_NF_EBTABLES=m
-CONFIG_BRIDGE_EBT_BROUTE=m
-CONFIG_BRIDGE_EBT_T_FILTER=m
-CONFIG_BRIDGE_EBT_T_NAT=m
 CONFIG_BRIDGE_EBT_802_3=m
 CONFIG_BRIDGE_EBT_AMONG=m
 CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_DNAT=m
 CONFIG_BRIDGE_EBT_IP=m
 CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_LOG=m
 CONFIG_BRIDGE_EBT_MARK=m
-CONFIG_BRIDGE_EBT_PKTTYPE=m
-CONFIG_BRIDGE_EBT_STP=m
-CONFIG_BRIDGE_EBT_VLAN=m
-CONFIG_BRIDGE_EBT_ARPREPLY=m
-CONFIG_BRIDGE_EBT_DNAT=m
 CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_NFLOG=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
 CONFIG_BRIDGE_EBT_REDIRECT=m
 CONFIG_BRIDGE_EBT_SNAT=m
-CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
 CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_BRIDGE_EBT_VLAN=m
 CONFIG_XFRM=y
 CONFIG_XFRM_MIGRATE=y
 CONFIG_XFRM_SUB_POLICY=y
@@ -1190,6 +1202,7 @@
 CONFIG_R8169=m
 CONFIG_R8169_NAPI=y
 CONFIG_R8169_VLAN=y
+CONFIG_SFC=m
 # CONFIG_SK98LIN is not set
 CONFIG_SKGE=m
 # CONFIG_SKGE_DEBUG is not set
@@ -1277,6 +1290,7 @@
 CONFIG_B43=m
 CONFIG_B43_PCMCIA=y
 CONFIG_B43_DEBUG=y
+# CONFIG_B43_FORCE_PIO is not set
 CONFIG_B43LEGACY=m
 CONFIG_B43LEGACY_DEBUG=y
 CONFIG_B43LEGACY_DMA=y
@@ -1300,20 +1314,23 @@
 CONFIG_LIBERTAS_CS=m
 CONFIG_LIBERTAS_SDIO=m
 CONFIG_LIBERTAS_DEBUG=y
-CONFIG_IWLWIFI_LEDS=y
 CONFIG_IWLCORE_RFKILL=y
-CONFIG_IWL4965=m
+CONFIG_IWLWIFI_LEDS=y
+CONFIG_IWLWIFI_RUN_TIME_CALIB=y
 CONFIG_IWLWIFI_DEBUG=y
 CONFIG_IWLWIFI_DEBUGFS=y
+CONFIG_IWLWIFI_RFKILL=y
+CONFIG_IWL4965=m
 CONFIG_IWL4965_SENSITIVITY=y
 CONFIG_IWL4965_SPECTRUM_MEASUREMENT=y
-CONFIG_IWL4965_QOS=y
+CONFIG_IWL4965_RUN_TIME_CALIB=y
 CONFIG_IWL4965_HT=y
 CONFIG_IWL4965_LEDS=y
+CONFIG_IWL5000=y
+CONFIG_IWL5000_RUN_TIME_CALIB=y
 CONFIG_IWL3945=m
 CONFIG_IWL3945_DEBUG=y
 CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
-CONFIG_IWL3945_QOS=y
 CONFIG_IWL3945_LEDS=y
 CONFIG_NORTEL_HERMES=m
 CONFIG_P54_COMMON=m
@@ -1394,7 +1411,10 @@
 CONFIG_HAMRADIO=y
 CONFIG_AX25=m
 CONFIG_AX25_DAMA_SLAVE=y
-# CONFIG_CAN is not set
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_VCAN=m
 CONFIG_NETROM=m
 CONFIG_ROSE=m
 CONFIG_MKISS=m
@@ -1682,6 +1702,7 @@
 CONFIG_JOYSTICK_XPAD=m
 CONFIG_JOYSTICK_XPAD_FF=y
 CONFIG_JOYSTICK_XPAD_LEDS=y
+CONFIG_JOYSTICK_ZHENHUA=m
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_GUNZE=m
 CONFIG_TOUCHSCREEN_ELO=m
@@ -1693,6 +1714,7 @@
 CONFIG_TOUCHSCREEN_TOUCHWIN=m
 CONFIG_TOUCHSCREEN_UCB1400=m
 CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+# CONFIG_TOUCHSCREEN_WM97XX is not set
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_PCSPKR=m
 CONFIG_INPUT_UINPUT=m
@@ -1806,6 +1828,7 @@
 CONFIG_I2C_PARPORT_LIGHT=m
 CONFIG_I2C_PASEMI=m
 CONFIG_I2C_PCA_ISA=m
+CONFIG_I2C_PCA_PLATFORM=m
 # CONFIG_I2C_PIIX4 is not set
 CONFIG_I2C_PROSAVAGE=m
 CONFIG_I2C_SAVAGE4=m
@@ -1856,6 +1879,8 @@
 CONFIG_SENSORS_GL520SM=m
 CONFIG_SENSORS_HDAPS=m
 # CONFIG_SENSORS_I5K_AMB is not set
+# FIXME: IBMAEM x86 only?
+CONFIG_SENSORS_IBMAEM=m
 CONFIG_SENSORS_IBMPEX=m
 CONFIG_SENSORS_IT87=m
 CONFIG_SENSORS_K8TEMP=m
@@ -1980,6 +2005,7 @@
 CONFIG_RTC_DRV_DS1742=m
 CONFIG_RTC_DRV_DS1374=m
 # CONFIG_RTC_DRV_EP93XX is not set
+CONFIG_RTC_DRV_FM3130=m
 CONFIG_RTC_DRV_ISL1208=m
 CONFIG_RTC_DRV_M41T80=m
 CONFIG_RTC_DRV_M41T80_WDT=y
@@ -2047,7 +2073,7 @@
 CONFIG_VIDEO_DEV=m
 # CONFIG_VIDEO_ADV_DEBUG is not set
 # CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
-CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_ALLOW_V4L1=y
 CONFIG_VIDEO_V4L1_COMPAT=y
 CONFIG_VIDEO_V4L2=y
 # CONFIG_VIDEO_VIVI is not set
@@ -2063,6 +2089,7 @@
 CONFIG_VIDEO_CAPTURE_DRIVERS=y
 CONFIG_VIDEO_ADV7170=m
 CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_AU0828=m
 CONFIG_VIDEO_BT819=m
 CONFIG_VIDEO_BT848=m
 CONFIG_VIDEO_BT848_DVB=y
@@ -2080,6 +2107,7 @@
 CONFIG_VIDEO_CX25840=m
 CONFIG_VIDEO_CX2341X=m
 CONFIG_VIDEO_CX23885=m
+CONFIG_VIDEO_CX18=m
 CONFIG_VIDEO_CX88=m
 CONFIG_VIDEO_CX88_DVB=m
 CONFIG_VIDEO_CX88_ALSA=m
@@ -2088,6 +2116,7 @@
 CONFIG_VIDEO_DPC=m
 CONFIG_VIDEO_EM28XX=m
 CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
 CONFIG_VIDEO_HEXIUM_ORION=m
 CONFIG_VIDEO_HEXIUM_GEMINI=m
 CONFIG_VIDEO_IVTV=m
@@ -2097,6 +2126,7 @@
 CONFIG_VIDEO_MXB=m
 CONFIG_VIDEO_OVCAMCHIP=m
 CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_PVRUSB2_DVB=y
 CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR=y
 CONFIG_VIDEO_PVRUSB2_ONAIR_USB2=y
 CONFIG_VIDEO_SAA5246A=m
@@ -2150,6 +2180,8 @@
 CONFIG_RADIO_MAXIRADIO=m
 CONFIG_RADIO_MAESTRO=m
 
+CONFIG_MEDIA_ATTACH=y
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
 
 #
 # Digital Video Broadcasting Devices
@@ -2163,11 +2195,13 @@
 #
 # Supported Frontend Modules
 #
+CONFIG_DVB_AU8522=m
 CONFIG_DVB_STV0299=m
 # CONFIG_DVB_SP887X is not set
 CONFIG_DVB_BT8XX=m
 CONFIG_DVB_BUDGET_CORE=m
 CONFIG_DVB_CX24110=m
+CONFIG_DVB_ISL6405=m
 CONFIG_DVB_L64781=m
 CONFIG_DVB_LGDT330X=m
 CONFIG_DVB_MT312=m
@@ -2265,6 +2299,7 @@
 
 CONFIG_FB=y
 CONFIG_VIDEO_SELECT=y
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 CONFIG_FB_3DFX=m
 CONFIG_FB_3DFX_ACCEL=y
 # CONFIG_FB_ARC is not set
@@ -2384,7 +2419,7 @@
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
 CONFIG_SND_MTS64=m
-# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_SERIAL_U16550=m
 CONFIG_SND_MPU401=m
 CONFIG_SND_PORTMAN2X4=m
 CONFIG_SND_AC97_POWER_SAVE=y
@@ -2408,6 +2443,7 @@
 CONFIG_SND_AU8810=m
 CONFIG_SND_AU8820=m
 CONFIG_SND_AU8830=m
+CONFIG_SND_AW2=m
 CONFIG_SND_AZT3328=m
 CONFIG_SND_BT87X=m
 # CONFIG_SND_BT87X_OVERCLOCK is not set
@@ -2454,6 +2490,7 @@
 CONFIG_SND_NM256=m
 CONFIG_SND_OXYGEN=m
 CONFIG_SND_RME32=m
+# CONFIG_SND_PCSP is not set
 CONFIG_SND_PCXHR=m
 CONFIG_SND_RIPTIDE=m
 CONFIG_SND_RME96=m
@@ -2528,9 +2565,11 @@
 #
 CONFIG_USB_ACM=m
 CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
 # CONFIG_BLK_DEV_UB is not set
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_CYPRESS_ATACB=y
 CONFIG_USB_STORAGE_DATAFAB=y
 CONFIG_USB_STORAGE_FREECOM=y
 CONFIG_USB_STORAGE_ISD200=y
@@ -2558,6 +2597,7 @@
 CONFIG_HID_FF=y
 CONFIG_HID_PID=y
 CONFIG_LOGITECH_FF=y
+CONFIG_LOGIRUMBLEPAD2_FF=y
 CONFIG_PANTHERLORD_FF=y
 CONFIG_THRUSTMASTER_FF=y
 CONFIG_ZEROPLUS_FF=y
@@ -2674,6 +2714,7 @@
 CONFIG_USB_SERIAL_MCT_U232=m
 CONFIG_USB_SERIAL_MOS7720=m
 CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
 CONFIG_USB_SERIAL_NAVMAN=m
 CONFIG_USB_SERIAL_OPTION=y
 CONFIG_USB_SERIAL_OTI6858=m
@@ -2682,6 +2723,7 @@
 CONFIG_USB_SERIAL_SAFE=m
 CONFIG_USB_SERIAL_SAFE_PADDED=y
 CONFIG_USB_SERIAL_SIERRAWIRELESS=y
+CONFIG_USB_SERIAL_SPCP8X5=m
 CONFIG_USB_SERIAL_TI=m
 CONFIG_USB_SERIAL_VISOR=m
 CONFIG_USB_SERIAL_WHITEHEAT=m
@@ -2706,6 +2748,7 @@
 CONFIG_USB_AUERSWALD=m
 CONFIG_USB_BERRY_CHARGE=m
 CONFIG_USB_CXACRU=m
+# CONFIG_USB_C67X00_HCD is not set
 # CONFIG_USB_CYTHERM is not set
 CONFIG_USB_EMI26=m
 CONFIG_USB_ETH=m
@@ -2717,8 +2760,10 @@
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGETFS is not set
 # CONFIG_USB_HIDINPUT_POWERBOOK is not set
-CONFIG_USB_ISP116X_HCD=m
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_IOWARRIOR=m
+CONFIG_USB_ISIGHTFW=m
 CONFIG_USB_LCD=m
 CONFIG_USB_LD=m
 CONFIG_USB_LEGOTOWER=m
@@ -2793,6 +2838,7 @@
 CONFIG_JFS_POSIX_ACL=y
 CONFIG_JFS_SECURITY=y
 CONFIG_XFS_FS=m
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_XFS_RT is not set
 CONFIG_XFS_QUOTA=y
 CONFIG_XFS_POSIX_ACL=y
@@ -2924,6 +2970,8 @@
 CONFIG_OCFS2_FS=m
 # CONFIG_OCFS2_DEBUG_FS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
+CONFIG_OCFS2_FS_O2CB=m
+CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 CONFIG_CONFIGFS_FS=m
 
 CONFIG_DLM=m
@@ -3009,6 +3057,7 @@
 # Kernel hacking
 #
 CONFIG_DEBUG_KERNEL=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_INFO=y
 CONFIG_FRAME_POINTER=y
@@ -3023,6 +3072,11 @@
 # CONFIG_DEBUG_LOCKDEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 
+CONFIG_KGDB=y
+CONFIG_KGDB_SERIAL_CONSOLE=y
+CONFIG_KGDB_TESTS=y
+# CONFIG_KGDB_TESTS_ON_BOOT is not set
+
 # These debug options are deliberatly left on.
 # They aren't that much of a performance impact, and the value
 # from getting out-of-tree modules fixed is worth the trade-off.
@@ -3080,6 +3134,7 @@
 CONFIG_CRYPTO_CCM=m
 CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_DES=m
 CONFIG_CRYPTO_ECB=m
@@ -3159,6 +3214,7 @@
 # CONFIG_CGROUP_DEBUG is not set
 CONFIG_CGROUP_NS=y
 CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_DEVICE=y
 CONFIG_PROC_PID_CPUSET=y
 
 # CONFIG_SYSFS_DEPRECATED is not set
@@ -3362,6 +3418,7 @@
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_IDE_DISK=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
 
 CONFIG_DMA_ENGINE=y
 CONFIG_NET_DMA=y
@@ -3400,6 +3457,7 @@
 
 CONFIG_UIO=m
 CONFIG_UIO_CIF=m
+CONFIG_UIO_SMX=m
 
 CONFIG_INSTRUMENTATION=y
 CONFIG_MARKERS=y
@@ -3471,3 +3529,13 @@
 CONFIG_MEMSTICK_TIFM_MS=m
 CONFIG_MEMSTICK_JMICRON_38X=m
 
+CONFIG_ACCESSIBILITY=y
+CONFIG_A11Y_BRAILLE_CONSOLE=y
+
+# CONFIG_HTC_PASIC3 is not set
+
+CONFIG_SOC_CAMERA=m
+CONFIG_SOC_CAMERA_MT9M001=m
+CONFIG_SOC_CAMERA_MT9V022=m
+# MT9V022_PCA9536_SWITCH is not set
+


Index: config-ia64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-ia64-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-ia64-generic	6 Mar 2008 13:59:25 -0000	1.3
+++ config-ia64-generic	16 Jun 2008 10:19:26 -0000	1.4
@@ -193,3 +193,11 @@
 CONFIG_SENSORS_I5K_AMB=m
 
 CONFIG_SPARSEMEM_VMEMMAP=y
+
+CONFIG_FRAME_WARN=2048
+
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_SGI_XP=m
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m


Index: config-nodebug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-nodebug,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- config-nodebug	14 Apr 2008 16:06:53 -0000	1.5
+++ config-nodebug	16 Jun 2008 10:19:26 -0000	1.6
@@ -3,31 +3,40 @@
 CONFIG_SND_DEBUG_DETECT=y
 CONFIG_SND_PCM_XRUN_DEBUG=y
 
-# CONFIG_DEBUG_IGNORE_QUIET is not set
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_DEBUG_LOCK_ALLOC is not set
-# CONFIG_PROVE_LOCKING is not set
-# CONFIG_DEBUG_VM is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-
-# CONFIG_FAULT_INJECTION is not set
-# CONFIG_FAILSLAB is not set
-# CONFIG_FAIL_PAGE_ALLOC is not set
-# CONFIG_FAIL_MAKE_REQUEST is not set
-# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
-# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_VM=y
+CONFIG_DEBUG_SPINLOCK=y
+
+CONFIG_FAULT_INJECTION=y
+CONFIG_FAILSLAB=y
+CONFIG_FAIL_PAGE_ALLOC=y
+CONFIG_FAIL_MAKE_REQUEST=y
+CONFIG_FAULT_INJECTION_DEBUG_FS=y
+CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
 
-# CONFIG_SLUB_DEBUG_ON is not set
+CONFIG_SLUB_DEBUG_ON=y
 
-# CONFIG_LOCK_STAT is not set
+CONFIG_LOCK_STAT=y
 
-# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_STACK_USAGE=y
 
 # CONFIG_ACPI_DEBUG is not set
 
-# CONFIG_DEBUG_SG is not set
+CONFIG_DEBUG_SG=y
 
-# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUG_PAGEALLOC=y
 
-# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEBUG=y
+
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_OBJECTS=y
+# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
+CONFIG_DEBUG_OBJECTS_FREE=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+
+CONFIG_X86_PTDUMP=y
+
+CONFIG_CAN_DEBUG_DEVICES=y


Index: config-powerpc-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc-generic,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-powerpc-generic	1 Apr 2008 10:38:06 -0000	1.4
+++ config-powerpc-generic	16 Jun 2008 10:19:26 -0000	1.5
@@ -189,7 +189,6 @@
 CONFIG_MTD_PHYSMAP_OF=m
 CONFIG_IDE_PROC_FS=y
 CONFIG_MACINTOSH_DRIVERS=y
-# CONFIG_DEBUG_PAGEALLOC is not set
 
 CONFIG_PPC_PASEMI_MDIO=m
 CONFIG_SPU_FS_64K_LS=y


Index: config-powerpc32-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc32-generic,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-powerpc32-generic	1 Apr 2008 10:38:06 -0000	1.4
+++ config-powerpc32-generic	16 Jun 2008 10:19:26 -0000	1.5
@@ -82,6 +82,7 @@
 CONFIG_FEC_MPC52xx=m
 #CHECK: This may later become a tristate.
 CONFIG_FEC_MPC52xx_MDIO=y
+CONFIG_PPC_MPC5200_GPIO=y
 
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_DEBUG_STACKOVERFLOW=y
@@ -103,3 +104,17 @@
 CONFIG_PPC_BESTCOMM_FEC=m
 CONFIG_PPC_BESTCOMM_GEN_BD=m
 
+CONFIG_FORCE_MAX_ZONEORDER=11
+# CONFIG_PAGE_OFFSET_BOOL is not set
+CONFIG_BLK_DEV_HD_ONLY=y
+# CONFIG_FB_FSL_DIU is not set
+CONFIG_IRQSTACKS=y
+CONFIG_VIRTUALIZATION=y
+
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_HTC_EGPIO is not set
+
+# PPC gets sad with debug alloc (bz 448598)
+# CONFIG_DEBUG_PAGEALLOC is not set


Index: config-powerpc64
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc64,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-powerpc64	1 Apr 2008 10:38:06 -0000	1.4
+++ config-powerpc64	16 Jun 2008 10:19:26 -0000	1.5
@@ -35,6 +35,7 @@
 CONFIG_SND_PS3_DEFAULT_START_DELAY=1000
 CONFIG_GELIC_NET=m
 CONFIG_GELIC_WIRELESS=y
+CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE=y
 CONFIG_CBE_THERM=m
 CONFIG_CBE_CPUFREQ=m
 CONFIG_CBE_CPUFREQ_PMI=m
@@ -155,3 +156,10 @@
 CONFIG_SPU_TRACE=m
 CONFIG_MTD_NAND_PASEMI=m
 CONFIG_EDAC_CELL=m
+CONFIG_FRAME_WARN=2048
+
+CONFIG_PHYP_DUMP=y
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_BLK_DEV_HD_ONLY=y
+CONFIG_VIRTUALIZATION=y
+


Index: config-s390x
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-s390x,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-s390x	6 Mar 2008 13:59:25 -0000	1.3
+++ config-s390x	16 Jun 2008 10:19:26 -0000	1.4
@@ -197,4 +197,15 @@
 CONFIG_S390_VMUR=m
 
 # CONFIG_THERMAL is not set
-# CONFIG_DEBUG_PAGEALLOC is not set
+
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PAGE_STATES=y
+CONFIG_CTCM=m
+CONFIG_QETH_L2=m
+CONFIG_QETH_L3=m
+CONFIG_CRYPTO_SHA512_S390=m
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_S390_GUEST=y
+


Index: config-sparc64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-sparc64-generic,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-sparc64-generic	1 Apr 2008 10:38:06 -0000	1.4
+++ config-sparc64-generic	16 Jun 2008 10:19:26 -0000	1.5
@@ -183,3 +183,8 @@
 CONFIG_SPARSEMEM_VMEMMAP=y
 
 # CONFIG_THERMAL is not set
+
+CONFIG_FRAME_WARN=2048
+
+CONFIG_NUMA=y
+


Index: config-x86-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-x86-generic,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config-x86-generic	2 Apr 2008 08:55:25 -0000	1.4
+++ config-x86-generic	16 Jun 2008 10:19:26 -0000	1.5
@@ -67,17 +67,20 @@
 CONFIG_X86_MSR=m
 CONFIG_X86_CPUID=m
 CONFIG_EDD=m
+# CONFIG_EDD_OFF is not set
 # CONFIG_NUMA is not set
 CONFIG_HIGHMEM=y
 CONFIG_HIGHPTE=y
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MTRR=y
+CONFIG_X86_PAT=y
 CONFIG_X86_PM_TIMER=y
 
 CONFIG_EFI=y
 CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
 CONFIG_FB_EFI=y
+# CONFIG_FB_N411 is not set
 
 # CONFIG_PCI_GOBIOS is not set
 # CONFIG_PCI_GODIRECT is not set
@@ -212,13 +215,10 @@
 CONFIG_4KSTACKS=y
 CONFIG_DEBUG_NMI_TIMEOUT=5
 
-# CONFIG_DEBUG_PAGEALLOC is not set
-
 CONFIG_PCI_DIRECT=y
 CONFIG_PCI_MMCONFIG=y
 CONFIG_PCI_BIOS=y
-CONFIG_DMAR=y
-CONFIG_DMAR_GFX_WA=y
+# CONFIG_DMAR is not set
 
 CONFIG_HOTPLUG_PCI=y
 CONFIG_HOTPLUG_PCI_COMPAQ=m
@@ -304,10 +304,10 @@
 # CONFIG_SGI_IOC4 is not set
 
 CONFIG_ASUS_LAPTOP=m
-CONFIG_EEEPC=m
 CONFIG_FUJITSU_LAPTOP=m
 CONFIG_MSI_LAPTOP=m
 CONFIG_SONY_LAPTOP=m
+CONFIG_EEEPC_LAPTOP=m
 
 # CONFIG_SMSC37B787_WDT is not set
 CONFIG_W83697HF_WDT=m
@@ -327,6 +327,9 @@
 CONFIG_KVM=m
 CONFIG_KVM_INTEL=m
 CONFIG_KVM_AMD=m
+CONFIG_KVM_CLOCK=y
+CONFIG_KVM_GUEST=y
+CONFIG_KVM_TRACE=y
 
 CONFIG_MTD_ESB2ROM=m
 CONFIG_MTD_CK804XROM=m
@@ -347,6 +350,8 @@
 CONFIG_MACINTOSH_DRIVERS=y
 
 CONFIG_DMIID=y
+CONFIG_ISCSI_IBFT_FIND=y
+CONFIG_ISCSI_IBFT=m
 
 CONFIG_VIRTUALIZATION=y
 CONFIG_PARAVIRT_GUEST=y
@@ -365,3 +370,9 @@
 # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
 
 CONFIG_HP_WATCHDOG=m
+
+CONFIG_OLPC=y
+CONFIG_BATTERY_OLPC=m
+
+CONFIG_NONPROMISC_DEVMEM=y
+


Index: config-x86_64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-x86_64-generic,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- config-x86_64-generic	8 May 2008 08:57:47 -0000	1.6
+++ config-x86_64-generic	16 Jun 2008 10:19:26 -0000	1.7
@@ -25,10 +25,10 @@
 CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
 CONFIG_X86_PM_TIMER=y
 CONFIG_EDD=m
+# CONFIG_EDD_OFF is not set
 CONFIG_PCI_BIOS=y
 CONFIG_PCI_MMCONFIG=y
-CONFIG_DMAR=y
-CONFIG_DMAR_GFX_WA=y
+# CONFIG_DMAR is not set
 
 CONFIG_EFI=y
 CONFIG_EFI_VARS=y
@@ -97,11 +97,11 @@
 CONFIG_ACPI_PROC_EVENT=y
 
 CONFIG_ASUS_LAPTOP=m
-CONFIG_EEEPC=m
 CONFIG_FUJITSU_LAPTOP=m
 CONFIG_MSI_LAPTOP=m
 CONFIG_SONY_LAPTOP=m
 CONFIG_SONYPI_COMPAT=y
+# CONFIG_EEEPC_LAPTOP is not set
 
 CONFIG_THINKPAD_ACPI=m
 # CONFIG_THINKPAD_ACPI_DEBUG is not set
@@ -224,6 +224,7 @@
 CONFIG_KVM=m
 CONFIG_KVM_INTEL=m
 CONFIG_KVM_AMD=m
+CONFIG_KVM_TRACE=y
 
 CONFIG_MTD_ESB2ROM=m
 CONFIG_MTD_CK804XROM=m
@@ -236,6 +237,9 @@
 CONFIG_PROC_VMCORE=y
 
 CONFIG_DMIID=y
+CONFIG_ISCSI_IBFT_FIND=y
+CONFIG_ISCSI_IBFT=m
+
 
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -257,3 +261,16 @@
 # CONFIG_CPA_DEBUG is not set
 
 CONFIG_HP_WATCHDOG=m
+
+CONFIG_FRAME_WARN=2048
+
+CONFIG_MEMTEST_BOOTPARAM=y
+CONFIG_MEMTEST_BOOTPARAM_VALUE=0
+CONFIG_NODES_SHIFT=9
+CONFIG_X86_PAT=y
+# FIXME: These should be 32bit only
+# CONFIG_FB_N411 is not set
+CONFIG_NONPROMISC_DEVMEM=y
+
+CONFIG_DIRECT_GBPAGES=y
+


Index: config-xen-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-xen-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-xen-generic	6 Mar 2008 13:59:25 -0000	1.3
+++ config-xen-generic	16 Jun 2008 10:19:26 -0000	1.4
@@ -4,6 +4,8 @@
 CONFIG_XEN_BLKDEV_FRONTEND=m
 CONFIG_XEN_NETDEV_FRONTEND=m
 
+
 # We need this for console, so compile in
-CONFIG_XEN_FBDEV_FRONTEND=y
 CONFIG_XEN_KBDDEV_FRONTEND=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- kernel.spec	29 May 2008 16:13:09 -0000	1.45
+++ kernel.spec	16 Jun 2008 10:19:26 -0000	1.46
@@ -3,7 +3,7 @@
 # For a stable, released kernel, released_kernel should be 1. For rawhide
 # and/or a kernel built from an rc or git snapshot, released_kernel should
 # be 0.
-%define released_kernel 1
+%define released_kernel 0
 
 # Versions of various parts
 
@@ -20,7 +20,7 @@
 # kernel spec when the kernel is rebased, so fedora_build automatically
 # works out to the offset from the rebase, so it doesn't get too ginormous.
 #
-%define fedora_cvs_origin 41
+%define fedora_cvs_origin 45
 %define fedora_build %(R="$Revision$"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -31,7 +31,7 @@
 ## If this is a released kernel ##
 %if 0%{?released_kernel}
 # Do we have a 2.6.21.y update to apply?
-%define stable_update 2
+%define stable_update 3
 # Set rpm version accordingly
 %if 0%{?stable_update}
 %define stablerev .%{stable_update}
@@ -43,9 +43,9 @@
 # The next upstream release sublevel (base_sublevel+1)
 %define upstream_sublevel %(expr %{base_sublevel} + 1)
 # The rc snapshot level
-%define rcrev 0
+%define rcrev 6
 # The git snapshot level
-%define gitrev 0
+%define gitrev 2
 # Set rpm version accordingly
 %define rpmversion 2.6.%{upstream_sublevel}
 %endif
@@ -71,15 +71,15 @@
 # kernel-kdump
 %define with_kdump     %{?_without_kdump:     0} %{?!_without_kdump:     1}
 # kernel-debug
-%define with_debug     %{?_without_debug:     0} %{!?_without_debug:     1}
+%define with_debug     %{?_without_debug:     0} %{?!_without_debug:     1}
 # kernel-doc
 %define with_doc       %{?_without_doc:       0} %{?!_without_doc:       1}
 # kernel-headers
 %define with_headers   %{?_without_headers:   0} %{?!_without_headers:   1}
 # kernel-debuginfo
-%define with_debuginfo %{?_without_debuginfo: 0} %{!?_without_debuginfo: 1}
+%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
 # kernel-bootwrapper (for creating zImages from kernel + initrd)
-%define with_bootwrapper %{?_without_bootwrapper: 0} %{!?_without_bootwrapper: 1}
+%define with_bootwrapper %{?_without_bootwrapper: 0} %{?!_without_bootwrapper: 1}
 
 # Additional options for user-friendly one-off kernel building:
 #
@@ -104,7 +104,7 @@
 # Set debugbuildsenabled to 1 for production (build separate debug kernels)
 #  and 0 for rawhide (all kernels are debug kernels).
 # See also 'make debug' and 'make release'.
-%define debugbuildsenabled 1
+%define debugbuildsenabled 0
 
 # Want to build a vanilla kernel build without any non-upstream patches?
 # (well, almost none, we need nonintconfig for build purposes). Default to 0 (off).
@@ -473,6 +473,7 @@
 BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
 BuildRequires: bzip2, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
 BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config
+BuildRequires: net-tools
 %if %{with_doc}
 BuildRequires: xmlto
 %endif
@@ -574,7 +575,7 @@
 
 # we also need compile fixes for -vanilla
 Patch07: linux-2.6-compile-fixes.patch
-Patch08: linux-2.6-compile-fix-gcc-43.patch
+#Patch08: linux-2.6-compile-fix-gcc-43.patch
 
 %if !%{nopatches}
 
@@ -585,58 +586,55 @@
 Patch41: linux-2.6-sysrq-c.patch
 Patch42: linux-2.6-x86-tune-generic.patch
 Patch75: linux-2.6-x86-debug-boot.patch
-Patch80: linux-2.6-smp-boot-delay.patch
 
-Patch123: linux-2.6-ppc-rtc.patch
 Patch140: linux-2.6-ps3-ehci-iso.patch
 Patch141: linux-2.6-ps3-storage-alias.patch
 Patch142: linux-2.6-ps3-legacy-bootloader-hack.patch
 Patch143: linux-2.6-g5-therm-shutdown.patch
 Patch144: linux-2.6-vio-modalias.patch
-Patch145: linux-2.6-windfarm-pm121.patch
-Patch146: linux-2.6-windfarm-pm121-fix.patch
 Patch147: linux-2.6-imac-transparent-bridge.patch
 Patch148: linux-2.6-powerpc-zImage-32MiB.patch
 Patch149: linux-2.6-efika-not-chrp.patch
 
-Patch150: linux-2.6.25-sparc64-semctl.patch
-
 Patch160: linux-2.6-execshield.patch
 Patch250: linux-2.6-debug-sizeof-structs.patch
 Patch260: linux-2.6-debug-nmi-timeout.patch
 Patch270: linux-2.6-debug-taint-vm.patch
 Patch280: linux-2.6-debug-spinlock-taint.patch
-Patch330: linux-2.6-debug-no-quiet.patch
 Patch340: linux-2.6-debug-vm-would-have-oomkilled.patch
-Patch350: linux-2.6-devmem.patch
 Patch370: linux-2.6-crash-driver.patch
 Patch380: linux-2.6-defaults-pci_no_msi.patch
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
 Patch402: linux-2.6-scsi-mpt-vmware-fix.patch
 Patch410: linux-2.6-alsa-kill-annoying-messages.patch
+Patch411: linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch
 Patch420: linux-2.6-squashfs.patch
 Patch430: linux-2.6-net-silence-noisy-printks.patch
+Patch440: linux-2.6-net-8139-pio-modparam.patch
+Patch441: linux-2.6-net-8139-pio-oqo2.patch
 Patch450: linux-2.6-input-kill-stupid-messages.patch
 Patch460: linux-2.6-serial-460800.patch
 Patch510: linux-2.6-silence-noise.patch
+Patch520: linux-2.6-silence-x86-decompressor.patch
+Patch530: linux-2.6-silence-fbcon-logo.patch
 Patch570: linux-2.6-selinux-mprotect-checks.patch
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
 Patch610: linux-2.6-defaults-fat-utf8.patch
 Patch670: linux-2.6-ata-quirk.patch
 Patch671: linux-2.6-libata-force-hardreset-in-sleep-mode.patch
-Patch672: linux-2.6-libata-ata_piix-check-sidpr.patch
 
 Patch680: linux-2.6-wireless.patch
 Patch681: linux-2.6-wireless-pending.patch
-Patch682: linux-2.6-wireless-pending-too.patch
-Patch683: linux-2.6-rt2x00-configure_filter.patch
 Patch690: linux-2.6-at76.patch
 
 Patch700: linux-2.6-nfs-client-mounts-hang.patch
 
-Patch750: linux-2.6-md-fix-oops-in-rdev_attr_store.patch
-
-# SELinux patches, will go upstream in .26
+# SELinux patches, will go upstream in .27
+Patch800: linux-2.6-selinux-deffered-context-mapping.patch
+Patch801: linux-2.6-selinux-deffered-context-mapping-no-sleep.patch
+Patch802: linux-2.6-selinux-generic-ioctl.patch
+Patch803: linux-2.6-selinux-new-proc-checks.patch
+Patch804: linux-2.6-selinux-get-invalid-xattrs.patch
 #
 
 Patch1101: linux-2.6-default-mmf_dump_elf_headers.patch
@@ -662,21 +660,11 @@
 # atl2 network driver
 Patch2020: linux-2.6-netdev-atl2.patch
 
-# ext4 patches
-Patch2100: linux-2.6-ext4-stable-queue.patch
-
-# linux1394 git patches
-Patch2200: linux-2.6-firewire-git-update.patch
-Patch2201: linux-2.6-firewire-git-pending.patch
-
 # make USB EHCI driver respect "nousb" parameter
 Patch2300: linux-2.6-usb-ehci-hcd-respect-nousb.patch
 # Fix HID usage descriptor on MS wireless desktop receiver
 Patch2301: linux-2.6-ms-wireless-receiver.patch
 
-# acpi hotkey driver for asus eeepc
-Patch2350: linux-2.6-acpi-eeepc-hotkey.patch
-
 # usb video
 Patch2400: linux-2.6-uvcvideo.patch
 
@@ -685,172 +673,169 @@
 # get rid of imacfb and make efifb work everywhere it was used
 Patch2600: linux-2.6-merge-efifb-imacfb.patch
 
-Patch3000: linux-2.6-25.3-queue.patch
-
 # kernel-xen patches start
 Patch5000: linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
 Patch5001: linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
 Patch5002: linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
-Patch5003: linux-2.6-xen-0004-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
-Patch5004: linux-2.6-xen-0005-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-Patch5005: linux-2.6-xen-0006-xen-Enable-Xen-console-by-default-in-domU.patch
-Patch5006: linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
-Patch5007: linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-Patch5008: linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-Patch5009: linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
-Patch5010: linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
-Patch5011: linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
-Patch5012: linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
-Patch5013: linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
-Patch5014: linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
-Patch5015: linux-2.6-xen-0016-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-Patch5016: linux-2.6-xen-0017-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
-Patch5017: linux-2.6-xen-0018-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch
-Patch5018: linux-2.6-xen-0019-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch
-Patch5019: linux-2.6-xen-0020-x86_64-Expose-set_pte_vaddr.patch
-Patch5020: linux-2.6-xen-0021-x86_64-Split-set_pte_vaddr.patch
-Patch5021: linux-2.6-xen-0022-x86_64-Add-clear_fixmap.patch
-Patch5022: linux-2.6-xen-0023-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch
-Patch5023: linux-2.6-xen-0024-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch
-Patch5024: linux-2.6-xen-0025-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch
-Patch5025: linux-2.6-xen-0026-DMI-Define-dmi_scan_machine-as-no-op-if-CONFIG_DM.patch
-Patch5026: linux-2.6-xen-0027-ACPI-thermal-Compile-without-CONFIG_DMI.patch
-Patch5027: linux-2.6-xen-0028-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch
-Patch5028: linux-2.6-xen-0029-xen-x86_64-Add-update_va_mapping-64-bit-code.patch
-Patch5029: linux-2.6-xen-0030-x86_64-Add-sync_cmpxchg.patch
-Patch5030: linux-2.6-xen-0031-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch
-Patch5031: linux-2.6-xen-0032-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch
-Patch5032: linux-2.6-xen-0033-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch
-Patch5033: linux-2.6-xen-0034-Better-implementation-of-pte-functions.patch
-Patch5034: linux-2.6-xen-0035-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch
-Patch5035: linux-2.6-xen-0036-Add-gate_offset-and-gate_segment-macros.patch
-Patch5036: linux-2.6-xen-0037-xen_write_idt_entry-and-cvt_gate_to_trap.patch
-Patch5037: linux-2.6-xen-0038-typedefs-for-pte_val-and-friends.patch
-Patch5038: linux-2.6-xen-0039-x86_64-implementation-of-some-page.h-macros.patch
-Patch5039: linux-2.6-xen-0040-Chainsaw-style-ifdefs.patch
-Patch5040: linux-2.6-xen-0041-xen-Make-xen_pte_val-generic.patch
-Patch5041: linux-2.6-xen-0042-More-chainsaw-ifdefs.patch
-Patch5042: linux-2.6-xen-0043-Chainsaw-ifdefs-on-assembly-percpu-handling.patch
-Patch5043: linux-2.6-xen-0044-x86_64-percpu-assembly-macros.patch
-Patch5044: linux-2.6-xen-0045-Some-xen-asm.S-x86_64-code.patch
-Patch5045: linux-2.6-xen-0046-Chainsaw-party-SPLITME.patch
-Patch5046: linux-2.6-xen-0047-xen-asm.S-x86_64-notes.patch
-Patch5047: linux-2.6-xen-0048-xen-x86_64-Make-hypercall-assembly-code-work.patch
-Patch5048: linux-2.6-xen-0049-xen-x86_64-pda-initialization.patch
-Patch5049: linux-2.6-xen-0050-Disable-discover_ebda-under-paravirt.patch
-Patch5050: linux-2.6-xen-0051-Disable-early_printk-by-default.patch
-Patch5051: linux-2.6-xen-0052-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch
-Patch5052: linux-2.6-xen-0053-Set-__PAGE_OFFSET-as-required-by-Xen.patch
-Patch5053: linux-2.6-xen-0054-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch
-Patch5054: linux-2.6-xen-0055-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch
-Patch5055: linux-2.6-xen-0056-Use-__pgd-on-mk_kernel_pgd.patch
-Patch5056: linux-2.6-xen-0057-Include-user-page-tables-on-head_64.S.patch
-Patch5057: linux-2.6-xen-0058-Avoid-using-mk_unsigned_long.patch
-Patch5058: linux-2.6-xen-0059-Lots-of-unrelated-changes.patch
-Patch5059: linux-2.6-xen-0060-Hack-disable-vsmp.patch
-Patch5060: linux-2.6-xen-0061-Export-early_make_page_readonly.patch
-Patch5061: linux-2.6-xen-0062-Disable-multicalls.c-too-verbose-debugging.patch
-Patch5062: linux-2.6-xen-0063-Xen-64-bit-ready-MMU-operations.patch
-Patch5063: linux-2.6-xen-0064-Some-xen-mmu-pv-ops-implemented.patch
-Patch5064: linux-2.6-xen-0065-Trying-to-make-the-pagetable-initialization-code-wor.patch
-Patch5065: linux-2.6-xen-0066-Xen-specific-find_early_table_space-FIXME.patch
-Patch5066: linux-2.6-xen-0067-Xen-call-e820_print_map-when-setting-up-memory.patch
-Patch5067: linux-2.6-xen-0068-Comment-debugging-msgs.patch
-Patch5068: linux-2.6-xen-0069-Try-to-make-pagetables-read-only.patch
-Patch5069: linux-2.6-xen-0070-Debug-dump-pgtables-on-make_page_readonly.patch
-Patch5070: linux-2.6-xen-0071-Disable-apic-at-compile-time-FIXME.patch
-Patch5071: linux-2.6-xen-0072-Parse-early-params-after-init_memory_mapping.patch
-Patch5072: linux-2.6-xen-0073-xen-Move-addr_to_page-to-init.h.patch
-Patch5073: linux-2.6-xen-0074-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch
-Patch5074: linux-2.6-xen-0075-Pull-xen_finish_init_mappin-from-XS-upstream.patch
-Patch5075: linux-2.6-xen-0076-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch
-Patch5076: linux-2.6-xen-0077-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch
-Patch5077: linux-2.6-xen-0078-New-enum-fixed_addresses-values-REVIEWME.patch
-Patch5078: linux-2.6-xen-0079-Reserve-bootmem-areas-used-by-Xen-FIXME.patch
-Patch5079: linux-2.6-xen-0080-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch
-Patch5080: linux-2.6-xen-0081-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch
-Patch5081: linux-2.6-xen-0082-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch
-Patch5082: linux-2.6-xen-0083-Handle-Xen-exception-stack-it-is-different-from-bar.patch
-Patch5083: linux-2.6-xen-0084-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch
-Patch5084: linux-2.6-xen-0085-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch
-Patch5085: linux-2.6-xen-0086-Implement-asm-xen_iret.patch
-Patch5086: linux-2.6-xen-0087-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch
-Patch5087: linux-2.6-xen-0088-Implement-xen_irqenable_syscall_ret.patch
-Patch5088: linux-2.6-xen-0089-DEBUG-xen_iret-always-return-through-the-hyperviso.patch
-Patch5089: linux-2.6-xen-0090-Implement-some-xen-callbacks-on-xen-entry_64.S.patch
-Patch5090: linux-2.6-xen-0091-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch
-Patch5091: linux-2.6-xen-0092-Disable-syscall32-code-temporarily-FIXME.patch
-Patch5092: linux-2.6-xen-0093-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch
-Patch5093: linux-2.6-xen-0094-Use-apic_xen-on-genapic-by-default-FIXME.patch
-Patch5094: linux-2.6-xen-0095-irq-vector-ifdef-chainsaw-FIXME.patch
-Patch5095: linux-2.6-xen-0096-ifdef-chainsaw-on-syscall_init-FIXME.patch
-Patch5096: linux-2.6-xen-0097-Pull-xen-genapic-implementation-from-upstream-Xen.patch
-Patch5097: linux-2.6-xen-0098-Debugging-printk-s.patch
-Patch5098: linux-2.6-xen-0099-Leave-lazy_cpu_mode-on-__switch_to.patch
-Patch5099: linux-2.6-xen-0100-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch
-Patch5100: linux-2.6-xen-0101-Disable-vcpu_info_placement-temporarily-FIXME.patch
-Patch5101: linux-2.6-xen-0102-Fix-typo-on-ifdef-again.patch
-Patch5102: linux-2.6-xen-0103-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch
-Patch5103: linux-2.6-xen-0104-Make-load_gs_index-a-paravirt-operation.patch
-Patch5104: linux-2.6-xen-0105-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch
-Patch5105: linux-2.6-xen-0106-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch
-Patch5106: linux-2.6-xen-0107-xen-pgd_walk-accept-start-parameter.patch
-Patch5107: linux-2.6-xen-0108-xen-64-reserve_bootmem-xen_start_info-area.patch
-Patch5108: linux-2.6-xen-0109-pvops-64-call-paravirt_post_allocator_init-on-set.patch
-Patch5109: linux-2.6-xen-0110-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch
-Patch5110: linux-2.6-xen-0111-xen-64-implement-xen_load_gs_index.patch
-Patch5111: linux-2.6-xen-0112-include-asm-x86-pgalloc_64.h-pvops-hacks-SPLITME.patch
-Patch5112: linux-2.6-xen-0113-Multi-pagetable-write_cr3-implementation-FIXME.patch
-Patch5113: linux-2.6-xen-0114-Disable-the-weird-count-loop-on-kcons_write_dom0.patch
-Patch5114: linux-2.6-xen-0115-Make-xen_start_info-read-only.patch
-Patch5115: linux-2.6-xen-0116-Hack-to-implement-return-to-userspace-without-SWAPGS.patch
-Patch5116: linux-2.6-xen-0117-Xen-SEGBASE_-defines.patch
-Patch5117: linux-2.6-xen-0118-Xen-HYPERVISOR_set_segment_base-implementation.patch
-Patch5118: linux-2.6-xen-0119-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch
-Patch5119: linux-2.6-xen-0120-Comment-e820_print_map-call-TEMPORARY.patch
-Patch5120: linux-2.6-xen-0121-Xen-missing-includes.patch
-Patch5121: linux-2.6-xen-0122-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch
-Patch5122: linux-2.6-xen-0123-asm-x86-pgtable.h-include-asm-page.h.patch
-Patch5123: linux-2.6-xen-0124-fix-pxxval_t-usage-on-mm-init_64.c.patch
-Patch5124: linux-2.6-xen-0125-Missing-Xen-include.patch
-Patch5125: linux-2.6-xen-0126-un-static-ipi_to_irq.patch
-Patch5126: linux-2.6-xen-0127-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch
-Patch5127: linux-2.6-xen-0128-Trying-to-organize-the-xen-bootmem-allocation-mess.patch
-Patch5128: linux-2.6-xen-0129-Xen-reserve_bootmem-xenstore-and-console-interfac.patch
-Patch5129: linux-2.6-xen-0130-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch
-Patch5130: linux-2.6-xen-0131-Xen-64-bit-support-on-xen_pgd_pin.patch
-Patch5131: linux-2.6-xen-0132-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch
-Patch5132: linux-2.6-xen-0133-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.patch
-Patch5133: linux-2.6-xen-0134-Xen-Add-a-order-parameter-to-pgd_walk.patch
-Patch5134: linux-2.6-xen-0135-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch
-Patch5135: linux-2.6-xen-0136-Use-un-pin_page-when-un-pinning-pgd.patch
-Patch5136: linux-2.6-xen-0137-Allow-enabling-Xen-on-x86_64.patch
-Patch5137: linux-2.6-xen-0138-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch
-Patch5138: linux-2.6-xen-0139-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch
-Patch5139: linux-2.6-xen-0140-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch
-Patch5140: linux-2.6-xen-0141-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch
-Patch5141: linux-2.6-xen-0142-Create-xen-specific-syscall-entry.patch
-Patch5142: linux-2.6-xen-0143-syscall-related-Xen-ifdefs-FIXME.patch
-Patch5143: linux-2.6-xen-0144-Point-set_pte-to-xen_set_pte-since-the-beginning.patch
-Patch5144: linux-2.6-xen-0145-DEBUG-slab-debugging.patch
-Patch5145: linux-2.6-xen-0146-pvops-64-Include-rsi-on-the-register-clobber-list.patch
-Patch5146: linux-2.6-xen-0147-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch
-Patch5147: linux-2.6-xen-0148-Add-missing-acpi-include-to-xen-setup.c.patch
-Patch5148: linux-2.6-xen-0149-Don-t-use-FIX_VDSO-on-64-bit.patch
-Patch5149: linux-2.6-xen-0150-Mark-init-pages-read-write-again-on-free_init_pages.patch
-Patch5150: linux-2.6-xen-0151-reserve_early-kernel-text-and-data-segments.patch
-Patch5151: linux-2.6-xen-0152-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
-Patch5152: linux-2.6-xen-0153-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch
-Patch5153: linux-2.6-xen-0154-Pull-xen_failsafe_callback-implementation-from-XenSo.patch
-Patch5154: linux-2.6-xen-0155-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch
-Patch5155: linux-2.6-xen-0156-xen-64-Clear-fs-on-xen_load_tls.patch
-Patch5156: linux-2.6-xen-0157-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch
-Patch5157: linux-2.6-xen-0158-Introduce-xen_ia32_syscall.patch
-Patch5158: linux-2.6-xen-0159-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch
-Patch5159: linux-2.6-xen-0160-Make-the-int80-and-syscall-vdso32-implementations-se.patch
-Patch5160: linux-2.6-xen-0161-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch
-Patch5161: linux-2.6-xen-0162-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch
-Patch5162: linux-2.6-xen-0163-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch
+Patch5003: linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch
+Patch5004: linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch
+Patch5005: linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch
+Patch5006: linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch
+Patch5007: linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch
+Patch5008: linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch
+Patch5009: linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch
+Patch5010: linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+Patch5011: linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+Patch5012: linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch
+Patch5013: linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch
+Patch5014: linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch
+Patch5015: linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch
+Patch5016: linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch
+Patch5017: linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch
+Patch5018: linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch
+Patch5019: linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch
+Patch5020: linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch
+Patch5021: linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch
+Patch5022: linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch
+Patch5023: linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch
+Patch5024: linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch
+Patch5025: linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch
+Patch5026: linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch
+Patch5027: linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch
+Patch5028: linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch
+Patch5029: linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch
+Patch5030: linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch
+Patch5031: linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch
+Patch5032: linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch
+Patch5033: linux-2.6-xen-0034-More-chainsaw-ifdefs.patch
+Patch5034: linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch
+Patch5035: linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch
+Patch5036: linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch
+Patch5037: linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch
+Patch5038: linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch
+Patch5039: linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch
+Patch5040: linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch
+Patch5041: linux-2.6-xen-0042-Disable-early_printk-by-default.patch
+Patch5042: linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch
+Patch5043: linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch
+Patch5044: linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch
+Patch5045: linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch
+Patch5046: linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch
+Patch5047: linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch
+Patch5048: linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch
+Patch5049: linux-2.6-xen-0050-Lots-of-unrelated-changes.patch
+Patch5050: linux-2.6-xen-0051-Hack-disable-vsmp.patch
+Patch5051: linux-2.6-xen-0052-Export-early_make_page_readonly.patch
+Patch5052: linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch
+Patch5053: linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch
+Patch5054: linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch
+Patch5055: linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch
+Patch5056: linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch
+Patch5057: linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch
+Patch5058: linux-2.6-xen-0059-Comment-debugging-msgs.patch
+Patch5059: linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch
+Patch5060: linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch
+Patch5061: linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch
+Patch5062: linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch
+Patch5063: linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch
+Patch5064: linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch
+Patch5065: linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch
+Patch5066: linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch
+Patch5067: linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch
+Patch5068: linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch
+Patch5069: linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch
+Patch5070: linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch
+Patch5071: linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch
+Patch5072: linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch
+Patch5073: linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch
+Patch5074: linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch
+Patch5075: linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch
+Patch5076: linux-2.6-xen-0077-Implement-asm-xen_iret.patch
+Patch5077: linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch
+Patch5078: linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch
+Patch5079: linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch
+Patch5080: linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch
+Patch5081: linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch
+Patch5082: linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch
+Patch5083: linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch
+Patch5084: linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch
+Patch5085: linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch
+Patch5086: linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch
+Patch5087: linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch
+Patch5088: linux-2.6-xen-0089-Debugging-printk-s.patch
+Patch5089: linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch
+Patch5090: linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch
+Patch5091: linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch
+Patch5092: linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch
+Patch5093: linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch
+Patch5094: linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch
+Patch5095: linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch
+Patch5096: linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch
+Patch5097: linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch
+Patch5098: linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch
+Patch5099: linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch
+Patch5100: linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch
+Patch5101: linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch
+Patch5102: linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch
+Patch5103: linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch
+Patch5104: linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch
+Patch5105: linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch
+Patch5106: linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch
+Patch5107: linux-2.6-xen-0108-Make-xen_start_info-read-only.patch
+Patch5108: linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch
+Patch5109: linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch
+Patch5110: linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch
+Patch5111: linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch
+Patch5112: linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch
+Patch5113: linux-2.6-xen-0114-Xen-missing-includes.patch
+Patch5114: linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch
+Patch5115: linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch
+Patch5116: linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch
+Patch5117: linux-2.6-xen-0118-Missing-Xen-include.patch
+Patch5118: linux-2.6-xen-0119-un-static-ipi_to_irq.patch
+Patch5119: linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch
+Patch5120: linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch
+Patch5121: linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch
+Patch5122: linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch
+Patch5123: linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch
+Patch5124: linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch
+Patch5125: linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch
+Patch5126: linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch
+Patch5127: linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch
+Patch5128: linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch
+Patch5129: linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch
+Patch5130: linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch
+Patch5131: linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch
+Patch5132: linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch
+Patch5133: linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch
+Patch5134: linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch
+Patch5135: linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch
+Patch5136: linux-2.6-xen-0137-DEBUG-slab-debugging.patch
+Patch5137: linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch
+Patch5138: linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch
+Patch5139: linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch
+Patch5140: linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch
+Patch5141: linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch
+Patch5142: linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch
+Patch5143: linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
+Patch5144: linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch
+Patch5145: linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch
+Patch5146: linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch
+Patch5147: linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch
+Patch5148: linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch
+Patch5149: linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch
+Patch5150: linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch
+Patch5151: linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch
+Patch5152: linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch
+Patch5153: linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch
+Patch5154: linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch
+Patch5155: linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch
+Patch5156: linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch
+Patch5157: linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch
+Patch5158: linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch
+Patch5159: linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch
+Patch5160: linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch
+Patch5161: linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch
 # kernel-xen patches end
 
 # Xen hypervisor patches (20000+)
@@ -1210,7 +1195,7 @@
 fi
 
 # build with gcc43
-ApplyPatch linux-2.6-compile-fix-gcc-43.patch
+#ApplyPatch linux-2.6-compile-fix-gcc-43.patch
 
 %if !%{nopatches}
 
@@ -1218,7 +1203,7 @@
 
 # Roland's utrace ptrace replacement.
 %ifnarch ia64
-ApplyPatch linux-2.6-utrace.patch
+#ApplyPatch linux-2.6-utrace.patch
 %endif
 
 # enable sysrq-c on all kernels, not only kexec
@@ -1228,44 +1213,35 @@
 # x86(-64)
 # Compile 686 kernels tuned for Pentium4.
 ApplyPatch linux-2.6-x86-tune-generic.patch
-# Delay longer during boot on x86 while waiting for secondary processors
-ApplyPatch linux-2.6-smp-boot-delay.patch
 
 #
 # PowerPC
 #
-###  UPSTREAM PATCHES FROM 2.6.26 (we think):
-# RTC class driver for ppc_md rtc functions
-ApplyPatch linux-2.6-ppc-rtc.patch
 ### NOT (YET) UPSTREAM:
 # The EHCI ISO patch isn't yet upstream but is needed to fix reboot
-ApplyPatch linux-2.6-ps3-ehci-iso.patch
+#ApplyPatch linux-2.6-ps3-ehci-iso.patch
 # Fixes some wireless optical mice
-ApplyPatch linux-2.6-ms-wireless-receiver.patch
+#ApplyPatch linux-2.6-ms-wireless-receiver.patch
 # The storage alias patch is Fedora-local, and allows the old 'ps3_storage'
 # module name to work on upgrades. Otherwise, I believe mkinitrd will fail
 # to pull the module in,
 ApplyPatch linux-2.6-ps3-storage-alias.patch
 # Support booting from Sony's original released 2.6.16-based kboot
-ApplyPatch linux-2.6-ps3-legacy-bootloader-hack.patch
+#ApplyPatch linux-2.6-ps3-legacy-bootloader-hack.patch
 # Alleviate G5 thermal shutdown problems
 ApplyPatch linux-2.6-g5-therm-shutdown.patch
 # Provide modalias in sysfs for vio devices
 ApplyPatch linux-2.6-vio-modalias.patch
-# Fan support on iMac G5 iSight
-ApplyPatch linux-2.6-windfarm-pm121.patch
-ApplyPatch linux-2.6-windfarm-pm121-fix.patch
 # Work around PCIe bridge setup on iSight
 ApplyPatch linux-2.6-imac-transparent-bridge.patch
 # Link zImage at 32MiB (for POWER machines, Efika)
 ApplyPatch linux-2.6-powerpc-zImage-32MiB.patch
 # Don't show 'CHRP' in /proc/cpuinfo on Efika
-ApplyPatch linux-2.6-efika-not-chrp.patch
+#ApplyPatch linux-2.6-efika-not-chrp.patch
 
 #
 # SPARC64
 #
-ApplyPatch linux-2.6.25-sparc64-semctl.patch
 
 #
 # Exec shield
@@ -1280,25 +1256,15 @@
 ApplyPatch linux-2.6-usb-ehci-hcd-respect-nousb.patch
 
 # ACPI
-# eeepc hotkey support
-ApplyPatch linux-2.6-acpi-eeepc-hotkey.patch
 
 # Various low-impact patches to aid debugging.
 ApplyPatch linux-2.6-debug-sizeof-structs.patch
 ApplyPatch linux-2.6-debug-nmi-timeout.patch
 ApplyPatch linux-2.6-debug-taint-vm.patch
 ApplyPatch linux-2.6-debug-spinlock-taint.patch
-%if !%{debugbuildsenabled}
-ApplyPatch linux-2.6-debug-no-quiet.patch
-%endif
 ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
 
 #
-# Make /dev/mem a need-to-know function
-#
-ApplyPatch linux-2.6-devmem.patch
-
-#
 # /dev/crash driver for the crashdump analysis tool
 #
 ApplyPatch linux-2.6-crash-driver.patch
@@ -1320,6 +1286,10 @@
 # ALSA
 #
 ApplyPatch linux-2.6-alsa-kill-annoying-messages.patch
+# In upstream alsa. Resolves issues with glitch-free pulseaudio on hda-intel.
+# See: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-May/001837.html
+#      http://mailman.alsa-project.org/pipermail/alsa-devel/2008-May/007856.html
+ApplyPatch linux-2.6-hda-intel-fix-dma-position-inaccuracy.patch
 
 # Filesystem patches.
 # Squashfs
@@ -1328,6 +1298,10 @@
 # Networking
 # Disable easy to trigger printk's.
 ApplyPatch linux-2.6-net-silence-noisy-printks.patch
+# Make 8139too PIO/MMIO a module parameter
+ApplyPatch linux-2.6-net-8139-pio-modparam.patch
+# OQO2 needs PIO
+ApplyPatch linux-2.6-net-8139-pio-oqo2.patch
 
 # Misc fixes
 # The input layer spews crap no-one cares about.
@@ -1338,6 +1312,12 @@
 # Silence some useless messages that still get printed with 'quiet'
 ApplyPatch linux-2.6-silence-noise.patch
 
+# Make the real mode boot decompressor understand and honor 'quiet'
+ApplyPatch linux-2.6-silence-x86-decompressor.patch
+
+# Make fbcon not show the penguins with 'quiet'
+ApplyPatch linux-2.6-silence-fbcon-logo.patch
+
 # Fix the SELinux mprotect checks on executable mappings
 ApplyPatch linux-2.6-selinux-mprotect-checks.patch
 # Fix SELinux for sparc
@@ -1351,29 +1331,28 @@
 ApplyPatch linux-2.6-ata-quirk.patch
 # wake up links that have been put to sleep by BIOS (#436099)
 ApplyPatch linux-2.6-libata-force-hardreset-in-sleep-mode.patch
-# fix broken drive detection on some macbooks (#439398)
-ApplyPatch linux-2.6-libata-ata_piix-check-sidpr.patch
 
-# wireless patches headed for 2.6.25
-#ApplyPatch linux-2.6-wireless.patch
+# Allow selinux to defer validation of contexts, aka: rpm can write illegal labels
+ApplyPatch linux-2.6-selinux-deffered-context-mapping.patch
+ApplyPatch linux-2.6-selinux-deffered-context-mapping-no-sleep.patch
+ApplyPatch linux-2.6-selinux-generic-ioctl.patch
+ApplyPatch linux-2.6-selinux-new-proc-checks.patch
+ApplyPatch linux-2.6-selinux-get-invalid-xattrs.patch
+
 # wireless patches headed for 2.6.26
+ApplyPatch linux-2.6-wireless.patch
+# wireless patches headed for 2.6.27
 ApplyPatch linux-2.6-wireless-pending.patch
-ApplyPatch linux-2.6-wireless-pending-too.patch
-# rt2x00 configure_filter fix to avoid endless loop on insert for USB devices
-ApplyPatch linux-2.6-rt2x00-configure_filter.patch
 
 # Add misc wireless bits from upstream wireless tree
 ApplyPatch linux-2.6-at76.patch
 
 # implement smarter atime updates support.
-ApplyPatch linux-2.6-smarter-relatime.patch
+#ApplyPatch linux-2.6-smarter-relatime.patch
 
 # NFS Client mounts hang when exported directory do not exist
 ApplyPatch linux-2.6-nfs-client-mounts-hang.patch
 
-# fix oops in mdraid (#441765)
-ApplyPatch linux-2.6-md-fix-oops-in-rdev_attr_store.patch
-
 # build id related enhancements
 ApplyPatch linux-2.6-default-mmf_dump_elf_headers.patch
 
@@ -1384,38 +1363,34 @@
 
 ApplyPatch linux-2.6-sata-eeepc-faster.patch
 
-ApplyPatch linux-2.6-netdev-atl2.patch
+#ApplyPatch linux-2.6-netdev-atl2.patch
 
 # Nouveau DRM + drm fixes
-ApplyPatch linux-2.6-drm-git-mm.patch
-ApplyPatch nouveau-drm.patch
-ApplyPatch nouveau-drm-update.patch
-ApplyPatch linux-2.6-drm-i915-modeset.patch
-ApplyPatch linux-2.6-drm-radeon-fix-oops.patch
-ApplyPatch linux-2.6-drm-radeon-fix-oops2.patch
-ApplyPatch linux-2.6-drm-modesetting-oops-fixes.patch
-ApplyPatch linux-2.6-drm-fix-master-perm.patch
+#ApplyPatch linux-2.6-drm-git-mm.patch
+#ApplyPatch nouveau-drm.patch
+#ApplyPatch nouveau-drm-update.patch
+#ApplyPatch linux-2.6-drm-i915-modeset.patch
+#ApplyPatch linux-2.6-drm-radeon-fix-oops.patch
+#ApplyPatch linux-2.6-drm-radeon-fix-oops2.patch
+#ApplyPatch linux-2.6-drm-modesetting-oops-fixes.patch
+#ApplyPatch linux-2.6-drm-fix-master-perm.patch
 
 # ext4dev stable patch queue, slated for 2.6.25
 #ApplyPatch linux-2.6-ext4-stable-queue.patch
 
 # linux1394 git patches
-ApplyPatch linux-2.6-firewire-git-update.patch
-C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-firewire-git-pending.patch | awk '{print $1}')
-if [ "$C" -gt 10 ]; then
-ApplyPatch linux-2.6-firewire-git-pending.patch
-fi
+#C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-firewire-git-pending.patch | awk '{print $1}')
+#if [ "$C" -gt 10 ]; then
+#ApplyPatch linux-2.6-firewire-git-pending.patch
+#fi
 
 # usb video
-ApplyPatch linux-2.6-uvcvideo.patch
+#ApplyPatch linux-2.6-uvcvideo.patch
 
 ApplyPatch linux-2.6-ppc-use-libgcc.patch
 
 # get rid of imacfb and make efifb work everywhere it was used
-ApplyPatch linux-2.6-merge-efifb-imacfb.patch
-
-# 2.6.25.3 queue (minus one MD patch we already have)
-ApplyPatch linux-2.6-25.3-queue.patch
+#ApplyPatch linux-2.6-merge-efifb-imacfb.patch
 
 # ---------- below all scheduled for 2.6.24 -----------------
 
@@ -1423,167 +1398,166 @@
 ApplyPatch linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
 ApplyPatch linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
 ApplyPatch linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
-ApplyPatch linux-2.6-xen-0004-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
-ApplyPatch linux-2.6-xen-0005-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-ApplyPatch linux-2.6-xen-0006-xen-Enable-Xen-console-by-default-in-domU.patch
-ApplyPatch linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-ApplyPatch linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
-ApplyPatch linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
-ApplyPatch linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
-ApplyPatch linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
-ApplyPatch linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
-ApplyPatch linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
+ApplyPatch linux-2.6-xen-0004-xen-Enable-Xen-console-by-default-in-domU.patch
+ApplyPatch linux-2.6-xen-0005-xen-Add-a-vmlinuz-target.patch
+ApplyPatch linux-2.6-xen-0006-xen-Add-empty-xenctrl-module.patch
+ApplyPatch linux-2.6-xen-0007-xen-Add-proc-xen-capabilities.patch
+ApplyPatch linux-2.6-xen-0008-xen-Add-proc-xen-privcmd.patch
+ApplyPatch linux-2.6-xen-0009-xen-Add-proc-xen-xenbus.patch
+ApplyPatch linux-2.6-xen-0010-xen-Add-Xen-s-sys-hypervisor-interface.patch
+ApplyPatch linux-2.6-xen-0011-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+ApplyPatch linux-2.6-xen-0012-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
 %ifarch x86_64
-ApplyPatch linux-2.6-xen-0016-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-ApplyPatch linux-2.6-xen-0017-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
-ApplyPatch linux-2.6-xen-0018-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch
-ApplyPatch linux-2.6-xen-0019-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch
-ApplyPatch linux-2.6-xen-0020-x86_64-Expose-set_pte_vaddr.patch
-ApplyPatch linux-2.6-xen-0021-x86_64-Split-set_pte_vaddr.patch
-ApplyPatch linux-2.6-xen-0022-x86_64-Add-clear_fixmap.patch
-ApplyPatch linux-2.6-xen-0023-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch
-ApplyPatch linux-2.6-xen-0024-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch
-ApplyPatch linux-2.6-xen-0025-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch
-ApplyPatch linux-2.6-xen-0026-DMI-Define-dmi_scan_machine-as-no-op-if-CONFIG_DM.patch
-ApplyPatch linux-2.6-xen-0027-ACPI-thermal-Compile-without-CONFIG_DMI.patch
-ApplyPatch linux-2.6-xen-0028-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch
-ApplyPatch linux-2.6-xen-0029-xen-x86_64-Add-update_va_mapping-64-bit-code.patch
-ApplyPatch linux-2.6-xen-0030-x86_64-Add-sync_cmpxchg.patch
-ApplyPatch linux-2.6-xen-0031-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch
-ApplyPatch linux-2.6-xen-0032-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch
-ApplyPatch linux-2.6-xen-0033-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch
-ApplyPatch linux-2.6-xen-0034-Better-implementation-of-pte-functions.patch
-ApplyPatch linux-2.6-xen-0035-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch
-ApplyPatch linux-2.6-xen-0036-Add-gate_offset-and-gate_segment-macros.patch
-ApplyPatch linux-2.6-xen-0037-xen_write_idt_entry-and-cvt_gate_to_trap.patch
-ApplyPatch linux-2.6-xen-0038-typedefs-for-pte_val-and-friends.patch
-ApplyPatch linux-2.6-xen-0039-x86_64-implementation-of-some-page.h-macros.patch
-ApplyPatch linux-2.6-xen-0040-Chainsaw-style-ifdefs.patch
-ApplyPatch linux-2.6-xen-0041-xen-Make-xen_pte_val-generic.patch
-ApplyPatch linux-2.6-xen-0042-More-chainsaw-ifdefs.patch
-ApplyPatch linux-2.6-xen-0043-Chainsaw-ifdefs-on-assembly-percpu-handling.patch
-ApplyPatch linux-2.6-xen-0044-x86_64-percpu-assembly-macros.patch
-ApplyPatch linux-2.6-xen-0045-Some-xen-asm.S-x86_64-code.patch
-ApplyPatch linux-2.6-xen-0046-Chainsaw-party-SPLITME.patch
-ApplyPatch linux-2.6-xen-0047-xen-asm.S-x86_64-notes.patch
-ApplyPatch linux-2.6-xen-0048-xen-x86_64-Make-hypercall-assembly-code-work.patch
-ApplyPatch linux-2.6-xen-0049-xen-x86_64-pda-initialization.patch
-ApplyPatch linux-2.6-xen-0050-Disable-discover_ebda-under-paravirt.patch
-ApplyPatch linux-2.6-xen-0051-Disable-early_printk-by-default.patch
-ApplyPatch linux-2.6-xen-0052-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch
-ApplyPatch linux-2.6-xen-0053-Set-__PAGE_OFFSET-as-required-by-Xen.patch
-ApplyPatch linux-2.6-xen-0054-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch
-ApplyPatch linux-2.6-xen-0055-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch
-ApplyPatch linux-2.6-xen-0056-Use-__pgd-on-mk_kernel_pgd.patch
-ApplyPatch linux-2.6-xen-0057-Include-user-page-tables-on-head_64.S.patch
-ApplyPatch linux-2.6-xen-0058-Avoid-using-mk_unsigned_long.patch
-ApplyPatch linux-2.6-xen-0059-Lots-of-unrelated-changes.patch
-ApplyPatch linux-2.6-xen-0060-Hack-disable-vsmp.patch
-ApplyPatch linux-2.6-xen-0061-Export-early_make_page_readonly.patch
-ApplyPatch linux-2.6-xen-0062-Disable-multicalls.c-too-verbose-debugging.patch
-ApplyPatch linux-2.6-xen-0063-Xen-64-bit-ready-MMU-operations.patch
-ApplyPatch linux-2.6-xen-0064-Some-xen-mmu-pv-ops-implemented.patch
-ApplyPatch linux-2.6-xen-0065-Trying-to-make-the-pagetable-initialization-code-wor.patch
-ApplyPatch linux-2.6-xen-0066-Xen-specific-find_early_table_space-FIXME.patch
-ApplyPatch linux-2.6-xen-0067-Xen-call-e820_print_map-when-setting-up-memory.patch
-ApplyPatch linux-2.6-xen-0068-Comment-debugging-msgs.patch
-ApplyPatch linux-2.6-xen-0069-Try-to-make-pagetables-read-only.patch
-ApplyPatch linux-2.6-xen-0070-Debug-dump-pgtables-on-make_page_readonly.patch
-ApplyPatch linux-2.6-xen-0071-Disable-apic-at-compile-time-FIXME.patch
-ApplyPatch linux-2.6-xen-0072-Parse-early-params-after-init_memory_mapping.patch
-ApplyPatch linux-2.6-xen-0073-xen-Move-addr_to_page-to-init.h.patch
-ApplyPatch linux-2.6-xen-0074-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch
-ApplyPatch linux-2.6-xen-0075-Pull-xen_finish_init_mappin-from-XS-upstream.patch
-ApplyPatch linux-2.6-xen-0076-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch
-ApplyPatch linux-2.6-xen-0077-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch
-ApplyPatch linux-2.6-xen-0078-New-enum-fixed_addresses-values-REVIEWME.patch
-ApplyPatch linux-2.6-xen-0079-Reserve-bootmem-areas-used-by-Xen-FIXME.patch
-ApplyPatch linux-2.6-xen-0080-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch
-ApplyPatch linux-2.6-xen-0081-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch
-ApplyPatch linux-2.6-xen-0082-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch
-ApplyPatch linux-2.6-xen-0083-Handle-Xen-exception-stack-it-is-different-from-bar.patch
-ApplyPatch linux-2.6-xen-0084-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch
-ApplyPatch linux-2.6-xen-0085-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch
-ApplyPatch linux-2.6-xen-0086-Implement-asm-xen_iret.patch
-ApplyPatch linux-2.6-xen-0087-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch
-ApplyPatch linux-2.6-xen-0088-Implement-xen_irqenable_syscall_ret.patch
-ApplyPatch linux-2.6-xen-0089-DEBUG-xen_iret-always-return-through-the-hyperviso.patch
-ApplyPatch linux-2.6-xen-0090-Implement-some-xen-callbacks-on-xen-entry_64.S.patch
-ApplyPatch linux-2.6-xen-0091-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch
-ApplyPatch linux-2.6-xen-0092-Disable-syscall32-code-temporarily-FIXME.patch
-ApplyPatch linux-2.6-xen-0093-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch
-ApplyPatch linux-2.6-xen-0094-Use-apic_xen-on-genapic-by-default-FIXME.patch
-ApplyPatch linux-2.6-xen-0095-irq-vector-ifdef-chainsaw-FIXME.patch
-ApplyPatch linux-2.6-xen-0096-ifdef-chainsaw-on-syscall_init-FIXME.patch
-ApplyPatch linux-2.6-xen-0097-Pull-xen-genapic-implementation-from-upstream-Xen.patch
-ApplyPatch linux-2.6-xen-0098-Debugging-printk-s.patch
-ApplyPatch linux-2.6-xen-0099-Leave-lazy_cpu_mode-on-__switch_to.patch
-ApplyPatch linux-2.6-xen-0100-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch
-ApplyPatch linux-2.6-xen-0101-Disable-vcpu_info_placement-temporarily-FIXME.patch
-ApplyPatch linux-2.6-xen-0102-Fix-typo-on-ifdef-again.patch
-ApplyPatch linux-2.6-xen-0103-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch
-ApplyPatch linux-2.6-xen-0104-Make-load_gs_index-a-paravirt-operation.patch
-ApplyPatch linux-2.6-xen-0105-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch
-ApplyPatch linux-2.6-xen-0106-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch
-ApplyPatch linux-2.6-xen-0107-xen-pgd_walk-accept-start-parameter.patch
-ApplyPatch linux-2.6-xen-0108-xen-64-reserve_bootmem-xen_start_info-area.patch
-ApplyPatch linux-2.6-xen-0109-pvops-64-call-paravirt_post_allocator_init-on-set.patch
-ApplyPatch linux-2.6-xen-0110-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch
-ApplyPatch linux-2.6-xen-0111-xen-64-implement-xen_load_gs_index.patch
-ApplyPatch linux-2.6-xen-0112-include-asm-x86-pgalloc_64.h-pvops-hacks-SPLITME.patch
-ApplyPatch linux-2.6-xen-0113-Multi-pagetable-write_cr3-implementation-FIXME.patch
-ApplyPatch linux-2.6-xen-0114-Disable-the-weird-count-loop-on-kcons_write_dom0.patch
-ApplyPatch linux-2.6-xen-0115-Make-xen_start_info-read-only.patch
-ApplyPatch linux-2.6-xen-0116-Hack-to-implement-return-to-userspace-without-SWAPGS.patch
-ApplyPatch linux-2.6-xen-0117-Xen-SEGBASE_-defines.patch
-ApplyPatch linux-2.6-xen-0118-Xen-HYPERVISOR_set_segment_base-implementation.patch
-ApplyPatch linux-2.6-xen-0119-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch
-ApplyPatch linux-2.6-xen-0120-Comment-e820_print_map-call-TEMPORARY.patch
-ApplyPatch linux-2.6-xen-0121-Xen-missing-includes.patch
-ApplyPatch linux-2.6-xen-0122-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch
-ApplyPatch linux-2.6-xen-0123-asm-x86-pgtable.h-include-asm-page.h.patch
-ApplyPatch linux-2.6-xen-0124-fix-pxxval_t-usage-on-mm-init_64.c.patch
-ApplyPatch linux-2.6-xen-0125-Missing-Xen-include.patch
-ApplyPatch linux-2.6-xen-0126-un-static-ipi_to_irq.patch
-ApplyPatch linux-2.6-xen-0127-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch
-ApplyPatch linux-2.6-xen-0128-Trying-to-organize-the-xen-bootmem-allocation-mess.patch
-ApplyPatch linux-2.6-xen-0129-Xen-reserve_bootmem-xenstore-and-console-interfac.patch
-ApplyPatch linux-2.6-xen-0130-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch
-ApplyPatch linux-2.6-xen-0131-Xen-64-bit-support-on-xen_pgd_pin.patch
-ApplyPatch linux-2.6-xen-0132-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch
-ApplyPatch linux-2.6-xen-0133-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.patch
-ApplyPatch linux-2.6-xen-0134-Xen-Add-a-order-parameter-to-pgd_walk.patch
-ApplyPatch linux-2.6-xen-0135-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch
-ApplyPatch linux-2.6-xen-0136-Use-un-pin_page-when-un-pinning-pgd.patch
-ApplyPatch linux-2.6-xen-0137-Allow-enabling-Xen-on-x86_64.patch
-ApplyPatch linux-2.6-xen-0138-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch
-ApplyPatch linux-2.6-xen-0139-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch
-ApplyPatch linux-2.6-xen-0140-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch
-ApplyPatch linux-2.6-xen-0141-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch
-ApplyPatch linux-2.6-xen-0142-Create-xen-specific-syscall-entry.patch
-ApplyPatch linux-2.6-xen-0143-syscall-related-Xen-ifdefs-FIXME.patch
-ApplyPatch linux-2.6-xen-0144-Point-set_pte-to-xen_set_pte-since-the-beginning.patch
-ApplyPatch linux-2.6-xen-0145-DEBUG-slab-debugging.patch
-ApplyPatch linux-2.6-xen-0146-pvops-64-Include-rsi-on-the-register-clobber-list.patch
-ApplyPatch linux-2.6-xen-0147-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch
-ApplyPatch linux-2.6-xen-0148-Add-missing-acpi-include-to-xen-setup.c.patch
-ApplyPatch linux-2.6-xen-0149-Don-t-use-FIX_VDSO-on-64-bit.patch
-ApplyPatch linux-2.6-xen-0150-Mark-init-pages-read-write-again-on-free_init_pages.patch
-ApplyPatch linux-2.6-xen-0151-reserve_early-kernel-text-and-data-segments.patch
-ApplyPatch linux-2.6-xen-0152-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
-ApplyPatch linux-2.6-xen-0153-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch
-ApplyPatch linux-2.6-xen-0154-Pull-xen_failsafe_callback-implementation-from-XenSo.patch
-ApplyPatch linux-2.6-xen-0155-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch
-ApplyPatch linux-2.6-xen-0156-xen-64-Clear-fs-on-xen_load_tls.patch
-ApplyPatch linux-2.6-xen-0157-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch
-ApplyPatch linux-2.6-xen-0158-Introduce-xen_ia32_syscall.patch
-ApplyPatch linux-2.6-xen-0159-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch
-ApplyPatch linux-2.6-xen-0160-Make-the-int80-and-syscall-vdso32-implementations-se.patch
-ApplyPatch linux-2.6-xen-0161-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch
-ApplyPatch linux-2.6-xen-0162-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch
-ApplyPatch linux-2.6-xen-0163-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch
+ApplyPatch linux-2.6-xen-0013-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch
+ApplyPatch linux-2.6-xen-0014-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch
+ApplyPatch linux-2.6-xen-0015-x86_64-Expose-set_pte_vaddr.patch
+ApplyPatch linux-2.6-xen-0016-x86_64-Split-set_pte_vaddr.patch
+ApplyPatch linux-2.6-xen-0017-x86_64-Add-clear_fixmap.patch
+ApplyPatch linux-2.6-xen-0018-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch
+ApplyPatch linux-2.6-xen-0019-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch
+ApplyPatch linux-2.6-xen-0020-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch
+ApplyPatch linux-2.6-xen-0021-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch
+ApplyPatch linux-2.6-xen-0022-xen-x86_64-Add-update_va_mapping-64-bit-code.patch
+ApplyPatch linux-2.6-xen-0023-x86_64-Add-sync_cmpxchg.patch
+ApplyPatch linux-2.6-xen-0024-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch
+ApplyPatch linux-2.6-xen-0025-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch
+ApplyPatch linux-2.6-xen-0026-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch
+ApplyPatch linux-2.6-xen-0027-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch
+ApplyPatch linux-2.6-xen-0028-Add-gate_offset-and-gate_segment-macros.patch
+ApplyPatch linux-2.6-xen-0029-xen_write_idt_entry-and-cvt_gate_to_trap.patch
+ApplyPatch linux-2.6-xen-0030-typedefs-for-pte_val-and-friends.patch
+ApplyPatch linux-2.6-xen-0031-x86_64-implementation-of-some-page.h-macros.patch
+ApplyPatch linux-2.6-xen-0032-Chainsaw-style-ifdefs.patch
+ApplyPatch linux-2.6-xen-0033-xen-Make-xen_pte_val-generic.patch
+ApplyPatch linux-2.6-xen-0034-More-chainsaw-ifdefs.patch
+ApplyPatch linux-2.6-xen-0035-Chainsaw-ifdefs-on-assembly-percpu-handling.patch
+ApplyPatch linux-2.6-xen-0036-x86_64-percpu-assembly-macros.patch
+ApplyPatch linux-2.6-xen-0037-Some-xen-asm.S-x86_64-code.patch
+ApplyPatch linux-2.6-xen-0038-Chainsaw-party-SPLITME.patch
+ApplyPatch linux-2.6-xen-0039-xen-asm.S-x86_64-notes.patch
+ApplyPatch linux-2.6-xen-0040-xen-x86_64-Make-hypercall-assembly-code-work.patch
+ApplyPatch linux-2.6-xen-0041-xen-x86_64-pda-initialization.patch
+ApplyPatch linux-2.6-xen-0042-Disable-early_printk-by-default.patch
+ApplyPatch linux-2.6-xen-0043-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch
+ApplyPatch linux-2.6-xen-0044-Set-__PAGE_OFFSET-as-required-by-Xen.patch
+ApplyPatch linux-2.6-xen-0045-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch
+ApplyPatch linux-2.6-xen-0046-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch
+ApplyPatch linux-2.6-xen-0047-Use-__pgd-on-mk_kernel_pgd.patch
+ApplyPatch linux-2.6-xen-0048-Include-user-page-tables-on-head_64.S.patch
+ApplyPatch linux-2.6-xen-0049-Avoid-using-mk_unsigned_long.patch
+ApplyPatch linux-2.6-xen-0050-Lots-of-unrelated-changes.patch
+ApplyPatch linux-2.6-xen-0051-Hack-disable-vsmp.patch
+ApplyPatch linux-2.6-xen-0052-Export-early_make_page_readonly.patch
+ApplyPatch linux-2.6-xen-0053-Disable-multicalls.c-too-verbose-debugging.patch
+ApplyPatch linux-2.6-xen-0054-Xen-64-bit-ready-MMU-operations.patch
+ApplyPatch linux-2.6-xen-0055-Some-xen-mmu-pv-ops-implemented.patch
+ApplyPatch linux-2.6-xen-0056-Trying-to-make-the-pagetable-initialization-code-wor.patch
+ApplyPatch linux-2.6-xen-0057-Xen-specific-find_early_table_space-FIXME.patch
+ApplyPatch linux-2.6-xen-0058-Xen-call-e820_print_map-when-setting-up-memory.patch
+ApplyPatch linux-2.6-xen-0059-Comment-debugging-msgs.patch
+ApplyPatch linux-2.6-xen-0060-Try-to-make-pagetables-read-only.patch
+ApplyPatch linux-2.6-xen-0061-Debug-dump-pgtables-on-make_page_readonly.patch
+ApplyPatch linux-2.6-xen-0062-Disable-apic-at-compile-time-FIXME.patch
+ApplyPatch linux-2.6-xen-0063-Parse-early-params-after-init_memory_mapping.patch
+ApplyPatch linux-2.6-xen-0064-xen-Move-addr_to_page-to-init.h.patch
+ApplyPatch linux-2.6-xen-0065-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch
+ApplyPatch linux-2.6-xen-0066-Pull-xen_finish_init_mappin-from-XS-upstream.patch
+ApplyPatch linux-2.6-xen-0067-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch
+ApplyPatch linux-2.6-xen-0068-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch
+ApplyPatch linux-2.6-xen-0069-New-enum-fixed_addresses-values-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0070-Reserve-bootmem-areas-used-by-Xen-FIXME.patch
+ApplyPatch linux-2.6-xen-0071-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch
+ApplyPatch linux-2.6-xen-0072-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch
+ApplyPatch linux-2.6-xen-0073-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0074-Handle-Xen-exception-stack-it-is-different-from-bar.patch
+ApplyPatch linux-2.6-xen-0075-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch
+ApplyPatch linux-2.6-xen-0076-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch
+ApplyPatch linux-2.6-xen-0077-Implement-asm-xen_iret.patch
+ApplyPatch linux-2.6-xen-0078-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch
+ApplyPatch linux-2.6-xen-0079-Implement-xen_irqenable_syscall_ret.patch
+ApplyPatch linux-2.6-xen-0080-DEBUG-xen_iret-always-return-through-the-hyperviso.patch
+ApplyPatch linux-2.6-xen-0081-Implement-some-xen-callbacks-on-xen-entry_64.S.patch
+ApplyPatch linux-2.6-xen-0082-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch
+ApplyPatch linux-2.6-xen-0083-Disable-syscall32-code-temporarily-FIXME.patch
+ApplyPatch linux-2.6-xen-0084-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch
+ApplyPatch linux-2.6-xen-0085-Use-apic_xen-on-genapic-by-default-FIXME.patch
+ApplyPatch linux-2.6-xen-0086-irq-vector-ifdef-chainsaw-FIXME.patch
+ApplyPatch linux-2.6-xen-0087-ifdef-chainsaw-on-syscall_init-FIXME.patch
+ApplyPatch linux-2.6-xen-0088-Pull-xen-genapic-implementation-from-upstream-Xen.patch
+ApplyPatch linux-2.6-xen-0089-Debugging-printk-s.patch
+ApplyPatch linux-2.6-xen-0090-Leave-lazy_cpu_mode-on-__switch_to.patch
+ApplyPatch linux-2.6-xen-0091-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch
+ApplyPatch linux-2.6-xen-0092-Disable-vcpu_info_placement-temporarily-FIXME.patch
+ApplyPatch linux-2.6-xen-0093-Fix-typo-on-ifdef-again.patch
+ApplyPatch linux-2.6-xen-0094-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch
+ApplyPatch linux-2.6-xen-0095-Make-load_gs_index-a-paravirt-operation.patch
+ApplyPatch linux-2.6-xen-0096-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch
+ApplyPatch linux-2.6-xen-0097-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch
+ApplyPatch linux-2.6-xen-0098-xen-pgd_walk-accept-start-parameter.patch
+ApplyPatch linux-2.6-xen-0099-xen-64-reserve_bootmem-xen_start_info-area.patch
+ApplyPatch linux-2.6-xen-0100-pvops-64-call-paravirt_post_allocator_init-on-set.patch
+ApplyPatch linux-2.6-xen-0101-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch
+ApplyPatch linux-2.6-xen-0102-xen-64-implement-xen_load_gs_index.patch
+ApplyPatch linux-2.6-xen-0103-Make-xen_pgd_unpin-non-static-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0104-Xen-64-pgd-allocation-hack-FIXME.patch
+ApplyPatch linux-2.6-xen-0105-Set-both-kernel-and-user-PGDs-on-pgd_populate-FI.patch
+ApplyPatch linux-2.6-xen-0106-Multi-pagetable-write_cr3-implementation-FIXME.patch
+ApplyPatch linux-2.6-xen-0107-Disable-the-weird-count-loop-on-kcons_write_dom0.patch
+ApplyPatch linux-2.6-xen-0108-Make-xen_start_info-read-only.patch
+ApplyPatch linux-2.6-xen-0109-Hack-to-implement-return-to-userspace-without-SWAPGS.patch
+ApplyPatch linux-2.6-xen-0110-Xen-SEGBASE_-defines.patch
+ApplyPatch linux-2.6-xen-0111-Xen-HYPERVISOR_set_segment_base-implementation.patch
+ApplyPatch linux-2.6-xen-0112-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0113-Comment-e820_print_map-call-TEMPORARY.patch
+ApplyPatch linux-2.6-xen-0114-Xen-missing-includes.patch
+ApplyPatch linux-2.6-xen-0115-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch
+ApplyPatch linux-2.6-xen-0116-asm-x86-pgtable.h-include-asm-page.h.patch
+ApplyPatch linux-2.6-xen-0117-fix-pxxval_t-usage-on-mm-init_64.c.patch
+ApplyPatch linux-2.6-xen-0118-Missing-Xen-include.patch
+ApplyPatch linux-2.6-xen-0119-un-static-ipi_to_irq.patch
+ApplyPatch linux-2.6-xen-0120-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch
+ApplyPatch linux-2.6-xen-0121-Trying-to-organize-the-xen-bootmem-allocation-mess.patch
+ApplyPatch linux-2.6-xen-0122-Xen-reserve_bootmem-xenstore-and-console-interfac.patch
+ApplyPatch linux-2.6-xen-0123-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch
+ApplyPatch linux-2.6-xen-0124-Xen-64-bit-support-on-xen_pgd_pin.patch
+ApplyPatch linux-2.6-xen-0125-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch
+ApplyPatch linux-2.6-xen-0126-Hack-pgd_walk-to-walk-to-TASK_SIZE-PAGE_SIZE-on-x8.patch
+ApplyPatch linux-2.6-xen-0127-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch
+ApplyPatch linux-2.6-xen-0128-Use-un-pin_page-when-un-pinning-pgd.patch
+ApplyPatch linux-2.6-xen-0129-Allow-enabling-Xen-on-x86_64.patch
+ApplyPatch linux-2.6-xen-0130-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch
+ApplyPatch linux-2.6-xen-0131-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch
+ApplyPatch linux-2.6-xen-0132-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch
+ApplyPatch linux-2.6-xen-0133-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch
+ApplyPatch linux-2.6-xen-0134-Create-xen-specific-syscall-entry.patch
+ApplyPatch linux-2.6-xen-0135-syscall-related-Xen-ifdefs-FIXME.patch
+ApplyPatch linux-2.6-xen-0136-Point-set_pte-to-xen_set_pte-since-the-beginning.patch
+ApplyPatch linux-2.6-xen-0137-DEBUG-slab-debugging.patch
+ApplyPatch linux-2.6-xen-0138-pvops-64-Include-rsi-on-the-register-clobber-list.patch
+ApplyPatch linux-2.6-xen-0139-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch
+ApplyPatch linux-2.6-xen-0140-Add-missing-acpi-include-to-xen-setup.c.patch
+ApplyPatch linux-2.6-xen-0141-Don-t-use-FIX_VDSO-on-64-bit.patch
+ApplyPatch linux-2.6-xen-0142-Mark-init-pages-read-write-again-on-free_init_pages.patch
+ApplyPatch linux-2.6-xen-0143-reserve_early-kernel-text-and-data-segments.patch
+ApplyPatch linux-2.6-xen-0144-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
+ApplyPatch linux-2.6-xen-0145-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch
+ApplyPatch linux-2.6-xen-0146-Pull-xen_failsafe_callback-implementation-from-XenSo.patch
+ApplyPatch linux-2.6-xen-0147-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch
+ApplyPatch linux-2.6-xen-0148-xen-64-Clear-fs-on-xen_load_tls.patch
+ApplyPatch linux-2.6-xen-0149-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch
+ApplyPatch linux-2.6-xen-0150-Introduce-xen_ia32_syscall.patch
+ApplyPatch linux-2.6-xen-0151-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch
+ApplyPatch linux-2.6-xen-0152-Make-the-int80-and-syscall-vdso32-implementations-se.patch
+ApplyPatch linux-2.6-xen-0153-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch
+ApplyPatch linux-2.6-xen-0154-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch
+ApplyPatch linux-2.6-xen-0155-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch
+ApplyPatch linux-2.6-xen-0156-X86_VSMP-make-not-depend-on-XEN-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0157-Add-do_IRQ-prototype-to-asm-x86-irq_64.h.patch
+ApplyPatch linux-2.6-xen-0158-Disable-sysenter-on-x86_64-temporarily-REVIEWME.patch
+ApplyPatch linux-2.6-xen-0159-Add-xen_-alloc-release-_pud-functions-for-x86_64-x.patch
+ApplyPatch linux-2.6-xen-0160-Extract-reserve_initrd-from-x86_64_start_kernel.patch
+ApplyPatch linux-2.6-xen-0161-Make-reserve_initrd-non-static.patch
+ApplyPatch linux-2.6-xen-0162-xen-64-Reserve-initrd-on-xen_start_kernel-also.patch
 %endif
 # kernel-xen apply end
 
@@ -1712,9 +1686,9 @@
     echo USING ARCH=$Arch
 
     make -s ARCH=$Arch %{oldconfig_target} > /dev/null
-    make -s ARCH=$Arch %{?_smp_mflags} $MakeTarget %{?sparse_mflags} \
+    make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} \
     	 ${idhack+"$idhack"}
-    make -s ARCH=$Arch %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
+    make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
 
     # Start installing the results
 %if %{with_debuginfo}
@@ -2193,6 +2167,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Mon Jun 16 2008 Mark McLoughlin <markmc at redhat.com>
+- Rebase to kernel-2_6_26-0_72_rc6_git2_fc10
+
 * Thu May 29 2008 Mark McLoughlin <markmc at redhat.com>
 - Enable ia32 emulation (ehabkost, #437358)
 

linux-2.6-alsa-kill-annoying-messages.patch:

Index: linux-2.6-alsa-kill-annoying-messages.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-alsa-kill-annoying-messages.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-alsa-kill-annoying-messages.patch	1 Apr 2008 10:38:06 -0000	1.1
+++ linux-2.6-alsa-kill-annoying-messages.patch	16 Jun 2008 10:19:26 -0000	1.2
@@ -42,16 +42,14 @@
  	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID,
  			    (stream_tag << 4) | channel_id);
  	msleep(1);
-diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c linux-2.6.24.2/sound/pci/hda/hda_intel.c
---- linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c    2008-02-11 06:51:11.000000000 +0100
-+++ linux-2.6.24.2/sound/pci/hda/hda_intel.c    2008-02-17 11:10:16.000000000 +0100
-@@ -1249,9 +1249,6 @@ static int azx_pcm_prepare(struct snd_pc
+--- linux-2.6.25.noarch/sound/pci/hda/hda_intel.c~	2008-05-16 10:25:32.000000000 -0400
++++ linux-2.6.25.noarch/sound/pci/hda/hda_intel.c	2008-05-16 10:25:57.000000000 -0400
+@@ -1314,8 +1314,6 @@ static int azx_pcm_prepare(struct snd_pc
  		return -EINVAL;
  	}
  
--	snd_printdd("azx_pcm_prepare: bufsize=0x%x, fragsize=0x%x, "
--		    "format=0x%x\n",
--		    azx_dev->bufsize, azx_dev->fragsize, azx_dev->format_val);
- 	azx_setup_periods(azx_dev);
+-	snd_printdd("azx_pcm_prepare: bufsize=0x%x, format=0x%x\n",
+-		    azx_dev->bufsize, azx_dev->format_val);
+ 	if (azx_setup_periods(substream, azx_dev) < 0)
+ 		return -EINVAL;
  	azx_setup_controller(chip, azx_dev);
- 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)

linux-2.6-at76.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.2 -r 1.3 linux-2.6-at76.patch
Index: linux-2.6-at76.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-at76.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-at76.patch	6 Mar 2008 13:59:25 -0000	1.2
+++ linux-2.6-at76.patch	16 Jun 2008 10:19:26 -0000	1.3
@@ -1,4 +1,119 @@
-commit e141a848e24724c2d5534ff8152b0be4fe1b6f62
+commit 34f6f7e889723def0ae895ca8aaa0b12e6ee3f6c
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:29 2008 +0200
+
+    at76_usb: move TX info into skb->cb
+    
+    This patch converts mac80211 and all drivers to have transmit
+    information and status in skb->cb rather than allocating extra
+    memory for it and copying all the data around. To make it fit,
+    a union is used where only data that is necessary for all steps
+    is kept outside of the union.
+    
+    A number of fixes were done by Ivo, as well as the rt2x00 part
+    of this patch.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Acked-by: David S. Miller <davem at davemloft.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 5d77944bc40ebe1b7b1c56fb2f92684b4c29b66b
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:27 2008 +0200
+
+    at76_usb: use rate index in TX control
+    
+    This patch modifies struct ieee80211_tx_control to give band
+    info and the rate index (instead of rate pointers) to drivers.
+    This mostly serves to reduce the TX control structure size to
+    make it fit into skb->cb so that the fragmentation code can
+    put it there and we can think about passing it to drivers that
+    way in the future.
+    
+    The rt2x00 driver update was done by Ivo, thanks.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit a7782d1764b316686de4231286c677e230018021
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:26 2008 +0200
+
+    at76_usb: let drivers wake but not start queues
+    
+    Having drivers start queues is just confusing, their ->start()
+    callback can block and do whatever is necessary, so let mac80211
+    start queues and have drivers wake queues when necessary (to get
+    packets flowing again right away.)
+    
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Acked-by: David S. Miller <davem at davemloft.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 761fb2009c498157d653d9aa9dfd8565039aa072
+Author: Bruno Randolf <br1 at einfach.org>
+Date:   Thu May 8 19:15:40 2008 +0200
+
+    at76: use hardware flags for signal/noise units
+    
+    This is the at76_usb bits...
+    
+    trying to clean up the signal/noise code. the previous code in mac80211 had
+    confusing names for the related variables, did not have much definition of
+    what units of signal and noise were provided and used implicit mechanisms from
+    the wireless extensions.
+    
+    this patch introduces hardware capability flags to let the hardware specify
+    clearly if it can provide signal and noise level values and which units it can
+    provide. this also anticipates possible new units like RCPI in the future.
+    
+    for signal:
+    
+      IEEE80211_HW_SIGNAL_UNSPEC - unspecified, unknown, hw specific
+      IEEE80211_HW_SIGNAL_DB     - dB difference to unspecified reference point
+      IEEE80211_HW_SIGNAL_DBM    - dBm, difference to 1mW
+    
+    for noise we currently only have dBm:
+    
+      IEEE80211_HW_NOISE_DBM     - dBm, difference to 1mW
+    
+    if IEEE80211_HW_SIGNAL_UNSPEC or IEEE80211_HW_SIGNAL_DB is used the driver has
+    to provide the maximum value (max_signal) it reports in order for applications
+    to make sense of the signal values.
+    
+    i tried my best to find out for each driver what it can provide and update it
+    but i'm not sure (?) for some of them and used the more conservative guess in
+    doubt. this can be fixed easily after this patch has been merged by changing
+    the hardware flags of the driver.
+    
+    DRIVER          SIGNAL    MAX	NOISE   QUAL
+    -----------------------------------------------------------------
+    adm8211         unspec(?) 100   n/a     missing
+    at76_usb        unspec(?) (?)   unused  missing
+    ath5k           dBm             dBm     percent rssi
+    b43legacy       dBm             dBm     percent jssi(?)
+    b43             dBm             dBm     percent jssi(?)
+    iwl-3945        dBm             dBm     percent snr+more
+    iwl-4965        dBm             dBm     percent snr+more
+    p54             unspec    127   n/a     missing
+    rt2x00          dBm	        n/a     percent rssi+tx/rx frame success
+      rt2400        dBm             n/a
+      rt2500pci     dBm             n/a
+      rt2500usb     dBm             n/a
+      rt61pci       dBm             n/a
+      rt73usb       dBm             n/a
+    rtl8180         unspec(?) 65    n/a     (?)
+    rtl8187         unspec(?) 65    (?)     noise(?)
+    zd1211          dB(?)     100   n/a     percent
+    
+    drivers/net/wireless/ath5k/base.c:      Changes-licensed-under: 3-Clause-BSD
+    
+    Signed-off-by: Bruno Randolf <br1 at einfach.org>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit ace095545ffa056bf906496a7be0808823fa9980
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:01:07 2008 -0500
 
@@ -7,7 +122,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 4891e7cb744d9e00dfe714c2827abcd32a02e405
+commit 590364c5a53756b670dd104e4cddd8e760875e2f
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:01:01 2008 -0500
 
@@ -16,7 +131,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit a5d909eecd7c57843395780d7bc3e9655093bd5e
+commit 00a1912a53673056e06572bfa37f85b8ef65d682
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:55 2008 -0500
 
@@ -25,7 +140,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit e5d8694e15d0f20a5a3999ca6697278df9a66ca7
+commit cad8f142e3505c0bf0f70a16c6fd7c441697e9e2
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:50 2008 -0500
 
@@ -34,7 +149,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 781e1500cd246b9aeaa0fc7593f028d43c87dbc0
+commit 7babe23f68a622c32bbaf6dfaec3d36644eaa946
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:44 2008 -0500
 
@@ -45,7 +160,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 4083ec919a7353cf7a9de6cf42aa13669b7e018e
+commit 0678f4b57e5d832ec56a54830b8dd94692e1f291
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:19 2008 +0200
 
@@ -56,7 +171,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit bae74e67b58fc0ecf930fc1b5f485d536b1eea5a
+commit 5b6e27b59e14602e50f32b82cdb9781535bcbbbc
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:11 2008 +0200
 
@@ -67,7 +182,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit e31a31b44489b3535fcf7b02871458186ed43aa7
+commit 12189dc89c5b54fa0c48693f853223d738869896
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:04 2008 +0200
 
@@ -81,7 +196,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 162d3ad6b55220940216d35dc1418e0c0ef9b98e
+commit 3341952b9aac1be83bbf1e4858220727a138ebfa
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:56 2008 +0200
[...4114 lines suppressed...]
-+		}
-+	}
++	struct mutex mtx;	/* locks this structure */
 +
-+	priv = at76_alloc_new_device(udev);
-+	if (!priv) {
-+		ret = -ENOMEM;
-+		goto error;
-+	}
++	/* work queues */
++	struct work_struct work_set_promisc;
++	struct work_struct work_submit_rx;
++	struct delayed_work dwork_hw_scan;
 +
-+	usb_set_intfdata(interface, priv);
++	struct tasklet_struct rx_tasklet;
 +
-+	memcpy(&priv->fw_version, &fwv, sizeof(struct mib_fw_version));
-+	priv->board_type = board_type;
++	/* the WEP stuff */
++	int wep_enabled;	/* 1 if WEP is enabled */
++	int wep_key_id;		/* key id to be used */
++	u8 wep_keys[WEP_KEYS][WEP_LARGE_KEY_LEN];	/* WEP keys */
++	u8 wep_keys_len[WEP_KEYS];	/* length of WEP keys */
 +
-+	ret = at76_init_new_device(priv, interface);
-+	if (ret < 0)
-+		at76_delete_device(priv);
++	int channel;
++	int iw_mode;
++	u8 bssid[ETH_ALEN];
++	u8 essid[IW_ESSID_MAX_SIZE];
++	int essid_size;
++	int radio_on;
++	int promisc;
 +
-+	return ret;
++	int preamble_type;	/* 0 - long, 1 - short, 2 - auto */
++	int auth_mode;		/* authentication type: 0 open, 1 shared key */
++	int txrate;		/* 0,1,2,3 = 1,2,5.5,11 Mbps, 4 is auto */
++	int frag_threshold;	/* threshold for fragmentation of tx packets */
++	int rts_threshold;	/* threshold for RTS mechanism */
++	int short_retry_limit;
 +
-+error:
-+	usb_put_dev(udev);
-+	return ret;
-+}
++	int scan_min_time;	/* scan min channel time */
++	int scan_max_time;	/* scan max channel time */
++	int scan_mode;		/* SCAN_TYPE_ACTIVE, SCAN_TYPE_PASSIVE */
++	int scan_need_any;	/* if set, need to scan for any ESSID */
 +
-+static void at76_disconnect(struct usb_interface *interface)
-+{
-+	struct at76_priv *priv;
++	u16 assoc_id;		/* current association ID, if associated */
 +
-+	priv = usb_get_intfdata(interface);
-+	usb_set_intfdata(interface, NULL);
++	u8 pm_mode;		/* power management mode */
++	u32 pm_period;		/* power management period in microseconds */
 +
-+	/* Disconnect after loading internal firmware */
-+	if (!priv)
-+		return;
++	struct reg_domain const *domain;	/* reg domain description */
 +
-+	printk(KERN_INFO "%s: disconnecting\n", wiphy_name(priv->hw->wiphy));
-+	at76_delete_device(priv);
-+	dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
-+}
++	/* These fields contain HW config provided by the device (not all of
++	 * these fields are used by all board types) */
++	u8 mac_addr[ETH_ALEN];
++	u8 regulatory_domain;
 +
-+/* Structure for registering this driver with the USB subsystem */
-+static struct usb_driver at76_driver = {
-+	.name = DRIVER_NAME,
-+	.probe = at76_probe,
-+	.disconnect = at76_disconnect,
-+	.id_table = dev_table,
-+};
++	struct at76_card_config card_config;
 +
-+static int __init at76_mod_init(void)
-+{
-+	int result;
++	enum board_type board_type;
++	struct mib_fw_version fw_version;
 +
-+	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " loading\n");
++	unsigned int device_unplugged:1;
++	unsigned int netdev_registered:1;
++	struct set_mib_buffer mib_buf;	/* global buffer for set_mib calls */
 +
-+	mutex_init(&fw_mutex);
++	int beacon_period;	/* period of mgmt beacons, Kus */
 +
-+	/* register this driver with the USB subsystem */
-+	result = usb_register(&at76_driver);
-+	if (result < 0)
-+		printk(KERN_ERR DRIVER_NAME
-+		       ": usb_register failed (status %d)\n", result);
++	struct ieee80211_hw *hw;
++	int mac80211_registered;
++};
 +
-+	led_trigger_register_simple("at76_usb-tx", &ledtrig_tx);
-+	return result;
-+}
++#define AT76_SUPPORTED_FILTERS FIF_PROMISC_IN_BSS
 +
-+static void __exit at76_mod_exit(void)
-+{
-+	int i;
++#define SCAN_POLL_INTERVAL	(HZ / 4)
 +
-+	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " unloading\n");
-+	usb_deregister(&at76_driver);
-+	for (i = 0; i < ARRAY_SIZE(firmwares); i++) {
-+		if (firmwares[i].fw)
-+			release_firmware(firmwares[i].fw);
-+	}
-+	led_trigger_unregister_simple(ledtrig_tx);
-+}
++#define CMD_COMPLETION_TIMEOUT	(5 * HZ)
 +
-+module_param_named(debug, at76_debug, int, 0600);
-+MODULE_PARM_DESC(debug, "Debugging level");
++#define DEF_RTS_THRESHOLD	1536
++#define DEF_FRAG_THRESHOLD	1536
++#define DEF_SHORT_RETRY_LIMIT	8
++#define DEF_CHANNEL		10
++#define DEF_SCAN_MIN_TIME	10
++#define DEF_SCAN_MAX_TIME	120
 +
-+module_init(at76_mod_init);
-+module_exit(at76_mod_exit);
++/* the max padding size for tx in bytes (see calc_padding) */
++#define MAX_PADDING_SIZE	53
 +
-+MODULE_AUTHOR("Oliver Kurth <oku at masqmail.cx>");
-+MODULE_AUTHOR("Joerg Albert <joerg.albert at gmx.de>");
-+MODULE_AUTHOR("Alex <alex at foogod.com>");
-+MODULE_AUTHOR("Nick Jones");
-+MODULE_AUTHOR("Balint Seeber <n0_5p4m_p13453 at hotmail.com>");
-+MODULE_AUTHOR("Pavel Roskin <proski at gnu.org>");
-+MODULE_AUTHOR("Guido Guenther <agx at sigxcpu.org>");
-+MODULE_AUTHOR("Kalle Valo <kalle.valo at iki.fi>");
-+MODULE_DESCRIPTION(DRIVER_DESC);
-+MODULE_LICENSE("GPL");
-diff -up linux-2.6.24.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.24.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.24.noarch/drivers/net/wireless/Kconfig.orig	2008-02-27 20:56:07.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/Kconfig	2008-02-27 20:56:23.000000000 -0500
-@@ -457,6 +457,14 @@ config PCMCIA_ATMEL
++#endif				/* _AT76_USB_H */
+diff -up linux-2.6.25.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.25.noarch/drivers/net/wireless/Kconfig
+--- linux-2.6.25.noarch/drivers/net/wireless/Kconfig.orig	2008-05-27 15:51:49.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/Kconfig	2008-05-27 15:52:01.000000000 -0400
+@@ -456,6 +456,14 @@ config PCMCIA_ATMEL
  	  Enable support for PCMCIA cards containing the
  	  Atmel at76c502 and at76c504 chips.
  
@@ -3931,3 +4011,34 @@
  config AIRO_CS
  	tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
  	depends on PCMCIA && (BROKEN || !M32R) && WLAN_80211
+diff -up linux-2.6.25.noarch/drivers/net/wireless/Makefile.orig linux-2.6.25.noarch/drivers/net/wireless/Makefile
+--- linux-2.6.25.noarch/drivers/net/wireless/Makefile.orig	2008-05-27 15:51:49.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/Makefile	2008-05-27 15:52:01.000000000 -0400
+@@ -32,6 +32,8 @@ obj-$(CONFIG_ATMEL)             += atmel
+ obj-$(CONFIG_PCI_ATMEL)         += atmel_pci.o 
+ obj-$(CONFIG_PCMCIA_ATMEL)      += atmel_cs.o
+ 
++obj-$(CONFIG_USB_ATMEL)	        += at76_usb.o
++
+ obj-$(CONFIG_PRISM54)		+= prism54/
+ 
+ obj-$(CONFIG_HOSTAP)		+= hostap/
+diff -up linux-2.6.25.noarch/MAINTAINERS.orig linux-2.6.25.noarch/MAINTAINERS
+--- linux-2.6.25.noarch/MAINTAINERS.orig	2008-05-27 15:51:49.000000000 -0400
++++ linux-2.6.25.noarch/MAINTAINERS	2008-05-27 15:52:01.000000000 -0400
+@@ -751,6 +751,15 @@ W:	http://www.thekelleys.org.uk/atmel
+ W:	http://atmelwlandriver.sourceforge.net/
+ S:	Maintained
+ 
++ATMEL USB WIRELESS DRIVER
++P:	Pavel Roskin
++M:	proski at gnu.org
++L:	linux-wireless at vger.kernel.org
++L:	at76c503a-user at lists.berlios.de
++L:	at76c503a-develop at lists.berlios.de
++W:	http://at76c503a.berlios.de/
++S:	Maintained
++
+ AUDIT SUBSYSTEM
+ P:	Al Viro
+ M:	viro at zeniv.linux.org.uk

linux-2.6-compile-fixes.patch:

Index: linux-2.6-compile-fixes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-compile-fixes.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-compile-fixes.patch	14 Apr 2008 16:06:53 -0000	1.5
+++ linux-2.6-compile-fixes.patch	16 Jun 2008 10:19:26 -0000	1.6
@@ -4,3 +4,4 @@
 # Please add the errors from gcc before the diffs to save others having
 # to do a compile to figure out what your diff is fixing. Thanks.
 #
+

linux-2.6-e1000-ich9.patch:

Index: linux-2.6-e1000-ich9.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-e1000-ich9.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-e1000-ich9.patch	6 Mar 2008 13:59:25 -0000	1.2
+++ linux-2.6-e1000-ich9.patch	16 Jun 2008 10:19:26 -0000	1.3
@@ -15,15 +15,13 @@
  	case IGP03E1000_E_PHY_ID:
  		phy->type = e1000_phy_igp_3;
  		phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
-diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
-index 3031d6d..932b4d8 100644
---- a/drivers/net/e1000e/netdev.c
-+++ b/drivers/net/e1000e/netdev.c
-@@ -4095,6 +4095,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
- 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G), board_ich9lan },
- 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_GT), board_ich9lan },
- 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_AMT), board_ich9lan },
+--- linux-2.6.25.noarch/drivers/net/e1000e/netdev.c~	2008-05-16 10:31:41.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/e1000e/netdev.c	2008-05-16 10:32:43.000000000 -0400
+@@ -4599,6 +4599,7 @@ static struct pci_device_id e1000_pci_tb
+ 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M), board_ich9lan },
+ 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_AMT), board_ich9lan },
+ 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_V), board_ich9lan },
 +	{ PCI_VDEVICE(INTEL, 0x10be), board_ich9lan },
- 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_C), board_ich9lan },
  
- 	{ }	/* terminate list */
+ 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LM), board_ich9lan },
+ 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LF), board_ich9lan },

linux-2.6-execshield.patch:

Index: linux-2.6-execshield.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-execshield.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-execshield.patch	6 Mar 2008 13:59:25 -0000	1.4
+++ linux-2.6-execshield.patch	16 Jun 2008 10:19:26 -0000	1.5
@@ -1,8 +1,6 @@
-diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
-index f86a3c4..4c5f70d 100644
---- a/arch/x86/kernel/cpu/common.c
-+++ b/arch/x86/kernel/cpu/common.c
-@@ -478,6 +478,20 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
+--- linux-2.6.25.noarch/arch/x86/kernel/cpu/common.c~	2008-05-16 13:41:08.000000000 -0400
++++ linux-2.6.25.noarch/arch/x86/kernel/cpu/common.c	2008-05-16 13:42:11.000000000 -0400
+@@ -479,6 +479,21 @@ void __cpuinit identify_cpu(struct cpuin
  	 * we do "generic changes."
  	 */
  
@@ -20,8 +18,9 @@
 +			clear_bit(X86_FEATURE_SEP, c->x86_capability);
 +	}
 +
++
  	/* If the model name is still unset, do table lookup. */
- 	if ( !c->x86_model_id[0] ) {
+ 	if (!c->x86_model_id[0]) {
  		char *p;
 diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
 index a7d50a5..83f7b4e 100644
@@ -81,70 +80,17 @@
 +	mm->context.exec_limit = 0;
 +	set_user_cs(&mm->context.user_cs, 0);
 +}
-diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c
-index 309366f..8a940dc 100644
---- a/arch/x86/kernel/setup64.c
-+++ b/arch/x86/kernel/setup64.c
-@@ -45,46 +45,6 @@ EXPORT_SYMBOL_GPL(__supported_pte_mask);
- 
- static int do_not_nx __cpuinitdata = 0;
+--- linux-2.6.25.noarch/arch/x86/kernel/tlb_32.c~	2008-05-16 13:30:44.000000000 -0400
++++ linux-2.6.25.noarch/arch/x86/kernel/tlb_32.c	2008-05-16 13:31:14.000000000 -0400
+@@ -2,6 +2,7 @@
+ #include <linux/cpu.h>
+ #include <linux/interrupt.h>
  
--/* noexec=on|off
--Control non executable mappings for 64bit processes.
--
--on	Enable(default)
--off	Disable
--*/ 
--static int __init nonx_setup(char *str)
--{
--	if (!str)
--		return -EINVAL;
--	if (!strncmp(str, "on", 2)) {
--                __supported_pte_mask |= _PAGE_NX; 
-- 		do_not_nx = 0; 
--	} else if (!strncmp(str, "off", 3)) {
--		do_not_nx = 1;
--		__supported_pte_mask &= ~_PAGE_NX;
--        }
--	return 0;
--} 
--early_param("noexec", nonx_setup);
--
--int force_personality32 = 0; 
--
--/* noexec32=on|off
--Control non executable heap for 32bit processes.
--To control the stack too use noexec=off
--
--on	PROT_READ does not imply PROT_EXEC for 32bit processes
--off	PROT_READ implies PROT_EXEC (default)
--*/
--static int __init nonx32_setup(char *str)
--{
--	if (!strcmp(str, "on"))
--		force_personality32 &= ~READ_IMPLIES_EXEC;
--	else if (!strcmp(str, "off"))
--		force_personality32 |= READ_IMPLIES_EXEC;
--	return 1;
--}
--__setup("noexec32=", nonx32_setup);
--
- /*
-  * Copy data used in early init routines from the initial arrays to the
-  * per cpu data areas.  These arrays then become expendable and the
-diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c
-index dc0cde9..cca75b4 100644
---- a/arch/x86/kernel/smp_32.c
-+++ b/arch/x86/kernel/smp_32.c
-@@ -22,6 +22,7 @@
- 
- #include <asm/mtrr.h>
- #include <asm/tlbflush.h>
 +#include <asm/desc.h>
- #include <asm/mmu_context.h>
- #include <mach_apic.h>
+ #include <asm/tlbflush.h>
  
-@@ -316,6 +317,8 @@ void smp_invalidate_interrupt(struct pt_regs *regs)
+ DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate)
+@@ -92,6 +93,8 @@ void smp_invalidate_interrupt(struct pt_
  	unsigned long cpu;
  
  	cpu = get_cpu();
@@ -153,15 +99,13 @@
  
  	if (!cpu_isset(cpu, flush_cpumask))
  		goto out;
-diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
-index b22c01e..7e196e4 100644
---- a/arch/x86/kernel/traps_32.c
-+++ b/arch/x86/kernel/traps_32.c
-@@ -592,7 +592,91 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
+--- linux-2.6.25.noarch/arch/x86/kernel/traps_32.c~	2008-05-16 13:43:36.000000000 -0400
++++ linux-2.6.25.noarch/arch/x86/kernel/traps_32.c	2008-05-16 13:48:08.000000000 -0400
+@@ -602,13 +602,97 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", inv
  DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
  DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
  DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0, 0)
--DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0, 1)
+-DO_ERROR_INFO(32, SIGILL, "iret exception", iret_error, ILL_BADSTK, 0, 1)
 +
 +/*
 + * lazy-check for CS validity on exec-shield binaries:
@@ -236,35 +180,33 @@
 +	ok = check_lazy_exec_limit(get_cpu(), regs, error_code);
 +	put_cpu();
 +	if (!ok && notify_die(DIE_TRAP, "iret exception", regs,
-+	    error_code, 32, SIGSEGV) != NOTIFY_STOP) {
-+		siginfo_t info;
-+		info.si_signo = SIGSEGV;
-+		info.si_errno = 0;
-+		info.si_code = ILL_BADSTK;
-+		info.si_addr = 0;
-+		do_trap(32, SIGSEGV, "iret exception", 0, regs, error_code,
-+			&info);
++		error_code, 32, SIGSEGV) != NOTIFY_STOP) {
++			siginfo_t info;
++			info.si_signo = SIGSEGV;
++			info.si_errno = 0;
++			info.si_code = ILL_BADSTK;
++			info.si_addr = 0;
++			do_trap(32, SIGSEGV, "iret exception", 0, regs, error_code,
++				&info);
 +	}
 +}
-+
  
- void __kprobes do_general_protection(struct pt_regs * regs,
- 					      long error_code)
-@@ -600,6 +684,7 @@ void __kprobes do_general_protection(struct pt_regs * regs,
- 	int cpu = get_cpu();
- 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
- 	struct thread_struct *thread = &current->thread;
+ void __kprobes do_general_protection(struct pt_regs *regs, long error_code)
+ {
+ 	struct thread_struct *thread;
+ 	struct tss_struct *tss;
+ 	int cpu;
 +	int ok;
  
- 	/*
- 	 * Perform the lazy TSS's I/O bitmap copy. If the TSS has an
-@@ -626,7 +711,6 @@ void __kprobes do_general_protection(struct pt_regs * regs,
- 		put_cpu();
+ 	cpu = get_cpu();
+ 	tss = &per_cpu(init_tss, cpu);
+@@ -641,7 +725,6 @@ void __kprobes do_general_protection(str
+ 
  		return;
  	}
 -	put_cpu();
  
- 	if (regs->flags & VM_MASK)
+ 	if (regs->flags & X86_VM_MASK)
  		goto gp_in_vm86;
 @@ -634,6 +718,22 @@ void __kprobes do_general_protection(struct pt_regs * regs,
  	if (!user_mode(regs))
@@ -407,7 +349,7 @@
  	/* Some simple consistency checks for the interpreter */
  	if (elf_interpreter) {
  		retval = -ELIBBAD;
-@@ -728,6 +735,15 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -721,6 +721,15 @@ static int load_elf_binary(struct linux_
  	if (retval)
  		goto out_free_dentry;
  
@@ -420,9 +362,9 @@
 +		arch_add_exec_range(current->mm, -1);
 +#endif
 +
- 	/* Discard our unneeded old files struct */
- 	if (files) {
- 		put_files_struct(files);
+ 	/* OK, This is the point of no return */
+ 	current->flags &= ~PF_FORKNOEXEC;
+ 	current->mm->def_flags = def_flags;
 @@ -741,7 +757,8 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  	/* Do this immediately, since STACK_TOP as used in setup_arg_pages
  	   may depend on the personality.  */
@@ -442,13 +384,11 @@
  			/*
  			 * load_elf_interp() returns relocation
  			 * adjustment
-diff --git a/fs/proc/array.c b/fs/proc/array.c
-index 07d6c48..46adc3b 100644
---- a/fs/proc/array.c
-+++ b/fs/proc/array.c
-@@ -471,8 +471,12 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+--- linux-2.6.25.noarch/fs/proc/array.c~	2008-05-16 13:51:04.000000000 -0400
++++ linux-2.6.25.noarch/fs/proc/array.c	2008-05-16 13:53:24.000000000 -0400
+@@ -473,8 +473,13 @@ static int do_task_stat(struct seq_file 
+ 		unlock_task_sighand(task, &flags);
  	}
- 	rcu_read_unlock();
  
 -	if (!whole || num_threads < 2)
 -		wchan = get_wchan(task);
@@ -458,6 +398,7 @@
 +			capable(CAP_SYS_NICE))
 +				wchan = get_wchan(task);
 +	}
++
  	if (!whole) {
  		min_flt = task->min_flt;
  		maj_flt = task->maj_flt;
@@ -552,10 +493,11 @@
 index 5b6a05d..7ad80b9 100644
 --- a/include/asm-x86/desc.h
 +++ b/include/asm-x86/desc.h
-@@ -353,6 +353,22 @@ static inline void set_system_gate_ist(int n, void *addr, unsigned ist)
+@@ -353,6 +353,26 @@ static inline void set_system_gate_ist(int n, void *addr, unsigned ist)
  	_set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS);
  }
  
++#ifdef CONFIG_X86_32
 +static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
 +{
 +	limit = (limit - 1) / PAGE_SIZE;
@@ -566,35 +508,18 @@
 +#define load_user_cs_desc(cpu, mm) \
 +	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
 +
-+#ifdef CONFIG_X86_32
 +extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
 +extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
 +extern void arch_flush_exec_range(struct mm_struct *mm);
++#else
++#define arch_add_exec_range(mm, limit)		do { ; } while (0)
++#define arch_flush_exec_range(mm)		do { ; } while (0)
++#define arch_remove_exec_range(mm, limit)	do { ; } while (0)
 +#endif /* CONFIG_X86_32 */
 +
  #else
  /*
   * GET_DESC_BASE reads the descriptor base of the specified segment.
-diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h
-index fb62f99..516a9da 100644
---- a/include/asm-x86/elf.h
-+++ b/include/asm-x86/elf.h
-@@ -185,7 +185,6 @@ static inline void elf_common_init(struct thread_struct *t,
- 			clear_thread_flag(TIF_ABI_PENDING);	\
- 		else						\
- 			set_thread_flag(TIF_ABI_PENDING);	\
--		current->personality |= force_personality32;	\
- 	} while (0)
- #define COMPAT_ELF_PLATFORM			("i686")
- 
-@@ -230,7 +229,6 @@ static inline void elf_common_init(struct thread_struct *t,
- #define ELF_PLATFORM       ("x86_64")
- extern void set_personality_64bit(void);
- extern unsigned int sysctl_vsyscall32;
--extern int force_personality32;
- 
- #endif /* !CONFIG_X86_32 */
- 
 diff --git a/include/asm-x86/mmu.h b/include/asm-x86/mmu.h
 index efa962c..db9b109 100644
 --- a/include/asm-x86/mmu.h
@@ -606,7 +531,7 @@
 + * exec_limit is used to track the range PROT_EXEC
 + * mappings span.
   */
- typedef struct { 
+ typedef struct {
  	void *ldt;
 @@ -18,6 +20,10 @@ typedef struct {
  	int size;
@@ -619,48 +544,31 @@
  } mm_context_t;
  
  #ifdef CONFIG_SMP
-diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
-index 8d67223..982e1cb 100644
---- a/include/asm-x86/pgalloc_64.h
-+++ b/include/asm-x86/pgalloc_64.h
-@@ -5,6 +5,13 @@
- #include <linux/threads.h>
- #include <linux/mm.h>
+--- linux-2.6.25.noarch/include/asm-x86/processor.h~	2008-05-16 15:56:21.000000000 -0400
++++ linux-2.6.25.noarch/include/asm-x86/processor.h	2008-05-16 16:02:44.000000000 -0400
+@@ -151,6 +151,9 @@ static inline int hlt_works(int cpu)
  
-+#define arch_add_exec_range(mm, limit) \
-+		do { (void)(mm), (void)(limit); } while (0)
-+#define arch_flush_exec_range(mm) \
-+		do { (void)(mm); } while (0)
-+#define arch_remove_exec_range(mm, limit) \
-+		do { (void)(mm), (void)(limit); } while (0)
-+
- #define pmd_populate_kernel(mm, pmd, pte) \
- 		set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)))
- #define pud_populate(mm, pud, pmd) \
-diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
-index 149920d..79c8ad8 100644
---- a/include/asm-x86/processor.h
-+++ b/include/asm-x86/processor.h
-@@ -679,6 +679,9 @@ extern int bootloader_type;
- extern char ignore_fpu_irq;
- #define cache_line_size() (boot_cpu_data.x86_cache_alignment)
+ #define cache_line_size()	(boot_cpu_data.x86_cache_alignment)
  
 +#define __HAVE_ARCH_ALIGN_STACK
 +extern unsigned long arch_align_stack(unsigned long sp);
 +
- #define HAVE_ARCH_PICK_MMAP_LAYOUT 1
- #define ARCH_HAS_PREFETCHW
- #define ARCH_HAS_SPINLOCK_PREFETCH
-@@ -756,6 +759,9 @@ static inline void prefetchw(const void *x)
- 	regs->cs = __USER_CS;					\
- 	regs->ip = new_eip;					\
- 	regs->sp = new_esp;					\
-+	preempt_disable();					\
-+	load_user_cs_desc(smp_processor_id(), current->mm);	\
-+	preempt_enable();					\
- } while (0)
- 
+ extern void cpu_detect(struct cpuinfo_x86 *c);
  
+ extern void identify_cpu(struct cpuinfo_x86 *);
+--- linux-2.6.25.noarch/arch/x86/kernel/process_32.c~	2008-05-16 16:02:50.000000000 -0400
++++ linux-2.6.25.noarch/arch/x86/kernel/process_32.c	2008-05-16 16:03:21.000000000 -0400
+@@ -411,6 +411,10 @@ start_thread(struct pt_regs *regs, unsig
+ 	regs->cs		= __USER_CS;
+ 	regs->ip		= new_ip;
+ 	regs->sp		= new_sp;
++	preempt_disable();
++	load_user_cs_desc(smp_processor_id(), current->mm);
++	preempt_enable();
++
+ 	/*
+ 	 * Free the old FP and other extended state
+ 	 */
 diff --git a/include/linux/mm.h b/include/linux/mm.h
 index e8abb38..1483fc7 100644
 --- a/include/linux/mm.h
@@ -740,9 +648,9 @@
 index d41ef6b..5304704 100644
 --- a/kernel/sysctl.c
 +++ b/kernel/sysctl.c
-@@ -81,6 +81,26 @@ extern int maps_protect;
- extern int sysctl_stat_interval;
+@@ -83,6 +83,27 @@ extern int sysctl_stat_interval;
  extern int latencytop_enabled;
+ extern int sysctl_nr_open_min, sysctl_nr_open_max;
  
 +int exec_shield = (1<<0);
 +/* exec_shield is a bitmask:
@@ -764,6 +672,7 @@
 +
 +__setup("exec-shield=", setup_exec_shield);
 +
++
  /* Constants used for minimum and  maximum */
  #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
  static int one = 1;
@@ -992,8 +901,8 @@
 +#include <asm/desc.h>
 +#endif
  
- static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
- 		unsigned long addr, unsigned long end, pgprot_t newprot,
+ #ifndef pgprot_modify
+ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
 @@ -134,7 +138,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
  	struct mm_struct *mm = vma->vm_mm;
  	unsigned long oldflags = vma->vm_flags;

linux-2.6-lirc.patch:

Index: linux-2.6-lirc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-lirc.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-lirc.patch	6 Mar 2008 13:59:25 -0000	1.2
+++ linux-2.6-lirc.patch	16 Jun 2008 10:19:26 -0000	1.3
@@ -1,8 +1,39 @@
+ drivers/input/Kconfig                 |    2 +
+ drivers/input/Makefile                |    2 +
+ drivers/input/lirc/Kconfig            |  127 +++
+ drivers/input/lirc/Makefile           |   24 +
+ drivers/input/lirc/commandir.c        | 1009 +++++++++++++++++++++++
+ drivers/input/lirc/commandir.h        |   41 +
+ drivers/input/lirc/kcompat.h          |  152 ++++
+ drivers/input/lirc/lirc.h             |  102 +++
+ drivers/input/lirc/lirc_atiusb.c      | 1326 ++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_bt829.c       |  393 +++++++++
+ drivers/input/lirc/lirc_cmdir.c       |  605 ++++++++++++++
+ drivers/input/lirc/lirc_cmdir.h       |   27 +
+ drivers/input/lirc/lirc_dev.c         |  827 +++++++++++++++++++
+ drivers/input/lirc/lirc_dev.h         |  264 ++++++
+ drivers/input/lirc/lirc_i2c.c         |  668 +++++++++++++++
+ drivers/input/lirc/lirc_igorplugusb.c |  624 ++++++++++++++
+ drivers/input/lirc/lirc_imon.c        | 1165 +++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_it87.c        | 1012 +++++++++++++++++++++++
+ drivers/input/lirc/lirc_it87.h        |  116 +++
+ drivers/input/lirc/lirc_mceusb.c      |  890 ++++++++++++++++++++
+ drivers/input/lirc/lirc_mceusb2.c     | 1058 ++++++++++++++++++++++++
+ drivers/input/lirc/lirc_parallel.c    |  745 +++++++++++++++++
+ drivers/input/lirc/lirc_parallel.h    |   26 +
+ drivers/input/lirc/lirc_pvr150.c      | 1431 +++++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_sasem.c       |  971 ++++++++++++++++++++++
+ drivers/input/lirc/lirc_serial.c      | 1348 +++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_sir.c         | 1323 ++++++++++++++++++++++++++++++
+ drivers/input/lirc/lirc_streamzap.c   |  810 +++++++++++++++++++
+ drivers/input/lirc/lirc_ttusbir.c     |  393 +++++++++
+ 29 files changed, 17481 insertions(+), 0 deletions(-)
+
 diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
-index 9dea14d..d84ac4a 100644
+index 5f9d860..747633c 100644
 --- a/drivers/input/Kconfig
 +++ b/drivers/input/Kconfig
-@@ -173,5 +173,7 @@ source "drivers/input/gameport/Kconfig"
+@@ -182,5 +182,7 @@ source "drivers/input/gameport/Kconfig"
  
  endmenu
  
@@ -11,16 +42,15 @@
  endmenu
  
 diff --git a/drivers/input/Makefile b/drivers/input/Makefile
-index 2ae87b1..24bdec1 100644
+index 98c4f9a..6a1049b 100644
 --- a/drivers/input/Makefile
 +++ b/drivers/input/Makefile
-@@ -21,5 +21,6 @@ obj-$(CONFIG_INPUT_JOYSTICK)	+= joystick/
- obj-$(CONFIG_INPUT_TABLET)	+= tablet/
- obj-$(CONFIG_INPUT_TOUCHSCREEN)	+= touchscreen/
- obj-$(CONFIG_INPUT_MISC)	+= misc/
-+obj-$(CONFIG_INPUT_LIRC)	+= lirc/
- 
+@@ -25,3 +25,5 @@ obj-$(CONFIG_INPUT_MISC)	+= misc/
  obj-$(CONFIG_INPUT_APMPOWER)	+= apm-power.o
+ 
+ obj-$(CONFIG_XEN_KBDDEV_FRONTEND)	+= xen-kbdfront.o
++
++obj-$(CONFIG_INPUT_LIRC)       += lirc/
 diff --git a/drivers/input/lirc/Kconfig b/drivers/input/lirc/Kconfig
 new file mode 100644
 index 0000000..138e58a
@@ -1248,10 +1278,10 @@
 +
 diff --git a/drivers/input/lirc/kcompat.h b/drivers/input/lirc/kcompat.h
 new file mode 100644
-index 0000000..7792a88
+index 0000000..da2e7eb
 --- /dev/null
 +++ b/drivers/input/lirc/kcompat.h
-@@ -0,0 +1,150 @@
+@@ -0,0 +1,152 @@
 +/*      $Id$      */
 +
 +#ifndef _KCOMPAT_H
@@ -1269,12 +1299,14 @@
 +
 +
 +
-+#define lirc_class_device_create class_device_create
++#define lirc_device_create device_create
 +#define LIRC_DEVFS_PREFIX
 +
 +
 +typedef struct class lirc_class_t;
 +
++#define lirc_device_destroy device_destroy
++
 +
 +
 +#ifndef LIRC_DEVFS_PREFIX
@@ -1404,10 +1436,10 @@
 +#endif /* _KCOMPAT_H */
 diff --git a/drivers/input/lirc/lirc.h b/drivers/input/lirc/lirc.h
 new file mode 100644
-index 0000000..ee76bc9
+index 0000000..accd2cd
 --- /dev/null
 +++ b/drivers/input/lirc/lirc.h
-@@ -0,0 +1,101 @@
+@@ -0,0 +1,102 @@
 +/*      $Id$      */
 +
 +#ifndef _LINUX_LIRC_H
@@ -1466,6 +1498,7 @@
 +
 +#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000
 +#define LIRC_CAN_SET_REC_CARRIER_RANGE    0x80000000
++#define LIRC_CAN_GET_REC_RESOLUTION       0x20000000
 +
 +#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
 +#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
@@ -3886,7 +3919,7 @@
 +#endif
 diff --git a/drivers/input/lirc/lirc_dev.c b/drivers/input/lirc/lirc_dev.c
 new file mode 100644
-index 0000000..cbbc436
+index 0000000..1d5706f
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_dev.c
 @@ -0,0 +1,827 @@
@@ -4000,7 +4033,7 @@
 +#ifdef LIRC_HAVE_DEVFS_26
 +	devfs_remove(DEV_LIRC "/%u", ir->p.minor);
 +#endif
-+	class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
++	lirc_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
 +
 +	if (ir->buf != ir->p.rbuf) {
 +		lirc_buffer_free(ir->buf);
@@ -4221,9 +4254,9 @@
 +			S_IFCHR|S_IRUSR|S_IWUSR,
 +			DEV_LIRC "/%u", ir->p.minor);
 +#endif
-+	(void) lirc_class_device_create(lirc_class, NULL,
-+					MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
-+					ir->p.dev, "lirc%u", ir->p.minor);
++	(void) lirc_device_create(lirc_class, ir->p.dev,
++				  MKDEV(IRCTL_DEV_MAJOR, ir->p.minor),
++				  "lirc%u", ir->p.minor);
 +
 +	if (p->sample_rate || p->get_queue) {
 +		/* try to fire up polling thread */
@@ -4249,7 +4282,7 @@
 +	return minor;
 +
 +out_sysfs:
-+	class_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
++	lirc_device_destroy(lirc_class, MKDEV(IRCTL_DEV_MAJOR, ir->p.minor));
 +#ifdef LIRC_HAVE_DEVFS_26
 +	devfs_remove(DEV_LIRC "/%i", ir->p.minor);
 +#endif
@@ -4989,10 +5022,10 @@
 +#endif
 diff --git a/drivers/input/lirc/lirc_i2c.c b/drivers/input/lirc/lirc_i2c.c
 new file mode 100644
-index 0000000..ed1092b
+index 0000000..6e47d53
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_i2c.c
-@@ -0,0 +1,671 @@
+@@ -0,0 +1,668 @@
 +/*      $Id$      */
 +
 +/*
@@ -5324,12 +5357,9 @@
 +static int set_use_inc(void *data)
 +{
 +	struct IR *ir = data;
-+	int ret;
 +
 +	/* lock bttv in memory while /dev/lirc is in use  */
-+	ret = i2c_use_client(&ir->c);
-+	if (ret != 0)
-+		return ret;
++	i2c_use_client(&ir->c);
 +
 +	MOD_INC_USE_COUNT;
 +	return 0;
@@ -9503,12 +9533,12 @@
 +EXPORT_NO_SYMBOLS;
 diff --git a/drivers/input/lirc/lirc_mceusb2.c b/drivers/input/lirc/lirc_mceusb2.c
 new file mode 100644
-index 0000000..85dc1ce
+index 0000000..9e927a4
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_mceusb2.c
-@@ -0,0 +1,1042 @@
+@@ -0,0 +1,1058 @@
 +/*
-+ * LIRC driver for Philips eHome USB Infrared Transciever
++ * LIRC driver for Philips eHome USB Infrared Transceiver
 + * and the Microsoft MCE 2005 Remote Control
 + *
 + * (C) by Martin A. Blatter <martin_a_blatter at yahoo.com>
@@ -9567,7 +9597,7 @@
 +#define DRIVER_VERSION	"$Revision$"
 +#define DRIVER_AUTHOR	"Daniel Melander <lirc at rajidae.se>, " \
 +			"Martin Blatter <martin_a_blatter at yahoo.com>"
-+#define DRIVER_DESC	"Philips eHome USB IR Transciever and Microsoft " \
++#define DRIVER_DESC	"Philips eHome USB IR Transceiver and Microsoft " \
 +			"MCE 2005 Remote Control driver for LIRC"
 +#define DRIVER_NAME	"lirc_mceusb2"
 +
@@ -9587,6 +9617,7 @@
 +#define MCE_PULSE_BIT	0x80 /* Pulse bit, MSB set == PULSE else SPACE */
 +#define MCE_PULSE_MASK	0x7F /* Pulse mask */
 +#define MCE_MAX_PULSE_LENGTH 0x7F /* Longest transmittable pulse symbol */
++#define MCE_PACKET_LENGTH_MASK  0x7F /* Pulse mask */
 +
 +
 +/* module parameters */
@@ -9621,6 +9652,7 @@
 +#define VENDOR_TATUNG		0x1460
 +#define VENDOR_GATEWAY		0x107b
 +#define VENDOR_SHUTTLE		0x1308
++#define VENDOR_SHUTTLE2		0x051c
 +#define VENDOR_MITSUMI		0x03ee
 +#define VENDOR_TOPSEED		0x1784
 +#define VENDOR_RICAVISION	0x179d
@@ -9630,12 +9662,15 @@
 +#define VENDOR_MICROSOFT	0x045e
 +#define VENDOR_FORMOSA		0x147a
 +#define VENDOR_FINTEK		0x1934
++#define VENDOR_PINNACLE		0x2304
 +
 +static struct usb_device_id usb_remote_table [] = {
-+	/* Philips eHome Infrared Transciever */
++	/* Philips eHome Infrared Transceiver */
 +	{ USB_DEVICE(VENDOR_PHILIPS, 0x0815) },
-+	/* Philips Infrared Transciever - HP branded */
++	/* Philips Infrared Transceiver - HP branded */
 +	{ USB_DEVICE(VENDOR_PHILIPS, 0x060c) },
++	/* Philips SRM5100 */
++	{ USB_DEVICE(VENDOR_PHILIPS, 0x060d) },
 +	/* SMK/Toshiba G83C0004D410 */
 +	{ USB_DEVICE(VENDOR_SMK, 0x031d) },
 +	/* SMK eHome Infrared Transceiver (Sony VAIO) */
@@ -9646,6 +9681,8 @@
 +	{ USB_DEVICE(VENDOR_TATUNG, 0x9150) },
 +	/* Shuttle eHome Infrared Transceiver */
 +	{ USB_DEVICE(VENDOR_SHUTTLE, 0xc001) },
++	/* Shuttle eHome Infrared Transceiver */
++	{ USB_DEVICE(VENDOR_SHUTTLE2, 0xc001) },
 +	/* Gateway eHome Infrared Transceiver */
 +	{ USB_DEVICE(VENDOR_GATEWAY, 0x3009) },
 +	/* Mitsumi */
@@ -9672,8 +9709,12 @@
 +	{ USB_DEVICE(VENDOR_FORMOSA, 0xe015) },
 +	/* Formosa aim / Trust MCE Infrared Receiver */
 +	{ USB_DEVICE(VENDOR_FORMOSA, 0xe017) },
++	/* Formosa Industrial Computing / Beanbag Emulation Device */
++	{ USB_DEVICE(VENDOR_FORMOSA, 0xe018) },
 +	/* Fintek eHome Infrared Transceiver */
 +	{ USB_DEVICE(VENDOR_FINTEK, 0x0602) },
++	/* Pinnacle Remote Kit */
++	{ USB_DEVICE(VENDOR_PINNACLE, 0x0225) },
 +	/* Terminating entry */
 +	{ }
 +};
@@ -9943,9 +9984,11 @@
 +	/* success */
 +	case SUCCESS:
 +		for (i = 0; i < buf_len; i++) {
-+			/* decode mce packets on the form (84),AA,BB,CC,DD */
++			/* decode mce packets of the form (84),AA,BB,CC,DD */
 +			switch (ir->buf_in[i]) {
++
 +			/* data headers */
++			case 0x90: /* used Pinnacle Remote Kit */
 +			case 0x8F:
 +			case 0x8E:
 +			case 0x8D:
@@ -9963,7 +10006,8 @@
 +			case 0x81:
 +			case 0x80:
 +				/* decode packet data */
-+				packet_len = ir->buf_in[i] & MCE_PULSE_MASK;
++				packet_len = ir->buf_in[i] &
++					MCE_PACKET_LENGTH_MASK;
 +				for (j = 1;
 +				     j <= packet_len && (i+j < buf_len);
 +				     j++) {
@@ -10132,7 +10176,9 @@
 +	    (ir->usbdev->descriptor.idVendor == VENDOR_TOPSEED &&
 +	     (ir->usbdev->descriptor.idProduct == 0x0001 ||
 +	      ir->usbdev->descriptor.idProduct == 0x0007 ||
-+	      ir->usbdev->descriptor.idProduct == 0x0008)))
++	      ir->usbdev->descriptor.idProduct == 0x0008)) ||
++	    (ir->usbdev->descriptor.idVendor == VENDOR_PINNACLE &&
++	     (ir->usbdev->descriptor.idProduct == 0x0225)))
 +		ir->transmitter_mask = mask;
 +	else
 +		/* The mask begins at 0x02 and has an inverted

linux-2.6-silence-noise.patch:

Index: linux-2.6-silence-noise.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-silence-noise.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-silence-noise.patch	14 Apr 2008 16:06:53 -0000	1.5
+++ linux-2.6-silence-noise.patch	16 Jun 2008 10:19:26 -0000	1.6
@@ -76,57 +76,15 @@
  	}
  	pci_restore_pcix_state(dev);
  	pci_restore_msi_state(dev);
-
-
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index d887d5c..80be564 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -64,9 +64,6 @@ int (*platform_enable_wakeup)(struct device *dev, int is_on);
-  */
- void device_pm_add(struct device *dev)
+--- linux-2.6.25.noarch/drivers/base/power/main.c~	2008-05-16 10:26:38.000000000 -0400
++++ linux-2.6.25.noarch/drivers/base/power/main.c	2008-05-16 10:26:59.000000000 -0400
+@@ -64,9 +64,6 @@ int device_pm_add(struct device *dev)
  {
+ 	int error;
+ 
 -	pr_debug("PM: Adding info for %s:%s\n",
 -		 dev->bus ? dev->bus->name : "No Bus",
 -		 kobject_name(&dev->kobj));
  	mutex_lock(&dpm_list_mtx);
- 	list_add_tail(&dev->power.entry, &dpm_active);
- 	mutex_unlock(&dpm_list_mtx);
-@@ -80,9 +77,6 @@ void device_pm_add(struct device *dev)
-  */
- void device_pm_remove(struct device *dev)
- {
--	pr_debug("PM: Removing info for %s:%s\n",
--		 dev->bus ? dev->bus->name : "No Bus",
--		 kobject_name(&dev->kobj));
- 	mutex_lock(&dpm_list_mtx);
- 	dpm_sysfs_remove(dev);
- 	list_del_init(&dev->power.entry);
---- linux-2.6.24.noarch/arch/x86/pci/mmconfig-shared.c~	2008-04-12 20:04:01.000000000 -0400
-+++ linux-2.6.24.noarch/arch/x86/pci/mmconfig-shared.c	2008-04-12 20:05:35.000000000 -0400
-@@ -191,7 +191,7 @@ static void __init pci_mmcfg_reject_brok
- 	if (pci_mmcfg_config_num == 1 &&
- 	    cfg->pci_segment == 0 &&
- 	    (cfg->start_bus_number | cfg->end_bus_number) == 0) {
--		printk(KERN_ERR "PCI: start and end of bus number is 0. "
-+		printk(KERN_DEBUG "PCI: start and end of bus number is 0. "
- 		       "Rejected as broken MCFG.\n");
- 		goto reject;
- 	}
-@@ -203,14 +203,14 @@ static void __init pci_mmcfg_reject_brok
- 	if (type == 1 && !e820_all_mapped(cfg->address,
- 					  cfg->address + MMCONFIG_APER_MIN,
- 					  E820_RESERVED)) {
--		printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %Lx is not"
-+		printk(KERN_DEBUG "PCI: BIOS Bug: MCFG area at %Lx is not"
- 		       " E820-reserved\n", cfg->address);
- 		goto reject;
- 	}
- 	return;
- 
- reject:
--	printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
-+	printk(KERN_DEBUG "PCI: Not using MMCONFIG.\n");
- 	kfree(pci_mmcfg_config);
- 	pci_mmcfg_config = NULL;
- 	pci_mmcfg_config_num = 0;
+ 	if ((dev->parent && dev->parent->power.sleeping) || all_sleeping) {
+ 		if (dev->parent->power.sleeping)

linux-2.6-utrace.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.4 -r 1.5 linux-2.6-utrace.patch
Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-utrace.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-utrace.patch	1 Apr 2008 10:38:06 -0000	1.4
+++ linux-2.6-utrace.patch	16 Jun 2008 10:19:26 -0000	1.5
@@ -1,64 +1,85 @@
  Documentation/DocBook/Makefile      |    2 +-
  Documentation/DocBook/utrace.tmpl   |   23 +
  Documentation/utrace.txt            |  579 +++++++++
+ arch/alpha/kernel/ptrace.c          |   15 +-
+ arch/arm/kernel/ptrace.c            |    5 +-
+ arch/avr32/kernel/ptrace.c          |    5 +-
+ arch/blackfin/kernel/ptrace.c       |    5 +-
+ arch/frv/kernel/ptrace.c            |    3 +-
+ arch/h8300/kernel/ptrace.c          |    3 +-
+ arch/ia64/kernel/process.c          |    2 +-
+ arch/ia64/kernel/ptrace.c           |   17 +-
+ arch/m32r/kernel/ptrace.c           |    7 +-
+ arch/m68k/kernel/ptrace.c           |    5 +-
+ arch/m68knommu/kernel/ptrace.c      |    3 +-
  arch/mips/kernel/irixelf.c          |    2 -
- arch/powerpc/kernel/asm-offsets.c   |    4 -
+ arch/mips/kernel/ptrace.c           |    5 +-
+ arch/mn10300/kernel/ptrace.c        |    3 +-
+ arch/parisc/kernel/ptrace.c         |    7 +-
+ arch/powerpc/kernel/entry_32.S      |    4 +-
  arch/powerpc/kernel/process.c       |    5 -
- arch/powerpc/kernel/ptrace.c        |   35 +-
- arch/powerpc/kernel/ptrace32.c      |    2 +-
- arch/powerpc/kernel/signal.c        |    8 +-
- arch/powerpc/kernel/signal_32.c     |   19 +-
+ arch/powerpc/kernel/ptrace.c        |   38 +-
+ arch/powerpc/kernel/ptrace32.c      |    8 +-
+ arch/powerpc/kernel/signal.c        |   20 +-
+ arch/powerpc/kernel/signal_32.c     |   21 +-
  arch/powerpc/kernel/sys_ppc32.c     |    5 -
+ arch/s390/kernel/entry.S            |   14 +-
+ arch/s390/kernel/entry64.S          |   12 +-
+ arch/sh/kernel/ptrace_32.c          |    5 +-
+ arch/sh/kernel/ptrace_64.c          |    5 +-
+ arch/sparc/kernel/ptrace.c          |    5 +-
  arch/sparc64/kernel/binfmt_aout32.c |    2 -
- arch/sparc64/kernel/process.c       |   23 +-
- arch/sparc64/kernel/ptrace.c        |   28 +-
- arch/sparc64/kernel/sys_sparc32.c   |   41 +-
+ arch/sparc64/kernel/ptrace.c        |   35 +-
+ arch/um/kernel/ptrace.c             |    3 +-
+ arch/v850/kernel/ptrace.c           |    3 +-
  arch/x86/ia32/ia32_aout.c           |    6 -
- arch/x86/ia32/ia32_signal.c         |   10 -
+ arch/x86/ia32/ia32_signal.c         |   12 +-
  arch/x86/ia32/ia32entry.S           |   14 +-
  arch/x86/ia32/sys_ia32.c            |    5 -
  arch/x86/kernel/entry_64.S          |    8 +-
- arch/x86/kernel/ptrace.c            |  157 +--
- arch/x86/kernel/signal_32.c         |   37 +-
- arch/x86/kernel/signal_64.c         |   33 +-
+ arch/x86/kernel/ptrace.c            |  159 +--
+ arch/x86/kernel/signal_32.c         |   56 +-
+ arch/x86/kernel/signal_64.c         |   49 +-
+ arch/x86/kernel/step.c              |   22 +-
  arch/x86/kernel/vm86_32.c           |    9 +-
+ arch/xtensa/kernel/ptrace.c         |    6 +-
  fs/binfmt_aout.c                    |    6 -
  fs/binfmt_elf.c                     |    6 -
  fs/binfmt_elf_fdpic.c               |    7 -
  fs/binfmt_flat.c                    |    3 -
  fs/binfmt_som.c                     |    2 -
- fs/compat.c                         |    6 +-
- fs/eventpoll.c                      |    3 +-
+ fs/compat.c                         |   14 +-
+ fs/eventpoll.c                      |    7 +-
  fs/exec.c                           |   12 +-
  fs/proc/array.c                     |    9 +-
  fs/proc/base.c                      |   43 +-
- fs/select.c                         |    4 +-
- include/asm-alpha/ptrace.h          |    1 +
- include/asm-ia64/ptrace.h           |    1 +
- include/asm-ia64/thread_info.h      |    2 +-
- include/asm-powerpc/ptrace.h        |    1 +
+ fs/select.c                         |   12 +-
+ include/asm-ia64/thread_info.h      |    5 +-
+ include/asm-powerpc/thread_info.h   |   17 +-
  include/asm-s390/thread_info.h      |    2 +-
- include/asm-sparc64/ptrace.h        |    2 +
  include/asm-x86/ptrace.h            |    2 +
+ include/asm-x86/thread_info_32.h    |   13 +-
+ include/asm-x86/thread_info_64.h    |   13 +-
+ include/linux/compat.h              |    5 +-
  include/linux/init_task.h           |    3 -
- include/linux/ptrace.h              |   71 +-
- include/linux/sched.h               |   46 +-
- include/linux/thread_info.h         |   10 +-
- include/linux/tracehook.h           |  493 ++++++++
+ include/linux/ptrace.h              |   70 +-
+ include/linux/sched.h               |   38 +-
+ include/linux/thread_info.h         |   27 +-
+ include/linux/tracehook.h           |  507 ++++++++
  include/linux/utrace.h              |  544 ++++++++
  init/Kconfig                        |   29 +
  kernel/Makefile                     |    1 +
  kernel/compat.c                     |    3 +-
- kernel/exit.c                       |  371 +++---
+ kernel/exit.c                       |  403 +++----
  kernel/fork.c                       |   72 +-
- kernel/ptrace.c                     | 2112 +++++++++++++++++++++++++-------
- kernel/signal.c                     |  288 +----
+ kernel/ptrace.c                     | 2129 +++++++++++++++++++++++++-------
+ kernel/signal.c                     |  285 +----
  kernel/sys_ni.c                     |    4 +
  kernel/utrace.c                     | 2377 +++++++++++++++++++++++++++++++++++
  mm/nommu.c                          |    4 +-
  security/selinux/hooks.c            |   59 +-
  security/selinux/include/objsec.h   |    1 -
- 58 files changed, 6306 insertions(+), 1287 deletions(-)
+ 81 files changed, 6535 insertions(+), 1421 deletions(-)
 
 diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
 index 300e170..7cf3afc 100644  
@@ -687,6 +708,274 @@
 +sure which event callbacks it will or won't see after utrace_set_flags
 +has returned.  By checking for errors, it can know whether to clean up
 +its data structures immediately or to let its callbacks do the work.
+diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
+index 1e9ad52..7dc30f5 100644  
+--- a/arch/alpha/kernel/ptrace.c
++++ b/arch/alpha/kernel/ptrace.c
+@@ -260,11 +260,12 @@ void ptrace_disable(struct task_struct *
+ 	ptrace_cancel_bpt(child);
+ }
+ 
+-long arch_ptrace(struct task_struct *child, long request, long addr, long data)
++int arch_ptrace(struct task_struct *child, long request, long addr, long data,
++		long *retval)
+ {
+ 	unsigned long tmp;
+ 	size_t copied;
+-	long ret;
++	int ret;
+ 
+ 	switch (request) {
+ 	/* When I and D space are separate, these will need to be fixed.  */
+@@ -275,14 +276,14 @@ long arch_ptrace(struct task_struct *chi
+ 		if (copied != sizeof(tmp))
+ 			break;
+ 		
+-		force_successful_syscall_return();
+-		ret = tmp;
++		ret = 0;
++		*retval = tmp;
+ 		break;
+ 
+ 	/* Read register number ADDR. */
+ 	case PTRACE_PEEKUSR:
+-		force_successful_syscall_return();
+-		ret = get_reg(child, addr);
++		ret = 0;
++		*retval = get_reg(child, addr);
+ 		DBG(DBG_MEM, ("peek $%ld->%#lx\n", addr, ret));
+ 		break;
+ 
+@@ -343,7 +344,7 @@ long arch_ptrace(struct task_struct *chi
+ 		break;
+ 
+ 	default:
+-		ret = ptrace_request(child, request, addr, data);
++		ret = 1;
+ 		break;
+ 	}
+ 	return ret;
+diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
+index 4b05dc5..938be29 100644  
+--- a/arch/arm/kernel/ptrace.c
++++ b/arch/arm/kernel/ptrace.c
+@@ -655,7 +655,8 @@ static int ptrace_setcrunchregs(struct t
+ }
+ #endif
+ 
+-long arch_ptrace(struct task_struct *child, long request, long addr, long data)
++int arch_ptrace(struct task_struct *child, long request, long addr, long data,
++		long *retval)
+ {
+ 	int ret;
+ 
+@@ -778,7 +779,7 @@ long arch_ptrace(struct task_struct *chi
+ #endif
+ 
+ 		default:
+-			ret = ptrace_request(child, request, addr, data);
++			ret = 1;
+ 			break;
+ 	}
+ 
+diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
+index 1fed38f..5ce2ff7 100644  
+--- a/arch/avr32/kernel/ptrace.c
++++ b/arch/avr32/kernel/ptrace.c
[...3020 lines suppressed...]
++			ret = rc;
++		else
++			force_successful_syscall_return();
 +		put_task_struct(child);
-+	}
+ 	}
+ 
+-	ret = ptrace_check_attach(child, request == PTRACE_KILL);
+-	if (!ret)
+-		ret = compat_arch_ptrace(child, request, addr, data);
  
 - out_put_task_struct:
 -	put_task_struct(child);
@@ -6349,7 +7512,7 @@
  
  #endif	/* CONFIG_COMPAT */
 diff --git a/kernel/signal.c b/kernel/signal.c
-index 6af1210..2fdb5fc 100644  
+index 6af1210..4ede33b 100644  
 --- a/kernel/signal.c
 +++ b/kernel/signal.c
 @@ -22,6 +22,7 @@
@@ -6667,7 +7830,7 @@
  		read_lock(&tasklist_lock);
  		do_notify_parent_cldstop(current, CLD_STOPPED);
  		read_unlock(&tasklist_lock);
-@@ -1780,44 +1647,24 @@ relock:
+@@ -1780,44 +1647,25 @@ relock:
  		    do_signal_stop(0))
  			goto relock;
  
@@ -6678,7 +7841,19 @@
 -
 -		if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
 -			ptrace_signal_deliver(regs, cookie);
--
++		/*
++		 * Tracing can induce an artifical signal and choose sigaction.
++		 * The return value in @signr determines the default action,
++		 * but @info->si_signo is the signal number we will report.
++		 */
++		signr = tracehook_get_signal(current, regs, info, return_ka);
++		if (unlikely(signr < 0))
++			goto relock;
++		if (unlikely(signr != 0))
++			ka = return_ka;
++		else {
++			signr = dequeue_signal(current, mask, info);
+ 
 -			/* Let the debugger run.  */
 -			ptrace_stop(signr, 0, info);
 -
@@ -6700,27 +7875,14 @@
 -				info->si_pid = task_pid_vnr(current->parent);
 -				info->si_uid = current->parent->uid;
 -			}
--
++			if (!signr)
++				break; /* will return 0 */
+ 
 -			/* If the (new) signal is now blocked, requeue it.  */
 -			if (sigismember(&current->blocked, signr)) {
 -				specific_send_sig_info(signr, info, current);
 -				continue;
 -			}
-+		/*
-+		 * Tracing can induce an artifical signal and choose sigaction.
-+		 * The return value in signr determines the default action,
-+		 * but info->si_signo is the signal number we will report.
-+		 */
-+		signr = tracehook_get_signal(current, regs, info, return_ka);
-+		if (unlikely(signr < 0))
-+			goto relock;
-+		if (unlikely(signr != 0))
-+			ka = return_ka;
-+		else {
-+			signr = dequeue_signal(current, mask, info);
-+
-+			if (!signr)
-+				break; /* will return 0 */
 +			ka = &current->sighand->action[signr-1];
  		}
  
@@ -6728,7 +7890,7 @@
  		if (ka->sa.sa_handler == SIG_IGN) /* Do nothing.  */
  			continue;
  		if (ka->sa.sa_handler != SIG_DFL) {
-@@ -1827,6 +1674,7 @@ relock:
+@@ -1827,6 +1675,7 @@ relock:
  			if (ka->sa.sa_flags & SA_ONESHOT)
  				ka->sa.sa_handler = SIG_DFL;
  
@@ -6736,7 +7898,7 @@
  			break; /* will return non-zero "signr" value */
  		}
  
-@@ -1864,7 +1712,7 @@ relock:
+@@ -1864,7 +1713,7 @@ relock:
  				spin_lock_irq(&current->sighand->siglock);
  			}
  
@@ -6745,7 +7907,7 @@
  				/* It released the siglock.  */
  				goto relock;
  			}
-@@ -1882,9 +1730,10 @@ relock:
+@@ -1882,9 +1731,10 @@ relock:
  		 * Anything else is fatal, maybe with a core dump.
  		 */
  		current->flags |= PF_SIGNALED;
@@ -6758,7 +7920,7 @@
  			/*
  			 * If it was able to dump core, this kills all
  			 * other threads in the group and synchronizes with
-@@ -1893,13 +1742,13 @@ relock:
+@@ -1893,13 +1743,13 @@ relock:
  			 * first and our do_group_exit call below will use
  			 * that value and ignore the one we pass it.
  			 */
@@ -6774,7 +7936,7 @@
  		/* NOTREACHED */
  	}
  	spin_unlock_irq(&current->sighand->siglock);
-@@ -1953,7 +1802,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
+@@ -1953,7 +1803,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
  EXPORT_SYMBOL(flush_signals);
  EXPORT_SYMBOL(force_sig);
  EXPORT_SYMBOL(kill_proc);
@@ -6782,7 +7944,7 @@
  EXPORT_SYMBOL(send_sig);
  EXPORT_SYMBOL(send_sig_info);
  EXPORT_SYMBOL(sigprocmask);
-@@ -2610,7 +2458,7 @@ asmlinkage long sys_rt_sigsuspend(sigset
+@@ -2610,7 +2459,7 @@ asmlinkage long sys_rt_sigsuspend(sigset
  
  	current->state = TASK_INTERRUPTIBLE;
  	schedule();
@@ -9212,7 +10374,7 @@
  
  	return vm_flags;
 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
-index 41a049f..44b756b 100644  
+index d39b59c..43cb7c3 100644  
 --- a/security/selinux/hooks.c
 +++ b/security/selinux/hooks.c
 @@ -24,7 +24,7 @@
@@ -9233,7 +10395,7 @@
  	task->security = tsec;
  
  	return 0;
-@@ -1638,19 +1638,13 @@ static inline u32 file_to_av(struct file
+@@ -1645,19 +1645,13 @@ static inline u32 file_to_av(struct file
  
  static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
  {
@@ -9254,7 +10416,7 @@
  }
  
  static int selinux_capget(struct task_struct *target, kernel_cap_t *effective,
-@@ -2119,12 +2113,25 @@ static void selinux_bprm_apply_creds(str
+@@ -2126,12 +2120,25 @@ static void selinux_bprm_apply_creds(str
  		/* Check for ptracing, and update the task SID if ok.
  		   Otherwise, leave SID unchanged and kill. */
  		if (unsafe & (LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP)) {
@@ -9286,7 +10448,7 @@
  			}
  		}
  		tsec->sid = sid;
-@@ -2207,7 +2214,7 @@ static void selinux_bprm_post_apply_cred
+@@ -2214,7 +2221,7 @@ static void selinux_bprm_post_apply_cred
  
  	/* Wake up the parent if it is waiting so that it can
  	   recheck wait permission to the new task SID. */
@@ -9295,7 +10457,7 @@
  }
  
  /* superblock security operations */
-@@ -3080,11 +3087,6 @@ static int selinux_task_alloc_security(s
+@@ -3087,11 +3094,6 @@ static int selinux_task_alloc_security(s
  	tsec2->keycreate_sid = tsec1->keycreate_sid;
  	tsec2->sockcreate_sid = tsec1->sockcreate_sid;
  
@@ -9307,7 +10469,7 @@
  	return 0;
  }
  
-@@ -5050,6 +5052,7 @@ static int selinux_setprocattr(struct ta
+@@ -5057,6 +5059,7 @@ static int selinux_setprocattr(struct ta
  			       char *name, void *value, size_t size)
  {
  	struct task_security_struct *tsec;
@@ -9315,7 +10477,7 @@
  	u32 sid = 0;
  	int error;
  	char *str = value;
-@@ -5138,18 +5141,24 @@ static int selinux_setprocattr(struct ta
+@@ -5145,18 +5148,24 @@ static int selinux_setprocattr(struct ta
  		/* Check for ptracing, and update the task SID if ok.
  		   Otherwise, leave SID unchanged and fail. */
  		task_lock(p);

linux-2.6-wireless-pending.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.7 -r 1.8 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-wireless-pending.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-wireless-pending.patch	8 May 2008 08:57:47 -0000	1.7
+++ linux-2.6-wireless-pending.patch	16 Jun 2008 10:19:26 -0000	1.8
@@ -1,75247 +1,21821 @@
-commit 06501d29ada4457349f4f4427bbf0bbb7c59b8f6
-Author: John W. Linville <linville at tuxdriver.com>
-Date:   Tue Apr 1 17:38:47 2008 -0400
+commit 78cf07472f0ede8394bacc4bc02354505080cfe1
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date:   Mon Jun 2 09:25:05 2008 +0200
 
-    wireless: fix various printk warnings on ia64 (and others)
+    libertas: unify various CF-related defines
     
-    drivers/net/wireless/ath5k/base.c: In function `ath5k_check_ibss_tsf':
-    drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 5)
-    drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 6)
-    drivers/net/wireless/ath5k/base.c:1740: warning: long long int format, u64 arg (arg 7)
-    drivers/net/wireless/ath5k/base.c:1740: warning: long long unsigned int format, u64 arg (arg 8)
-    drivers/net/wireless/ath5k/base.c:1757: warning: long long unsigned int format, u64 arg (arg 5)
-    drivers/net/wireless/ath5k/base.c:1757: warning: long long unsigned int format, u64 arg (arg 6)
-    drivers/net/wireless/iwlwifi/iwl4965-base.c: In function `iwl4965_tx_status_reply_tx':
-    drivers/net/wireless/iwlwifi/iwl4965-base.c:3105: warning: long long unsigned int format, u64 arg (arg 6)
-    drivers/net/wireless/iwlwifi/iwl-4965.c: In function `iwl4965_rx_reply_rx':
-    drivers/net/wireless/iwlwifi/iwl-4965.c:3978: warning: long long unsigned int format, u64 arg (arg 7)
-    
-    Cc: Andrew Morton <akpm at linux-foundation.org>
+    Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 6c4711b4697d93424e4b1f76a9929ba844d714a5
-Author: Luis Carlos Cobo <luisca at cozybit.com>
-Date:   Mon Mar 31 17:39:18 2008 -0700
+commit 2d892986e82306b8ad96285fb54b9999523331e0
+Author: Tomas Winkler <tomas.winkler at intel.com>
+Date:   Mon Jun 2 20:31:57 2008 +0300
 
-    mac80211: use a struct for bss->mesh_config
-    
-    This allows cleaner code when accesing bss->mesh_config components.
+    mac80211: removing shadowed sband
     
-    Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
-    Acked-by: Johannes Berg <johannes at sipsolutions.net>
-    Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit 05e5e88373d91c75e9262a3f984be511960e510d
-Author: Luis Carlos Cobo <luisca at cozybit.com>
-Date:   Mon Mar 31 16:00:13 2008 -0700
-
-    mac80211: check for mesh_config length on incoming management frames
+    This patch removes doubly defined sband variable
     
-    Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
+    Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 966a54282257ce1c43a5410dab2f2778a6f4dcf9
-Author: Luis Carlos Cobo <luisca at cozybit.com>
-Date:   Mon Mar 31 15:33:39 2008 -0700
+commit b97e77e0446f0702de7fa0f5d2c52acf42d0289f
+Author: Tomas Winkler <tomas.winkler at intel.com>
+Date:   Mon Jun 2 20:31:56 2008 +0300
 
-    mac80211: use recent multicast table for all mesh multicast frames
-    
-    ...not only broadcast.
+    mac80211: fix unbalanced locking in ieee80211_get_buffered_bc
     
-    Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
-    Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit cb585bccfedab0c228344ffa258950c417dea6b5
-Author: Luis Carlos Cobo <luisca at cozybit.com>
-Date:   Mon Mar 31 15:21:23 2008 -0700
-
-    mac80211: fix spinlock recursion on sta expiration
+    This patch fixes unbalanced locking in ieee80211_get_buffered_bc
     
-    Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
-    Acked-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 73bb3e4a7a9f1b8d5f89c3991bd0c904ab0b8e27
-Author: Luis Carlos Cobo <luisca at cozybit.com>
-Date:   Mon Mar 31 15:10:22 2008 -0700
+commit 2b2121417eff64125bdb7f322d3b533e06d73dae
+Author: Pavel Roskin <proski at gnu.org>
+Date:   Mon Jun 2 07:54:50 2008 -0400
 
-    mac80211: fix deadlocks in debugfs_netdev.c
+    mac80211: fix panic when using hardware WEP
     
-    The bug shows up with CONFIG_PREEMPT enabled. Pointed out by Andrew Morton.
+    e039fa4a4195ac4ee895e6f3d1334beed63256fe ("mac80211: move TX info into
+    skb->cb") misplaced code for setting hardware WEP keys.  Move it back.
+    This fixes kernel panic in b43 if WEP is used and hardware encryption
+    is enabled.
     
-    Cc: Andrew Morton <akpm at linux-foundation.org>
-    Cc: Johannes Berg <johannes at sipsolutions.net>
-    Signed-off-by: Luis Carlos Cobo <luisca at cozybit.com>
+    Signed-off-by: Pavel Roskin <proski at gnu.org>
+    Acked-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 7e879b551f1ada78d66fa5c6914aa1744b9c97d2
+commit 5854a32e6cb672d182ce378c69f0f7470137a062
 Author: Johannes Berg <johannes at sipsolutions.net>
-Date:   Mon Mar 31 19:23:04 2008 +0200
+Date:   Mon Jun 2 09:38:04 2008 +0200
 
-    mac80211: fix sparse complaint in ieee80211_sta_def_wmm_params
+    mac80211: fix rate control initialisation
+    
+    In commit 2e92e6f2c50b4baf85cca968f0e6f1b5c0df7d39 ("mac80211: use rate
+    index in TX control") I forgot to initialise a few new variables to -1 which
+    means that the rate control algorithm is never triggered and 0 is used as
+    the only rate index, effectively fixing the transmit bitrate at the lowest
+    supported.
     
-    A variable 'i' is being shadowed by another one, but the second
-    one can just be removed.
+    This patch adds the missing initialisation.
     
     Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
-    Cc: Vladimir Koutny <vlado at work.ksp.sk>
+    Bisected-by: Sitsofe Wheeler <sitsofe at yahoo.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit dc6676b7f2c2072ec05254aaca32e99f87a8a417
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date:   Mon Mar 31 19:23:03 2008 +0200
+commit 7fd871edf437362b62ddd807542638cbda8d8a39
+Author: Masakazu Mokuno <mokuno at sm.sony.co.jp>
+Date:   Mon Jun 2 12:49:16 2008 +0900
 
-    mac80211: sta_info_flush() fixes
+    PS3: gelic: Add support for ESSID scan
     
-    When the IBSS code tries to flush the STA list, it does so in
-    an atomic context. Flushing isn't safe there, however, and
-    requires the RTNL, so we need to defer it to a workqueue.
+    This adds the support for ESSID scanning
     
-    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Masakazu Mokuno <mokuno at sm.sony.co.jp>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 4f6fab472c4c7c21d577f85fabec7628d4a05637
+commit 552fe53f48ef2fd54b031b37d304211cee893ba0
 Author: Johannes Berg <johannes at sipsolutions.net>
-Date:   Mon Mar 31 19:23:02 2008 +0200
+Date:   Fri May 30 21:07:15 2008 +0200
 
-    mac80211: clean up sta_info_destroy() users wrt. RCU/locking
+    p54: fix skb->cb tx info conversion
     
-    Calling sta_info_destroy() doesn't require RCU-synchronisation
-    before-hand because it does that internally. However, it does
-    require rtnl-locking so insert that where necessary.
-    
-    Also clean up the code doing it internally to be a bit clearer and
-    not synchronize twice if keys are configured.
+    When I moved the TX info into skb->cb apparently I forgot to change a
+    few places to put the p54-internal data into info->driver_data rather
+    than skb->cb. This should fix it.
     
     Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 93e5deb1ae39b56f4743955e76c72251256f23c1
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date:   Tue Apr 1 15:21:00 2008 +0200
+commit f409e348005693016281bf29535c9d0a91b21f77
+Author: Masakazu Mokuno <mokuno at sm.sony.co.jp>
+Date:   Fri May 30 16:52:55 2008 +0900
 
-    mac80211: automatically free sta struct when insertion fails
+    PS3: gelic: Deprecate the private ioctls in the gelic driver
     
-    When STA structure insertion fails, it has been allocated but isn't
-    really alive yet, it isn't reachable by any other code and also can't
-    yet have much configured. This patch changes the code so that when
-    the insertion fails, the resulting STA pointer is no longer valid
-    because it is freed.
+    As the driver has the standard way to handle PSK, deprecate the old
+    interface.
     
-    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Masakazu Mokuno <mokuno at sm.sony.co.jp>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
[...145564 lines suppressed...]
-+
-+	for (band = 0; band < IEEE80211_NUM_BANDS; band++)
-+		if (wiphy->bands[band])
-+			handle_band(wiphy->bands[band], rd);
-+}
-diff -Naurp linux-2.6.25.noarch/net/wireless/util.c linux-2.6.25.noarch.wifi/net/wireless/util.c
---- linux-2.6.25.noarch/net/wireless/util.c	1969-12-31 19:00:00.000000000 -0500
-+++ linux-2.6.25.noarch.wifi/net/wireless/util.c	2008-05-02 18:52:02.000000000 -0400
-@@ -0,0 +1,121 @@
-+/*
-+ * Wireless utility functions
-+ *
-+ * Copyright 2007	Johannes Berg <johannes at sipsolutions.net>
-+ */
-+#include <net/wireless.h>
-+#include <asm/bitops.h>
-+#include "core.h"
-+
-+int ieee80211_channel_to_frequency(int chan)
-+{
-+	if (chan < 14)
-+		return 2407 + chan * 5;
-+
-+	if (chan == 14)
-+		return 2484;
-+
-+	/* FIXME: 802.11j 17.3.8.3.2 */
-+	return (chan + 1000) * 5;
-+}
-+EXPORT_SYMBOL(ieee80211_channel_to_frequency);
-+
-+int ieee80211_frequency_to_channel(int freq)
-+{
-+	if (freq == 2484)
-+		return 14;
-+
-+	if (freq < 2484)
-+		return (freq - 2407) / 5;
-+
-+	/* FIXME: 802.11j 17.3.8.3.2 */
-+	return freq/5 - 1000;
-+}
-+EXPORT_SYMBOL(ieee80211_frequency_to_channel);
-+
-+struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
-+						  int freq)
-+{
-+	enum ieee80211_band band;
-+	struct ieee80211_supported_band *sband;
-+	int i;
-+
-+	for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
-+		sband = wiphy->bands[band];
-+
-+		if (!sband)
-+			continue;
-+
-+		for (i = 0; i < sband->n_channels; i++) {
-+			if (sband->channels[i].center_freq == freq)
-+				return &sband->channels[i];
-+		}
-+	}
-+
-+	return NULL;
-+}
-+EXPORT_SYMBOL(__ieee80211_get_channel);
-+
-+static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
-+				     enum ieee80211_band band)
-+{
-+	int i, want;
-+
-+	switch (band) {
-+	case IEEE80211_BAND_5GHZ:
-+		want = 3;
-+		for (i = 0; i < sband->n_bitrates; i++) {
-+			if (sband->bitrates[i].bitrate == 60 ||
-+			    sband->bitrates[i].bitrate == 120 ||
-+			    sband->bitrates[i].bitrate == 240) {
-+				sband->bitrates[i].flags |=
-+					IEEE80211_RATE_MANDATORY_A;
-+				want--;
-+			}
-+		}
-+		WARN_ON(want);
-+		break;
-+	case IEEE80211_BAND_2GHZ:
-+		want = 7;
-+		for (i = 0; i < sband->n_bitrates; i++) {
-+			if (sband->bitrates[i].bitrate == 10) {
-+				sband->bitrates[i].flags |=
-+					IEEE80211_RATE_MANDATORY_B |
-+					IEEE80211_RATE_MANDATORY_G;
-+				want--;
-+			}
-+
-+			if (sband->bitrates[i].bitrate == 20 ||
-+			    sband->bitrates[i].bitrate == 55 ||
-+			    sband->bitrates[i].bitrate == 110 ||
-+			    sband->bitrates[i].bitrate == 60 ||
-+			    sband->bitrates[i].bitrate == 120 ||
-+			    sband->bitrates[i].bitrate == 240) {
-+				sband->bitrates[i].flags |=
-+					IEEE80211_RATE_MANDATORY_G;
-+				want--;
-+			}
-+
-+			if (sband->bitrates[i].bitrate != 10 &&
-+			    sband->bitrates[i].bitrate != 20 &&
-+			    sband->bitrates[i].bitrate != 55 &&
-+			    sband->bitrates[i].bitrate != 110)
-+				sband->bitrates[i].flags |=
-+					IEEE80211_RATE_ERP_G;
-+		}
-+		WARN_ON(want != 0 && want != 3 && want != 6);
-+		break;
-+	case IEEE80211_NUM_BANDS:
-+		WARN_ON(1);
-+		break;
-+	}
-+}
-+
-+void ieee80211_set_bitrate_flags(struct wiphy *wiphy)
-+{
-+	enum ieee80211_band band;
-+
-+	for (band = 0; band < IEEE80211_NUM_BANDS; band++)
-+		if (wiphy->bands[band])
-+			set_mandatory_flags_band(wiphy->bands[band], band);
-+}
+-	/* this will check for collisions */
++	/* this will only check for collisions in sysfs
++	 * which is not even always compiled in.
++	 */
+ 	result = device_rename(&rdev->wiphy.dev, newname);
+ 	if (result)
+-		return result;
++		goto out_unlock;
+ 
+ 	if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
+ 			    rdev->wiphy.debugfsdir,
+@@ -172,9 +191,13 @@ int cfg80211_dev_rename(struct cfg80211_
+ 		printk(KERN_ERR "cfg80211: failed to rename debugfs dir to %s!\n",
+ 		       newname);
+ 
+-	nl80211_notify_dev_rename(rdev);
++	result = 0;
++out_unlock:
++	mutex_unlock(&cfg80211_drv_mutex);
++	if (result == 0)
++		nl80211_notify_dev_rename(rdev);
+ 
+-	return 0;
++	return result;
+ }
+ 
+ /* exported functions */
+diff -up linux-2.6.25.noarch/net/wireless/radiotap.c.orig linux-2.6.25.noarch/net/wireless/radiotap.c
+--- linux-2.6.25.noarch/net/wireless/radiotap.c.orig	2008-04-16 22:49:44.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/radiotap.c	2008-06-13 19:28:53.000000000 -0400
+@@ -59,23 +59,21 @@ int ieee80211_radiotap_iterator_init(
+ 		return -EINVAL;
+ 
+ 	/* sanity check for allowed length and radiotap length field */
+-	if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
++	if (max_length < get_unaligned_le16(&radiotap_header->it_len))
+ 		return -EINVAL;
+ 
+ 	iterator->rtheader = radiotap_header;
+-	iterator->max_length = le16_to_cpu(get_unaligned(
+-						&radiotap_header->it_len));
++	iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
+ 	iterator->arg_index = 0;
+-	iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
+-						&radiotap_header->it_present));
++	iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
+ 	iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
+ 	iterator->this_arg = NULL;
+ 
+ 	/* find payload start allowing for extended bitmap(s) */
+ 
+ 	if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
+-		while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
+-				   (1<<IEEE80211_RADIOTAP_EXT)) {
++		while (get_unaligned_le32(iterator->arg) &
++		       (1 << IEEE80211_RADIOTAP_EXT)) {
+ 			iterator->arg += sizeof(u32);
+ 
+ 			/*
+@@ -241,8 +239,8 @@ int ieee80211_radiotap_iterator_next(
+ 			if (iterator->bitmap_shifter & 1) {
+ 				/* b31 was set, there is more */
+ 				/* move to next u32 bitmap */
+-				iterator->bitmap_shifter = le32_to_cpu(
+-					get_unaligned(iterator->next_bitmap));
++				iterator->bitmap_shifter =
++				    get_unaligned_le32(iterator->next_bitmap);
+ 				iterator->next_bitmap++;
+ 			} else
+ 				/* no more bitmaps: end */

linux-2.6-wireless.patch:

Index: linux-2.6-wireless.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-wireless.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-wireless.patch	17 Apr 2008 08:04:30 -0000	1.7
+++ linux-2.6-wireless.patch	16 Jun 2008 10:19:26 -0000	1.8
@@ -1,860 +1,540 @@
-commit b358492cd2a9c67bff352c5a60d86e7fc9627477
-Author: Masakazu Mokuno <mokuno at sm.sony.co.jp>
-Date:   Mon Apr 14 18:07:21 2008 +0900
+commit cb62eccd7d946f7fb92b8beb79988726ec92c227
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date:   Thu Jun 12 20:47:17 2008 +0200
 
-    PS3: gelic: fix the oops on the broken IE returned from the hypervisor
-    
-    This fixes the bug that the driver would try to over-scan the memory
-    if the sum of the length field of every IEs does not match the length
-    returned from the hypervisor.
+    rt2x00: Add D-link DWA111 support
     
-    Signed-off-by: Masakazu Mokuno <mokuno at sm.sony.co.jp>
-    Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit dc4ae1f46dbbcd08b3b5e23ad5ef87bf4bb41adf
-Author: Stefano Brivio <stefano.brivio at polimi.it>
-Date:   Mon Apr 14 00:59:49 2008 +0200
-
-    b43legacy: fix DMA mapping leakage
-    
-    This fixes a DMA mapping leakage in the case where we reject a DMA buffer
-    because of its address.
-    The patch by Michael Buesch has been ported to b43legacy.
+    Add new rt73usb USB ID for D-Link DWA111
     
-    Signed-off-by: Stefano Brivio <stefano.brivio at polimi.it>
-    Cc: Christian Casteyde <casteyde.christian at free.fr>
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit b3fc9c6c58c986f7a24fd8b0794d1e0794935a28
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date:   Sun Apr 13 10:12:47 2008 +0200
+commit 995ad6c5a415c9389d094d246ca1b305c1e31813
+Author: Tomas Winkler <tomas.winkler at intel.com>
+Date:   Thu Jun 12 20:08:19 2008 +0300
 
-    mac80211: remove message on receiving unexpected unencrypted frames
-    
-    Some people are getting this message a lot, and we have traced it to
-    broken access points that much too often send completely empty frames
-    (all bytes zeroed, which they shouldn't do at all.)
+    mac80211: add missing new line in debug print HT_DEBUG
     
-    Since we cannot do anything about such frames in any case except the
-    special case where we're debugging an AP, just remove the message.
+    This patch adds '\n' in debug printk (wme.c HT DEBUG)
     
-    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 2dd0f69222c481574baf6a4affb9256a7c7410e7
-Author: Ivo van Doorn <ivdoorn at gmail.com>
-Date:   Sat Apr 12 19:25:00 2008 +0200
+commit 5c5f9664d5284d8542062fed39e1f19b80db7aa5
+Author: Abhijeet Kolekar <abhijeet.kolekar at intel.com>
+Date:   Thu Jun 12 09:47:16 2008 +0800
 
-    Update rt2x00 MAINTAINERS entry
+    mac80211 : fix for iwconfig in ad-hoc mode
     
-    Add the tree entry for rt2x00 to inform people about the
-    rt2x00.git tree.
+    The patch checks interface status, if it is in IBSS_JOINED mode
+    show cell id it is associated with.
     
-    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar at intel.com>
+    Signed-off-by: Zhu Yi <yi.zhu at intel.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit e089764596ccde1037f2849fcee002c68986e67c
-Author: Ivo van Doorn <ivdoorn at gmail.com>
-Date:   Sat Apr 12 19:23:55 2008 +0200
+commit e6340361f9c70e84312caed98c6e058ac6234e9b
+Author: Michael Buesch <mb at bu3sch.de>
+Date:   Thu Jun 12 15:33:13 2008 +0200
 
-    Add rfkill to MAINTAINERS file
+    ssb: Fix coherent DMA mask for PCI devices
     
-    I have been acting as the maintainer since the rfkill introduction,
-    so lets make it official by adding a rfkill entry in the MAINTAINERS file.
+    This fixes setting the coherent DMA mask for PCI devices.
     
-    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 89796f64a20d31e74ee0051df2e26812c852e734
-Author: Carlos Corbacho <carlos at strangeworlds.co.uk>
-Date:   Sat Apr 12 16:39:47 2008 +0100
-
-    rfkill: Fix device type check when toggling states
-    
-    rfkill_switch_all() is supposed to only switch all the interfaces of a
-    given type, but does not actually do this; instead, it just switches
-    everything currently in the same state.
-    
-    Add the necessary type check in.
-    
-    (This fixes a bug I've been seeing while developing an rfkill laptop
-    driver, with both bluetooth and wireless simultaneously changing state
-    after only pressing either KEY_WLAN or KEY_BLUETOOTH).
+commit 6847aa5cce6e22c3625a243b02909ac46aafa110
+Author: Randy Dunlap <randy.dunlap at oracle.com>
+Date:   Wed Jun 11 13:32:22 2008 -0700
+
+    rt2x00: LEDS build failure
+    
+    Config symbols that select LEDS_CLASS need to depend on NEW_LEDS so that
+    undefined symbols are not used in the build.
+    
+    The alternative is to select NEW_LEDS, which some drivers do.
+    
+    This patch fixes the led_* symbols build errors.
+    
+    (.text+0x174cdc): undefined reference to `input_unregister_device'
+    (.text+0x174d9f): undefined reference to `input_allocate_device'
+    (.text+0x174e2d): undefined reference to `input_register_device'
+    (.text+0x174e53): undefined reference to `input_free_device'
+    rt2x00rfkill.c:(.text+0x176dc4): undefined reference to `input_allocate_polled_device'
+    rt2x00rfkill.c:(.text+0x176e8b): undefined reference to `input_event'
+    rt2x00rfkill.c:(.text+0x176e9f): undefined reference to `input_event'
+    (.text+0x176eca): undefined reference to `input_unregister_polled_device'
+    (.text+0x176efc): undefined reference to `input_free_polled_device'
+    (.text+0x176f37): undefined reference to `input_free_polled_device'
+    (.text+0x176fd8): undefined reference to `input_register_polled_device'
+    (.text+0x1772c0): undefined reference to `led_classdev_resume'
+    (.text+0x1772d4): undefined reference to `led_classdev_resume'
+    (.text+0x1772e8): undefined reference to `led_classdev_resume'
+    (.text+0x17730a): undefined reference to `led_classdev_suspend'
+    (.text+0x17731e): undefined reference to `led_classdev_suspend'
+    (.text+0x17732f): undefined reference to `led_classdev_suspend'
+    rt2x00leds.c:(.text+0x177348): undefined reference to `led_classdev_unregister'
+    rt2x00leds.c:(.text+0x1773c0): undefined reference to `led_classdev_register'
+    rfkill-input.c:(.text+0x209e4c): undefined reference to `input_close_device'
+    rfkill-input.c:(.text+0x209e53): undefined reference to `input_unregister_handle'
+    rfkill-input.c:(.text+0x209ea1): undefined reference to `input_register_handle'
+    rfkill-input.c:(.text+0x209eae): undefined reference to `input_open_device'
+    rfkill-input.c:(.text+0x209ebb): undefined reference to `input_unregister_handle'
+    rfkill-input.c:(.init.text+0x17405): undefined reference to `input_register_handler'
+    rfkill-input.c:(.exit.text+0x194f): undefined reference to `input_unregister_handler'
+    make[1]: *** [vmlinux] Error 1
+    
+    Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
+    Acked-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit e76328e4a8260707fbc29c99773fb5ba4627096c
+Author: Randy Dunlap <randy.dunlap at oracle.com>
+Date:   Wed Jun 11 12:57:58 2008 -0700
+
+    rt2x00: INPUT build failure
+    
+    Config symbols that select RFKILL need to depend on INPUT so that
+    undefined symbols are not used in the build.
+    
+    This patch fixes the input_* symbols build errors.
+    
+    (.text+0x174cdc): undefined reference to `input_unregister_device'
+    (.text+0x174d9f): undefined reference to `input_allocate_device'
+    (.text+0x174e2d): undefined reference to `input_register_device'
+    (.text+0x174e53): undefined reference to `input_free_device'
+    rt2x00rfkill.c:(.text+0x176dc4): undefined reference to `input_allocate_polled_device'
+    rt2x00rfkill.c:(.text+0x176e8b): undefined reference to `input_event'
+    rt2x00rfkill.c:(.text+0x176e9f): undefined reference to `input_event'
+    (.text+0x176eca): undefined reference to `input_unregister_polled_device'
+    (.text+0x176efc): undefined reference to `input_free_polled_device'
+    (.text+0x176f37): undefined reference to `input_free_polled_device'
+    (.text+0x176fd8): undefined reference to `input_register_polled_device'
+    (.text+0x1772c0): undefined reference to `led_classdev_resume'
+    (.text+0x1772d4): undefined reference to `led_classdev_resume'
+    (.text+0x1772e8): undefined reference to `led_classdev_resume'
+    (.text+0x17730a): undefined reference to `led_classdev_suspend'
+    (.text+0x17731e): undefined reference to `led_classdev_suspend'
+    (.text+0x17732f): undefined reference to `led_classdev_suspend'
+    rt2x00leds.c:(.text+0x177348): undefined reference to `led_classdev_unregister'
+    rt2x00leds.c:(.text+0x1773c0): undefined reference to `led_classdev_register'
+    rfkill-input.c:(.text+0x209e4c): undefined reference to `input_close_device'
+    rfkill-input.c:(.text+0x209e53): undefined reference to `input_unregister_handle'
+    rfkill-input.c:(.text+0x209ea1): undefined reference to `input_register_handle'
+    rfkill-input.c:(.text+0x209eae): undefined reference to `input_open_device'
+    rfkill-input.c:(.text+0x209ebb): undefined reference to `input_unregister_handle'
+    rfkill-input.c:(.init.text+0x17405): undefined reference to `input_register_handler'
+    rfkill-input.c:(.exit.text+0x194f): undefined reference to `input_unregister_handler'
+    make[1]: *** [vmlinux] Error 1
     
-    Signed-off-by: Carlos Corbacho <carlos at strangeworlds.co.uk>
+    Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
+    Acked-by: Ivo van Doorn <IvDoorn at gmail.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit cdbbe3d1f53086ece706674d3bf4f6d148083694
+commit 98a3b2fe435ae76170936c14f5c9e6a87548e3ef
 Author: Michael Buesch <mb at bu3sch.de>
-Date:   Fri Apr 11 12:16:36 2008 +0200
+Date:   Thu Jun 12 12:36:29 2008 +0200
 
-    b43legacy: Fix usage of struct device used for DMAing
+    b43: Fix noise calculation WARN_ON
     
-    This fixes b43legacy for the SSB DMA API change.
+    This removes a WARN_ON that is responsible for the following koops:
+    http://www.kerneloops.org/searchweek.php?search=b43_generate_noise_sample
+    
+    The comment in the patch describes why it's safe to simply remove
+    the check.
     
     Signed-off-by: Michael Buesch <mb at bu3sch.de>
-    Cc: Stefano Brivio <stefano.brivio at polimi.it>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 4ac58469f13028e1eb97f8bc7b0fca5072591d8d
+commit 028118a5f09a9c807e6b43e2231efdff9f224c74
 Author: Michael Buesch <mb at bu3sch.de>
-Date:   Fri Apr 11 11:59:00 2008 +0200
+Date:   Thu Jun 12 11:58:56 2008 +0200
 
-    ssb: Fix usage of struct device used for DMAing
+    b43: Fix possible NULL pointer dereference in DMA code
     
-    This fixes DMA on architectures where DMA is nontrivial, like PPC64.
-    We must use the host-device's (PCI) struct device for any DMA
-    operation instead of the SSB device. For this we add a new
-    struct device pointer to the SSB device structure that will always
-    point to the right device for DMAing.
+    This fixes a possible NULL pointer dereference in an error path of the
+    DMA allocation error checking code. This is also necessary for a future
+    DMA API change that is on its way into the mainline kernel that adds
+    an additional dev parameter to dma_mapping_error().
     
-    Without this patch b43 and b44 drivers won't work on complex-DMA
-    architectures, that for example need dev->archdata for DMA operations.
+    This patch moves the whole struct b43_dmaring struct initialization
+    right before any DMA allocation operation.
     
+    Reported-by: Miles Lane <miles.lane at gmail.com>
     Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 2d4543fdb487b1301ae48703dea3e66ead2d3c75
-Author: Reinette Chatre <reinette.chatre at intel.com>
-Date:   Thu Apr 10 13:16:27 2008 -0700
+commit 051c256f672efa356a4cda1841132dbc86541090
+Author: Gertjan van Wingerde <gwingerde at kpnplanet.nl>
+Date:   Tue Jun 3 20:29:47 2008 +0200
 
-    MAINTAINERS: move to generic repository for iwlwifi
+    rt2x00: Restrict DMA to 32-bit addresses.
     
-    Signed-off-by: Reinette Chatre <reinette.chatre at intel.com>
-    Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit 385f848a986b4677bc91e5f5f9033449a876819d
-Author: Stefano Brivio <stefano.brivio at polimi.it>
-Date:   Sun Apr 6 17:10:53 2008 +0200
-
-    b43legacy: fix initvals loading on bcm4303
-    
-    This allows for the correct initial values to be uploaded to bcm4303
-    devices. It should be correct, but I can't reliably test this as I suspect
-    there's something going wrong with an hardware rfkill switch on my laptop.
-    Please test.
+    None of the rt2x00 PCI devices support 64-bit DMA addresses (they all
+    only accept 32-bit buffer addresses). Hence it makes no sense to try to
+    enable 64-bit DMA addresses. Only try to enable 32-bit DMA addresses.
     
-    Signed-off-by: Stefano Brivio <stefano.brivio at polimi.it>
+    Signed-off-by: Gertjan van Wingerde <gwingerde at kpnplanet.nl>
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit aa979a6acbb468b0ebe8cf36dc782a5b3cc1e28d
-Author: Herton Ronaldo Krzesinski <herton at mandriva.com.br>
-Date:   Wed Apr 9 16:38:31 2008 -0300
-
-    rtl8187: Add missing priv->vif assignments
-    
-    This adds missing priv->vif assignments after "mac80211: don't use
-    interface indices in drivers" change. As rtl8180, rtl8187 also needs
-    priv->vif to be set, as without this an oops can happen in rtl8187_tx
-    function (priv->vif is passed to ieee80211_rts_duration).
+commit edfa78b2ba651782d70be6d1fef214e21a26d8cb
+Author: Ivo van Doorn <IvDoorn at gmail.com>
+Date:   Tue Jun 3 20:29:50 2008 +0200
+
+    rt2x00: Don't kill guardian_urb when it wasn't created
+    
+    This fixes a "BUG: unable to handle kernel paging request"
+    bug in rt73usb which was caused by killing the guardian_urb
+    while it had never been allocated for rt73usb.
     
-    Signed-off-by: Herton Ronaldo Krzesinski <herton at mandriva.com.br>
-    Acked-by: Pavel Roskin <proski at gnu.org>
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-diff -up linux-2.6.24.noarch/include/linux/ssb/ssb.h.orig linux-2.6.24.noarch/include/linux/ssb/ssb.h
---- linux-2.6.24.noarch/include/linux/ssb/ssb.h.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/include/linux/ssb/ssb.h	2008-04-15 16:00:51.000000000 -0400
-@@ -129,6 +129,10 @@ struct ssb_device {
- 	const struct ssb_bus_ops *ops;
- 
- 	struct device *dev;
-+	/* Pointer to the device that has to be used for
-+	 * any DMA related operation. */
-+	struct device *dma_dev;
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig	2008-06-13 17:37:04.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h	2008-06-13 17:37:35.000000000 -0400
+@@ -630,7 +630,6 @@ struct b43_pio {
+ 
+ /* Context information for a noise calculation (Link Quality). */
+ struct b43_noise_calculation {
+-	u8 channel_at_start;
+ 	bool calculation_running;
+ 	u8 nr_samples;
+ 	s8 samples[8][4];
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/dma.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/dma.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/dma.c.orig	2008-06-13 17:37:04.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/dma.c	2008-06-13 17:37:35.000000000 -0400
+@@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(st
+ {
+ 	struct b43_dmaring *ring;
+ 	int err;
+-	int nr_slots;
+ 	dma_addr_t dma_test;
+ 
+ 	ring = kzalloc(sizeof(*ring), GFP_KERNEL);
+ 	if (!ring)
+ 		goto out;
+-	ring->type = type;
+ 
+-	nr_slots = B43_RXRING_SLOTS;
++	ring->nr_slots = B43_RXRING_SLOTS;
+ 	if (for_tx)
+-		nr_slots = B43_TXRING_SLOTS;
++		ring->nr_slots = B43_TXRING_SLOTS;
+ 
+-	ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta),
++	ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta),
+ 			     GFP_KERNEL);
+ 	if (!ring->meta)
+ 		goto err_kfree_ring;
 +
- 	struct ssb_bus *bus;
- 	struct ssb_device_id id;
- 
-diff -up linux-2.6.24.noarch/MAINTAINERS.orig linux-2.6.24.noarch/MAINTAINERS
---- linux-2.6.24.noarch/MAINTAINERS.orig	2008-04-15 16:00:46.000000000 -0400
-+++ linux-2.6.24.noarch/MAINTAINERS	2008-04-15 16:00:51.000000000 -0400
-@@ -2116,7 +2116,7 @@ M:	reinette.chatre at intel.com
- L:	linux-wireless at vger.kernel.org
- L:	ipw3945-devel at lists.sourceforge.net
- W:	http://intellinuxwireless.org
--T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rchatre/iwlwifi-2.6.git
-+T:	git kernel.org:/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git
- S:	Supported
- 
- IOC3 ETHERNET DRIVER
-@@ -3280,6 +3280,7 @@ L:	linux-wireless at vger.kernel.org
- L:	rt2400-devel at lists.sourceforge.net
- W:	http://rt2x00.serialmonkey.com/
- S:	Maintained
-+T:	git kernel.org:/pub/scm/linux/kernel/git/ivd/rt2x00.git
- F:	drivers/net/wireless/rt2x00/
- 
- RAMDISK RAM BLOCK DEVICE DRIVER
-@@ -3342,6 +3343,13 @@ L:	reiserfs-devel at vger.kernel.org
- W:	http://www.namesys.com
- S:	Supported
- 
-+RFKILL
-+P:	Ivo van Doorn
-+M:	IvDoorn at gmail.com
-+L:	netdev at vger.kernel.org
-+S:	Maintained
-+F:	net/rfkill
++	ring->type = type;
++	ring->dev = dev;
++	ring->mmio_base = b43_dmacontroller_base(type, controller_index);
++	ring->index = controller_index;
++	if (type == B43_DMA_64BIT)
++		ring->ops = &dma64_ops;
++	else
++		ring->ops = &dma32_ops;
+ 	if (for_tx) {
+-		ring->txhdr_cache = kcalloc(nr_slots,
++		ring->tx = 1;
++		ring->current_slot = -1;
++	} else {
++		if (ring->index == 0) {
++			ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
++			ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
++		} else if (ring->index == 3) {
++			ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
++			ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
++		} else
++			B43_WARN_ON(1);
++	}
++	spin_lock_init(&ring->lock);
++#ifdef CONFIG_B43_DEBUG
++	ring->last_injected_overflow = jiffies;
++#endif
 +
- ROCKETPORT DRIVER
- P:	Comtrol Corp.
- W:	http://www.comtrol.com
-diff -up linux-2.6.24.noarch/net/rfkill/rfkill.c.orig linux-2.6.24.noarch/net/rfkill/rfkill.c
---- linux-2.6.24.noarch/net/rfkill/rfkill.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/net/rfkill/rfkill.c	2008-04-15 16:00:51.000000000 -0400
-@@ -92,7 +92,7 @@ void rfkill_switch_all(enum rfkill_type 
- 	rfkill_states[type] = state;
- 
- 	list_for_each_entry(rfkill, &rfkill_list, node) {
--		if (!rfkill->user_claim)
-+		if ((!rfkill->user_claim) && (rfkill->type == type))
- 			rfkill_toggle_radio(rfkill, state);
- 	}
- 
-diff -up linux-2.6.24.noarch/net/mac80211/rx.c.orig linux-2.6.24.noarch/net/mac80211/rx.c
---- linux-2.6.24.noarch/net/mac80211/rx.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/net/mac80211/rx.c	2008-04-15 16:00:51.000000000 -0400
-@@ -1050,12 +1050,9 @@ ieee80211_drop_unencrypted(struct ieee80
- 	if (unlikely(!(rx->fc & IEEE80211_FCTL_PROTECTED) &&
- 		     (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA &&
- 		     (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_NULLFUNC &&
--		     (rx->key || rx->sdata->drop_unencrypted))) {
--		if (net_ratelimit())
--			printk(KERN_DEBUG "%s: RX non-WEP frame, but expected "
--			       "encryption\n", rx->dev->name);
-+		     (rx->key || rx->sdata->drop_unencrypted)))
- 		return -EACCES;
--	}
-+
- 	return 0;
- }
- 
-diff -up linux-2.6.24.noarch/drivers/net/b44.c.orig linux-2.6.24.noarch/drivers/net/b44.c
---- linux-2.6.24.noarch/drivers/net/b44.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/b44.c	2008-04-15 16:00:51.000000000 -0400
-@@ -148,7 +148,7 @@ static inline void b44_sync_dma_desc_for
- 						unsigned long offset,
- 						enum dma_data_direction dir)
- {
--	dma_sync_single_range_for_device(sdev->dev, dma_base,
-+	dma_sync_single_range_for_device(sdev->dma_dev, dma_base,
- 					 offset & dma_desc_align_mask,
- 					 dma_desc_sync_size, dir);
- }
-@@ -158,7 +158,7 @@ static inline void b44_sync_dma_desc_for
- 					     unsigned long offset,
- 					     enum dma_data_direction dir)
- {
--	dma_sync_single_range_for_cpu(sdev->dev, dma_base,
-+	dma_sync_single_range_for_cpu(sdev->dma_dev, dma_base,
- 				      offset & dma_desc_align_mask,
- 				      dma_desc_sync_size, dir);
- }
-@@ -613,7 +613,7 @@ static void b44_tx(struct b44 *bp)
- 
- 		BUG_ON(skb == NULL);
- 
--		dma_unmap_single(bp->sdev->dev,
-+		dma_unmap_single(bp->sdev->dma_dev,
- 				 rp->mapping,
- 				 skb->len,
- 				 DMA_TO_DEVICE);
-@@ -653,7 +653,7 @@ static int b44_alloc_rx_skb(struct b44 *
- 	if (skb == NULL)
- 		return -ENOMEM;
- 
--	mapping = dma_map_single(bp->sdev->dev, skb->data,
-+	mapping = dma_map_single(bp->sdev->dma_dev, skb->data,
- 				 RX_PKT_BUF_SZ,
- 				 DMA_FROM_DEVICE);
- 
-@@ -663,19 +663,19 @@ static int b44_alloc_rx_skb(struct b44 *
- 		mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
- 		/* Sigh... */
- 		if (!dma_mapping_error(mapping))
--			dma_unmap_single(bp->sdev->dev, mapping,
-+			dma_unmap_single(bp->sdev->dma_dev, mapping,
- 					RX_PKT_BUF_SZ, DMA_FROM_DEVICE);
- 		dev_kfree_skb_any(skb);
- 		skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA);
- 		if (skb == NULL)
- 			return -ENOMEM;
--		mapping = dma_map_single(bp->sdev->dev, skb->data,
-+		mapping = dma_map_single(bp->sdev->dma_dev, skb->data,
- 					 RX_PKT_BUF_SZ,
- 					 DMA_FROM_DEVICE);
- 		if (dma_mapping_error(mapping) ||
- 			mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
- 			if (!dma_mapping_error(mapping))
--				dma_unmap_single(bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
-+				dma_unmap_single(bp->sdev->dma_dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
- 			dev_kfree_skb_any(skb);
- 			return -ENOMEM;
- 		}
-@@ -750,7 +750,7 @@ static void b44_recycle_rx(struct b44 *b
- 					     dest_idx * sizeof(dest_desc),
- 					     DMA_BIDIRECTIONAL);
- 
--	dma_sync_single_for_device(bp->sdev->dev, le32_to_cpu(src_desc->addr),
-+	dma_sync_single_for_device(bp->sdev->dma_dev, le32_to_cpu(src_desc->addr),
- 				   RX_PKT_BUF_SZ,
- 				   DMA_FROM_DEVICE);
- }
-@@ -772,7 +772,7 @@ static int b44_rx(struct b44 *bp, int bu
- 		struct rx_header *rh;
- 		u16 len;
- 
--		dma_sync_single_for_cpu(bp->sdev->dev, map,
-+		dma_sync_single_for_cpu(bp->sdev->dma_dev, map,
- 					    RX_PKT_BUF_SZ,
- 					    DMA_FROM_DEVICE);
- 		rh = (struct rx_header *) skb->data;
-@@ -806,7 +806,7 @@ static int b44_rx(struct b44 *bp, int bu
- 			skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod);
- 			if (skb_size < 0)
- 				goto drop_it;
--			dma_unmap_single(bp->sdev->dev, map,
-+			dma_unmap_single(bp->sdev->dma_dev, map,
- 					 skb_size, DMA_FROM_DEVICE);
- 			/* Leave out rx_header */
-                 	skb_put(skb, len + RX_PKT_OFFSET);
-@@ -966,24 +966,24 @@ static int b44_start_xmit(struct sk_buff
- 		goto err_out;
- 	}
- 
--	mapping = dma_map_single(bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);
-+	mapping = dma_map_single(bp->sdev->dma_dev, skb->data, len, DMA_TO_DEVICE);
- 	if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
- 		struct sk_buff *bounce_skb;
- 
- 		/* Chip can't handle DMA to/from >1GB, use bounce buffer */
- 		if (!dma_mapping_error(mapping))
--			dma_unmap_single(bp->sdev->dev, mapping, len,
-+			dma_unmap_single(bp->sdev->dma_dev, mapping, len,
- 					DMA_TO_DEVICE);
- 
- 		bounce_skb = __dev_alloc_skb(len, GFP_ATOMIC | GFP_DMA);
- 		if (!bounce_skb)
- 			goto err_out;
- 
--		mapping = dma_map_single(bp->sdev->dev, bounce_skb->data,
-+		mapping = dma_map_single(bp->sdev->dma_dev, bounce_skb->data,
- 					 len, DMA_TO_DEVICE);
- 		if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
- 			if (!dma_mapping_error(mapping))
--				dma_unmap_single(bp->sdev->dev, mapping,
-+				dma_unmap_single(bp->sdev->dma_dev, mapping,
- 					 len, DMA_TO_DEVICE);
- 			dev_kfree_skb_any(bounce_skb);
- 			goto err_out;
-@@ -1082,7 +1082,7 @@ static void b44_free_rings(struct b44 *b
- 
- 		if (rp->skb == NULL)
- 			continue;
--		dma_unmap_single(bp->sdev->dev, rp->mapping, RX_PKT_BUF_SZ,
-+		dma_unmap_single(bp->sdev->dma_dev, rp->mapping, RX_PKT_BUF_SZ,
- 					DMA_FROM_DEVICE);
- 		dev_kfree_skb_any(rp->skb);
- 		rp->skb = NULL;
-@@ -1094,7 +1094,7 @@ static void b44_free_rings(struct b44 *b
- 
- 		if (rp->skb == NULL)
- 			continue;
--		dma_unmap_single(bp->sdev->dev, rp->mapping, rp->skb->len,
-+		dma_unmap_single(bp->sdev->dma_dev, rp->mapping, rp->skb->len,
- 					DMA_TO_DEVICE);
- 		dev_kfree_skb_any(rp->skb);
- 		rp->skb = NULL;
-@@ -1117,12 +1117,12 @@ static void b44_init_rings(struct b44 *b
- 	memset(bp->tx_ring, 0, B44_TX_RING_BYTES);
- 
- 	if (bp->flags & B44_FLAG_RX_RING_HACK)
--		dma_sync_single_for_device(bp->sdev->dev, bp->rx_ring_dma,
-+		dma_sync_single_for_device(bp->sdev->dma_dev, bp->rx_ring_dma,
- 			                  DMA_TABLE_BYTES,
- 			                  DMA_BIDIRECTIONAL);
- 
- 	if (bp->flags & B44_FLAG_TX_RING_HACK)
--		dma_sync_single_for_device(bp->sdev->dev, bp->tx_ring_dma,
-+		dma_sync_single_for_device(bp->sdev->dma_dev, bp->tx_ring_dma,
- 			                  DMA_TABLE_BYTES,
- 			                  DMA_TO_DEVICE);
- 
-@@ -1144,24 +1144,24 @@ static void b44_free_consistent(struct b
- 	bp->tx_buffers = NULL;
- 	if (bp->rx_ring) {
- 		if (bp->flags & B44_FLAG_RX_RING_HACK) {
--			dma_unmap_single(bp->sdev->dev, bp->rx_ring_dma,
-+			dma_unmap_single(bp->sdev->dma_dev, bp->rx_ring_dma,
- 					DMA_TABLE_BYTES,
- 					DMA_BIDIRECTIONAL);
- 			kfree(bp->rx_ring);
- 		} else
--			dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
-+			dma_free_coherent(bp->sdev->dma_dev, DMA_TABLE_BYTES,
- 					    bp->rx_ring, bp->rx_ring_dma);
- 		bp->rx_ring = NULL;
- 		bp->flags &= ~B44_FLAG_RX_RING_HACK;
- 	}
- 	if (bp->tx_ring) {
- 		if (bp->flags & B44_FLAG_TX_RING_HACK) {
--			dma_unmap_single(bp->sdev->dev, bp->tx_ring_dma,
-+			dma_unmap_single(bp->sdev->dma_dev, bp->tx_ring_dma,
- 					DMA_TABLE_BYTES,
- 					DMA_TO_DEVICE);
- 			kfree(bp->tx_ring);
- 		} else
--			dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
-+			dma_free_coherent(bp->sdev->dma_dev, DMA_TABLE_BYTES,
- 					    bp->tx_ring, bp->tx_ring_dma);
- 		bp->tx_ring = NULL;
- 		bp->flags &= ~B44_FLAG_TX_RING_HACK;
-@@ -1187,7 +1187,7 @@ static int b44_alloc_consistent(struct b
- 		goto out_err;
- 
- 	size = DMA_TABLE_BYTES;
--	bp->rx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->rx_ring_dma, gfp);
-+	bp->rx_ring = dma_alloc_coherent(bp->sdev->dma_dev, size, &bp->rx_ring_dma, gfp);
- 	if (!bp->rx_ring) {
- 		/* Allocation may have failed due to pci_alloc_consistent
- 		   insisting on use of GFP_DMA, which is more restrictive
-@@ -1199,7 +1199,7 @@ static int b44_alloc_consistent(struct b
- 		if (!rx_ring)
- 			goto out_err;
- 
--		rx_ring_dma = dma_map_single(bp->sdev->dev, rx_ring,
-+		rx_ring_dma = dma_map_single(bp->sdev->dma_dev, rx_ring,
- 			                    DMA_TABLE_BYTES,
- 			                    DMA_BIDIRECTIONAL);
- 
-@@ -1214,7 +1214,7 @@ static int b44_alloc_consistent(struct b
- 		bp->flags |= B44_FLAG_RX_RING_HACK;
- 	}
- 
--	bp->tx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->tx_ring_dma, gfp);
-+	bp->tx_ring = dma_alloc_coherent(bp->sdev->dma_dev, size, &bp->tx_ring_dma, gfp);
- 	if (!bp->tx_ring) {
- 		/* Allocation may have failed due to dma_alloc_coherent
- 		   insisting on use of GFP_DMA, which is more restrictive
-@@ -1226,7 +1226,7 @@ static int b44_alloc_consistent(struct b
- 		if (!tx_ring)
- 			goto out_err;
- 
--		tx_ring_dma = dma_map_single(bp->sdev->dev, tx_ring,
-+		tx_ring_dma = dma_map_single(bp->sdev->dma_dev, tx_ring,
- 			                    DMA_TABLE_BYTES,
- 			                    DMA_TO_DEVICE);
- 
-diff -up linux-2.6.24.noarch/drivers/net/ps3_gelic_wireless.c.orig linux-2.6.24.noarch/drivers/net/ps3_gelic_wireless.c
---- linux-2.6.24.noarch/drivers/net/ps3_gelic_wireless.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/ps3_gelic_wireless.c	2008-04-15 16:00:51.000000000 -0400
-@@ -512,13 +512,18 @@ static void gelic_wl_parse_ie(u8 *data, 
- 		 data, len);
- 	memset(ie_info, 0, sizeof(struct ie_info));
- 
--	while (0 < data_left) {
-+	while (2 <= data_left) {
- 		item_id = *pos++;
- 		item_len = *pos++;
-+		data_left -= 2;
-+
-+		if (data_left < item_len)
-+			break;
- 
- 		switch (item_id) {
- 		case MFIE_TYPE_GENERIC:
--			if (!memcmp(pos, wpa_oui, OUI_LEN) &&
-+			if ((OUI_LEN + 1 <= item_len) &&
-+			    !memcmp(pos, wpa_oui, OUI_LEN) &&
- 			    pos[OUI_LEN] == 0x01) {
- 				ie_info->wpa.data = pos - 2;
- 				ie_info->wpa.len = item_len + 2;
-@@ -535,7 +540,7 @@ static void gelic_wl_parse_ie(u8 *data, 
- 			break;
- 		}
- 		pos += item_len;
--		data_left -= item_len + 2;
-+		data_left -= item_len;
- 	}
- 	pr_debug("%s: wpa=%p,%d wpa2=%p,%d\n", __func__,
- 		 ie_info->wpa.data, ie_info->wpa.len,
-diff -up linux-2.6.24.noarch/drivers/net/wireless/b43/dma.c.orig linux-2.6.24.noarch/drivers/net/wireless/b43/dma.c
---- linux-2.6.24.noarch/drivers/net/wireless/b43/dma.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/wireless/b43/dma.c	2008-04-15 16:00:51.000000000 -0400
-@@ -373,10 +373,10 @@ static inline
- 	dma_addr_t dmaaddr;
- 
- 	if (tx) {
--		dmaaddr = dma_map_single(ring->dev->dev->dev,
-+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
- 					 buf, len, DMA_TO_DEVICE);
- 	} else {
--		dmaaddr = dma_map_single(ring->dev->dev->dev,
-+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
- 					 buf, len, DMA_FROM_DEVICE);
- 	}
- 
-@@ -388,9 +388,10 @@ static inline
- 			  dma_addr_t addr, size_t len, int tx)
- {
- 	if (tx) {
--		dma_unmap_single(ring->dev->dev->dev, addr, len, DMA_TO_DEVICE);
-+		dma_unmap_single(ring->dev->dev->dma_dev,
-+				 addr, len, DMA_TO_DEVICE);
- 	} else {
--		dma_unmap_single(ring->dev->dev->dev,
-+		dma_unmap_single(ring->dev->dev->dma_dev,
- 				 addr, len, DMA_FROM_DEVICE);
- 	}
- }
-@@ -400,7 +401,7 @@ static inline
- 				 dma_addr_t addr, size_t len)
- {
- 	B43_WARN_ON(ring->tx);
--	dma_sync_single_for_cpu(ring->dev->dev->dev,
-+	dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
- 				addr, len, DMA_FROM_DEVICE);
- }
- 
-@@ -409,7 +410,7 @@ static inline
- 				    dma_addr_t addr, size_t len)
- {
- 	B43_WARN_ON(ring->tx);
--	dma_sync_single_for_device(ring->dev->dev->dev,
-+	dma_sync_single_for_device(ring->dev->dev->dma_dev,
- 				   addr, len, DMA_FROM_DEVICE);
- }
- 
-@@ -425,7 +426,7 @@ static inline
- 
- static int alloc_ringmemory(struct b43_dmaring *ring)
- {
--	struct device *dev = ring->dev->dev->dev;
-+	struct device *dma_dev = ring->dev->dev->dma_dev;
- 	gfp_t flags = GFP_KERNEL;
- 
- 	/* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
-@@ -439,7 +440,7 @@ static int alloc_ringmemory(struct b43_d
- 	 */
- 	if (ring->type == B43_DMA_64BIT)
- 		flags |= GFP_DMA;
--	ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
-+	ring->descbase = dma_alloc_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
- 					    &(ring->dmabase), flags);
- 	if (!ring->descbase) {
- 		b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
-@@ -452,9 +453,9 @@ static int alloc_ringmemory(struct b43_d
- 
- static void free_ringmemory(struct b43_dmaring *ring)
- {
--	struct device *dev = ring->dev->dev->dev;
-+	struct device *dma_dev = ring->dev->dev->dma_dev;
- 
--	dma_free_coherent(dev, B43_DMA_RINGMEMSIZE,
-+	dma_free_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
- 			  ring->descbase, ring->dmabase);
- }
- 
-@@ -854,7 +855,7 @@ struct b43_dmaring *b43_setup_dmaring(st
- 			goto err_kfree_meta;
- 
- 		/* test for ability to dma to txhdr_cache */
--		dma_test = dma_map_single(dev->dev->dev,
-+		dma_test = dma_map_single(dev->dev->dma_dev,
- 					  ring->txhdr_cache,
- 					  b43_txhdr_size(dev),
- 					  DMA_TO_DEVICE);
-@@ -869,7 +870,7 @@ struct b43_dmaring *b43_setup_dmaring(st
- 			if (!ring->txhdr_cache)
- 				goto err_kfree_meta;
- 
--			dma_test = dma_map_single(dev->dev->dev,
-+			dma_test = dma_map_single(dev->dev->dma_dev,
- 						  ring->txhdr_cache,
- 						  b43_txhdr_size(dev),
- 						  DMA_TO_DEVICE);
-@@ -883,7 +884,7 @@ struct b43_dmaring *b43_setup_dmaring(st
- 			}
- 		}
- 
--		dma_unmap_single(dev->dev->dev,
-+		dma_unmap_single(dev->dev->dma_dev,
- 				 dma_test, b43_txhdr_size(dev),
- 				 DMA_TO_DEVICE);
- 	}
-diff -up linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c
---- linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c	2008-04-15 16:00:51.000000000 -0400
-@@ -1488,6 +1488,7 @@ static int b43legacy_request_firmware(st
- 	}
- 	if (!fw->initvals) {
- 		switch (dev->phy.type) {
-+		case B43legacy_PHYTYPE_B:
- 		case B43legacy_PHYTYPE_G:
- 			if ((rev >= 5) && (rev <= 10))
- 				filename = "b0g0initvals5";
-@@ -1505,6 +1506,7 @@ static int b43legacy_request_firmware(st
- 	}
- 	if (!fw->initvals_band) {
- 		switch (dev->phy.type) {
-+		case B43legacy_PHYTYPE_B:
- 		case B43legacy_PHYTYPE_G:
- 			if ((rev >= 5) && (rev <= 10))
- 				filename = "b0g0bsinitvals5";
-diff -up linux-2.6.24.noarch/drivers/net/wireless/b43legacy/dma.c.orig linux-2.6.24.noarch/drivers/net/wireless/b43legacy/dma.c
---- linux-2.6.24.noarch/drivers/net/wireless/b43legacy/dma.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/wireless/b43legacy/dma.c	2008-04-15 16:00:51.000000000 -0400
-@@ -393,11 +393,11 @@ dma_addr_t map_descbuffer(struct b43lega
- 	dma_addr_t dmaaddr;
- 
- 	if (tx)
--		dmaaddr = dma_map_single(ring->dev->dev->dev,
-+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
- 					 buf, len,
- 					 DMA_TO_DEVICE);
- 	else
--		dmaaddr = dma_map_single(ring->dev->dev->dev,
-+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
- 					 buf, len,
- 					 DMA_FROM_DEVICE);
- 
-@@ -411,11 +411,11 @@ void unmap_descbuffer(struct b43legacy_d
- 		      int tx)
- {
- 	if (tx)
--		dma_unmap_single(ring->dev->dev->dev,
-+		dma_unmap_single(ring->dev->dev->dma_dev,
- 				 addr, len,
- 				 DMA_TO_DEVICE);
- 	else
--		dma_unmap_single(ring->dev->dev->dev,
-+		dma_unmap_single(ring->dev->dev->dma_dev,
- 				 addr, len,
- 				 DMA_FROM_DEVICE);
- }
-@@ -427,7 +427,7 @@ void sync_descbuffer_for_cpu(struct b43l
- {
- 	B43legacy_WARN_ON(ring->tx);
- 
--	dma_sync_single_for_cpu(ring->dev->dev->dev,
-+	dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
- 				addr, len, DMA_FROM_DEVICE);
- }
- 
-@@ -438,7 +438,7 @@ void sync_descbuffer_for_device(struct b
- {
- 	B43legacy_WARN_ON(ring->tx);
- 
--	dma_sync_single_for_device(ring->dev->dev->dev,
-+	dma_sync_single_for_device(ring->dev->dev->dma_dev,
- 				   addr, len, DMA_FROM_DEVICE);
- }
- 
-@@ -458,9 +458,9 @@ void free_descriptor_buffer(struct b43le
- 
- static int alloc_ringmemory(struct b43legacy_dmaring *ring)
- {
--	struct device *dev = ring->dev->dev->dev;
-+	struct device *dma_dev = ring->dev->dev->dma_dev;
- 
--	ring->descbase = dma_alloc_coherent(dev, B43legacy_DMA_RINGMEMSIZE,
-+	ring->descbase = dma_alloc_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
- 					    &(ring->dmabase), GFP_KERNEL);
- 	if (!ring->descbase) {
- 		b43legacyerr(ring->dev->wl, "DMA ringmemory allocation"
-@@ -474,9 +474,9 @@ static int alloc_ringmemory(struct b43le
- 
- static void free_ringmemory(struct b43legacy_dmaring *ring)
- {
--	struct device *dev = ring->dev->dev->dev;
-+	struct device *dma_dev = ring->dev->dev->dma_dev;
- 
--	dma_free_coherent(dev, B43legacy_DMA_RINGMEMSIZE,
-+	dma_free_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
- 			  ring->descbase, ring->dmabase);
- }
- 
-@@ -585,8 +585,9 @@ static int b43legacy_dmacontroller_tx_re
- 
- /* Check if a DMA mapping address is invalid. */
- static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring,
--					dma_addr_t addr,
--					size_t buffersize)
-+					 dma_addr_t addr,
-+					 size_t buffersize,
-+					 bool dma_to_device)
- {
- 	if (unlikely(dma_mapping_error(addr)))
- 		return 1;
-@@ -594,11 +595,11 @@ static bool b43legacy_dma_mapping_error(
- 	switch (ring->type) {
- 	case B43legacy_DMA_30BIT:
- 		if ((u64)addr + buffersize > (1ULL << 30))
--			return 1;
-+			goto address_error;
- 		break;
- 	case B43legacy_DMA_32BIT:
- 		if ((u64)addr + buffersize > (1ULL << 32))
--			return 1;
-+			goto address_error;
- 		break;
- 	case B43legacy_DMA_64BIT:
- 		/* Currently we can't have addresses beyond 64 bits in the kernel. */
-@@ -607,6 +608,12 @@ static bool b43legacy_dma_mapping_error(
- 
- 	/* The address is OK. */
- 	return 0;
-+
-+address_error:
-+	/* We can't support this address. Unmap it again. */
-+	unmap_descbuffer(ring, addr, buffersize, dma_to_device);
-+
-+	return 1;
- }
- 
- static int setup_rx_descbuffer(struct b43legacy_dmaring *ring,
-@@ -626,7 +633,7 @@ static int setup_rx_descbuffer(struct b4
- 		return -ENOMEM;
- 	dmaaddr = map_descbuffer(ring, skb->data,
- 				 ring->rx_buffersize, 0);
--	if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
-+	if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
- 		/* ugh. try to realloc in zone_dma */
- 		gfp_flags |= GFP_DMA;
- 
-@@ -639,7 +646,7 @@ static int setup_rx_descbuffer(struct b4
- 					 ring->rx_buffersize, 0);
- 	}
- 
--	if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
-+	if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
- 		dev_kfree_skb_any(skb);
- 		return -EIO;
- 	}
-@@ -886,12 +893,12 @@ struct b43legacy_dmaring *b43legacy_setu
- 			goto err_kfree_meta;
- 
- 		/* test for ability to dma to txhdr_cache */
--		dma_test = dma_map_single(dev->dev->dev, ring->txhdr_cache,
-+		dma_test = dma_map_single(dev->dev->dma_dev, ring->txhdr_cache,
- 					  sizeof(struct b43legacy_txhdr_fw3),
- 					  DMA_TO_DEVICE);
- 
- 		if (b43legacy_dma_mapping_error(ring, dma_test,
--					sizeof(struct b43legacy_txhdr_fw3))) {
-+					sizeof(struct b43legacy_txhdr_fw3), 1)) {
++	if (for_tx) {
++		ring->txhdr_cache = kcalloc(ring->nr_slots,
+ 					    b43_txhdr_size(dev),
+ 					    GFP_KERNEL);
+ 		if (!ring->txhdr_cache)
+@@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(st
+ 					  b43_txhdr_size(dev), 1)) {
  			/* ugh realloc */
  			kfree(ring->txhdr_cache);
- 			ring->txhdr_cache = kcalloc(nr_slots,
-@@ -900,17 +907,17 @@ struct b43legacy_dmaring *b43legacy_setu
+-			ring->txhdr_cache = kcalloc(nr_slots,
++			ring->txhdr_cache = kcalloc(ring->nr_slots,
+ 						    b43_txhdr_size(dev),
+ 						    GFP_KERNEL | GFP_DMA);
  			if (!ring->txhdr_cache)
- 				goto err_kfree_meta;
- 
--			dma_test = dma_map_single(dev->dev->dev,
-+			dma_test = dma_map_single(dev->dev->dma_dev,
- 					ring->txhdr_cache,
- 					sizeof(struct b43legacy_txhdr_fw3),
- 					DMA_TO_DEVICE);
- 
- 			if (b43legacy_dma_mapping_error(ring, dma_test,
--					sizeof(struct b43legacy_txhdr_fw3)))
-+					sizeof(struct b43legacy_txhdr_fw3), 1))
- 				goto err_kfree_txhdr_cache;
- 		}
- 
--		dma_unmap_single(dev->dev->dev,
-+		dma_unmap_single(dev->dev->dma_dev,
- 				 dma_test, sizeof(struct b43legacy_txhdr_fw3),
+@@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(st
  				 DMA_TO_DEVICE);
  	}
-@@ -1235,7 +1242,7 @@ static int dma_tx_fragment(struct b43leg
- 	meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header,
- 					   sizeof(struct b43legacy_txhdr_fw3), 1);
- 	if (b43legacy_dma_mapping_error(ring, meta_hdr->dmaaddr,
--					sizeof(struct b43legacy_txhdr_fw3))) {
-+					sizeof(struct b43legacy_txhdr_fw3), 1)) {
- 		ring->current_slot = old_top_slot;
- 		ring->used_slots = old_used_slots;
- 		return -EIO;
-@@ -1254,7 +1261,7 @@ static int dma_tx_fragment(struct b43leg
- 
- 	meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
- 	/* create a bounce buffer in zone_dma on mapping failure. */
--	if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
-+	if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
- 		bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
- 		if (!bounce_skb) {
- 			ring->current_slot = old_top_slot;
-@@ -1268,7 +1275,7 @@ static int dma_tx_fragment(struct b43leg
- 		skb = bounce_skb;
- 		meta->skb = skb;
- 		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
--		if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
-+		if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
- 			ring->current_slot = old_top_slot;
- 			ring->used_slots = old_used_slots;
- 			err = -EIO;
-diff -up linux-2.6.24.noarch/drivers/net/wireless/rtl8187_dev.c.orig linux-2.6.24.noarch/drivers/net/wireless/rtl8187_dev.c
---- linux-2.6.24.noarch/drivers/net/wireless/rtl8187_dev.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/net/wireless/rtl8187_dev.c	2008-04-15 16:00:51.000000000 -0400
-@@ -509,6 +509,8 @@ static int rtl8187_add_interface(struct 
- 		return -EOPNOTSUPP;
- 	}
  
-+	priv->vif = conf->vif;
+-	ring->dev = dev;
+-	ring->nr_slots = nr_slots;
+-	ring->mmio_base = b43_dmacontroller_base(type, controller_index);
+-	ring->index = controller_index;
+-	if (type == B43_DMA_64BIT)
+-		ring->ops = &dma64_ops;
+-	else
+-		ring->ops = &dma32_ops;
+-	if (for_tx) {
+-		ring->tx = 1;
+-		ring->current_slot = -1;
+-	} else {
+-		if (ring->index == 0) {
+-			ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
+-			ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
+-		} else if (ring->index == 3) {
+-			ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
+-			ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
+-		} else
+-			B43_WARN_ON(1);
+-	}
+-	spin_lock_init(&ring->lock);
+-#ifdef CONFIG_B43_DEBUG
+-	ring->last_injected_overflow = jiffies;
+-#endif
+-
+ 	err = alloc_ringmemory(ring);
+ 	if (err)
+ 		goto err_kfree_txhdr_cache;
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/main.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig	2008-06-13 17:37:04.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/main.c	2008-06-13 17:37:35.000000000 -0400
+@@ -1145,7 +1145,6 @@ static void b43_generate_noise_sample(st
+ 	b43_jssi_write(dev, 0x7F7F7F7F);
+ 	b43_write32(dev, B43_MMIO_MACCMD,
+ 		    b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE);
+-	B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel);
+ }
+ 
+ static void b43_calculate_link_quality(struct b43_wldev *dev)
+@@ -1154,7 +1153,6 @@ static void b43_calculate_link_quality(s
+ 
+ 	if (dev->noisecalc.calculation_running)
+ 		return;
+-	dev->noisecalc.channel_at_start = dev->phy.channel;
+ 	dev->noisecalc.calculation_running = 1;
+ 	dev->noisecalc.nr_samples = 0;
+ 
+@@ -1171,9 +1169,16 @@ static void handle_irq_noise(struct b43_
+ 
+ 	/* Bottom half of Link Quality calculation. */
+ 
++	/* Possible race condition: It might be possible that the user
++	 * changed to a different channel in the meantime since we
++	 * started the calculation. We ignore that fact, since it's
++	 * not really that much of a problem. The background noise is
++	 * an estimation only anyway. Slightly wrong results will get damped
++	 * by the averaging of the 8 sample rounds. Additionally the
++	 * value is shortlived. So it will be replaced by the next noise
++	 * calculation round soon. */
 +
- 	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
- 	for (i = 0; i < ETH_ALEN; i++)
- 		rtl818x_iowrite8(priv, &priv->map->MAC[i],
-@@ -523,6 +525,7 @@ static void rtl8187_remove_interface(str
- {
- 	struct rtl8187_priv *priv = dev->priv;
- 	priv->mode = IEEE80211_IF_TYPE_MNTR;
-+	priv->vif = NULL;
- }
- 
- static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
-diff -up linux-2.6.24.noarch/drivers/ssb/main.c.orig linux-2.6.24.noarch/drivers/ssb/main.c
---- linux-2.6.24.noarch/drivers/ssb/main.c.orig	2008-04-15 16:00:47.000000000 -0400
-+++ linux-2.6.24.noarch/drivers/ssb/main.c	2008-04-15 16:00:51.000000000 -0400
-@@ -436,15 +436,18 @@ static int ssb_devices_register(struct s
- #ifdef CONFIG_SSB_PCIHOST
- 			sdev->irq = bus->host_pci->irq;
- 			dev->parent = &bus->host_pci->dev;
-+			sdev->dma_dev = &bus->host_pci->dev;
- #endif
- 			break;
- 		case SSB_BUSTYPE_PCMCIA:
- #ifdef CONFIG_SSB_PCMCIAHOST
- 			sdev->irq = bus->host_pcmcia->irq.AssignedIRQ;
- 			dev->parent = &bus->host_pcmcia->dev;
-+			sdev->dma_dev = &bus->host_pcmcia->dev;
- #endif
- 			break;
- 		case SSB_BUSTYPE_SSB:
-+			sdev->dma_dev = dev;
- 			break;
+ 	B43_WARN_ON(!dev->noisecalc.calculation_running);
+-	if (dev->noisecalc.channel_at_start != phy->channel)
+-		goto drop_calculation;
+ 	*((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
+ 	if (noise[0] == 0x7F || noise[1] == 0x7F ||
+ 	    noise[2] == 0x7F || noise[3] == 0x7F)
+@@ -1214,11 +1219,10 @@ static void handle_irq_noise(struct b43_
+ 			average -= 48;
+ 
+ 		dev->stats.link_noise = average;
+-	      drop_calculation:
+ 		dev->noisecalc.calculation_running = 0;
+ 		return;
+ 	}
+-      generate_new:
++generate_new:
+ 	b43_generate_noise_sample(dev);
+ }
+ 
+diff -up linux-2.6.25.noarch/drivers/net/wireless/rt2x00/Kconfig.orig linux-2.6.25.noarch/drivers/net/wireless/rt2x00/Kconfig
+--- linux-2.6.25.noarch/drivers/net/wireless/rt2x00/Kconfig.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/rt2x00/Kconfig	2008-06-13 17:37:35.000000000 -0400
+@@ -32,12 +32,13 @@ config RT2X00_LIB_FIRMWARE
+ config RT2X00_LIB_RFKILL
+ 	boolean
+ 	depends on RT2X00_LIB
++	depends on INPUT
+ 	select RFKILL
+ 	select INPUT_POLLDEV
+ 
+ config RT2X00_LIB_LEDS
+ 	boolean
+-	depends on RT2X00_LIB
++	depends on RT2X00_LIB && NEW_LEDS
+ 
+ config RT2400PCI
+ 	tristate "Ralink rt2400 pci/pcmcia support"
+@@ -51,7 +52,7 @@ config RT2400PCI
+ 
+ config RT2400PCI_RFKILL
+ 	bool "RT2400 rfkill support"
+-	depends on RT2400PCI
++	depends on RT2400PCI && INPUT
+ 	select RT2X00_LIB_RFKILL
+ 	---help---
+ 	  This adds support for integrated rt2400 devices that feature a
+@@ -60,7 +61,7 @@ config RT2400PCI_RFKILL
+ 
+ config RT2400PCI_LEDS
+ 	bool "RT2400 leds support"
+-	depends on RT2400PCI
++	depends on RT2400PCI && NEW_LEDS
+ 	select LEDS_CLASS
+ 	select RT2X00_LIB_LEDS
+ 	---help---
+@@ -78,7 +79,7 @@ config RT2500PCI
+ 
+ config RT2500PCI_RFKILL
+ 	bool "RT2500 rfkill support"
+-	depends on RT2500PCI
++	depends on RT2500PCI && INPUT
+ 	select RT2X00_LIB_RFKILL
+ 	---help---
+ 	  This adds support for integrated rt2500 devices that feature a
+@@ -87,7 +88,7 @@ config RT2500PCI_RFKILL
+ 
+ config RT2500PCI_LEDS
+ 	bool "RT2500 leds support"
+-	depends on RT2500PCI
++	depends on RT2500PCI && NEW_LEDS
+ 	select LEDS_CLASS
+ 	select RT2X00_LIB_LEDS
+ 	---help---
+@@ -107,7 +108,7 @@ config RT61PCI
+ 
+ config RT61PCI_RFKILL
+ 	bool "RT61 rfkill support"
+-	depends on RT61PCI
++	depends on RT61PCI && INPUT
+ 	select RT2X00_LIB_RFKILL
+ 	---help---
+ 	  This adds support for integrated rt61 devices that feature a
+@@ -116,7 +117,7 @@ config RT61PCI_RFKILL
+ 
+ config RT61PCI_LEDS
+ 	bool "RT61 leds support"
+-	depends on RT61PCI
++	depends on RT61PCI && NEW_LEDS
+ 	select LEDS_CLASS
+ 	select RT2X00_LIB_LEDS
+ 	---help---
+@@ -133,7 +134,7 @@ config RT2500USB
+ 
+ config RT2500USB_LEDS
+ 	bool "RT2500 leds support"
+-	depends on RT2500USB
++	depends on RT2500USB && NEW_LEDS
+ 	select LEDS_CLASS
+ 	select RT2X00_LIB_LEDS
+ 	---help---
+@@ -152,7 +153,7 @@ config RT73USB
+ 
+ config RT73USB_LEDS
+ 	bool "RT73 leds support"
+-	depends on RT73USB
++	depends on RT73USB && NEW_LEDS
+ 	select LEDS_CLASS
+ 	select RT2X00_LIB_LEDS
+ 	---help---
+diff -up linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00pci.c.orig linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00pci.c
+--- linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00pci.c.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00pci.c	2008-06-13 17:37:35.000000000 -0400
+@@ -412,8 +412,7 @@ int rt2x00pci_probe(struct pci_dev *pci_
+ 	if (pci_set_mwi(pci_dev))
+ 		ERROR_PROBE("MWI not available.\n");
+ 
+-	if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) &&
+-	    pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
++	if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
+ 		ERROR_PROBE("PCI DMA not supported.\n");
+ 		retval = -EIO;
+ 		goto exit_disable_device;
+diff -up linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c.orig linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c
+--- linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c	2008-06-13 17:37:35.000000000 -0400
+@@ -362,6 +362,12 @@ void rt2x00usb_disable_radio(struct rt2x
  		}
+ 	}
  
-@@ -1018,15 +1021,14 @@ EXPORT_SYMBOL(ssb_dma_translation);
- 
++	/*
++	 * Kill guardian urb (if required by driver).
++	 */
++	if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
++		return;
++
+ 	for (i = 0; i < rt2x00dev->bcn->limit; i++) {
+ 		priv_bcn = rt2x00dev->bcn->entries[i].priv_data;
+ 		usb_kill_urb(priv_bcn->urb);
+diff -up linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt73usb.c
+--- linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/rt2x00/rt73usb.c	2008-06-13 17:37:35.000000000 -0400
+@@ -2131,6 +2131,7 @@ static struct usb_device_id rt73usb_devi
+ 	/* D-Link */
+ 	{ USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) },
+ 	{ USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
++	{ USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) },
+ 	{ USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
+ 	/* Gemtek */
+ 	{ USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },
+diff -up linux-2.6.25.noarch/drivers/ssb/main.c.orig linux-2.6.25.noarch/drivers/ssb/main.c
+--- linux-2.6.25.noarch/drivers/ssb/main.c.orig	2008-06-13 17:33:42.000000000 -0400
++++ linux-2.6.25.noarch/drivers/ssb/main.c	2008-06-13 17:37:35.000000000 -0400
+@@ -1168,15 +1168,21 @@ EXPORT_SYMBOL(ssb_dma_translation);
  int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask)
  {
--	struct device *dev = ssb_dev->dev;
-+	struct device *dma_dev = ssb_dev->dma_dev;
+ 	struct device *dma_dev = ssb_dev->dma_dev;
++	int err = 0;
  
  #ifdef CONFIG_SSB_PCIHOST
--	if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI &&
--	    !dma_supported(dev, mask))
--		return -EIO;
-+	if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
-+		return dma_set_mask(dma_dev, mask);
+-	if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI)
+-		return dma_set_mask(dma_dev, mask);
++	if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) {
++		err = pci_set_dma_mask(ssb_dev->bus->host_pci, mask);
++		if (err)
++			return err;
++		err = pci_set_consistent_dma_mask(ssb_dev->bus->host_pci, mask);
++		return err;
++	}
  #endif
--	dev->coherent_dma_mask = mask;
--	dev->dma_mask = &dev->coherent_dma_mask;
-+	dma_dev->coherent_dma_mask = mask;
-+	dma_dev->dma_mask = &dma_dev->coherent_dma_mask;
+ 	dma_dev->coherent_dma_mask = mask;
+ 	dma_dev->dma_mask = &dma_dev->coherent_dma_mask;
  
- 	return 0;
+-	return 0;
++	return err;
  }
+ EXPORT_SYMBOL(ssb_dma_set_mask);
+ 
+diff -up linux-2.6.25.noarch/net/mac80211/wext.c.orig linux-2.6.25.noarch/net/mac80211/wext.c
+--- linux-2.6.25.noarch/net/mac80211/wext.c.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/wext.c	2008-06-13 17:37:35.000000000 -0400
+@@ -496,7 +496,8 @@ static int ieee80211_ioctl_giwap(struct 
+ 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 	if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
+ 	    sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
+-		if (sdata->u.sta.state == IEEE80211_ASSOCIATED) {
++		if (sdata->u.sta.state == IEEE80211_ASSOCIATED ||
++		    sdata->u.sta.state == IEEE80211_IBSS_JOINED) {
+ 			ap_addr->sa_family = ARPHRD_ETHER;
+ 			memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN);
+ 			return 0;
+diff -up linux-2.6.25.noarch/net/mac80211/wme.c.orig linux-2.6.25.noarch/net/mac80211/wme.c
+--- linux-2.6.25.noarch/net/mac80211/wme.c.orig	2008-06-13 17:37:05.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/wme.c	2008-06-13 17:37:35.000000000 -0400
+@@ -673,7 +673,7 @@ int ieee80211_ht_agg_queue_add(struct ie
+ #ifdef CONFIG_MAC80211_HT_DEBUG
+ 			if (net_ratelimit())
+ 				printk(KERN_DEBUG "allocated aggregation queue"
+-					" %d tid %d addr %s pool=0x%lX",
++					" %d tid %d addr %s pool=0x%lX\n",
+ 					i, tid, print_mac(mac, sta->addr),
+ 					q->qdisc_pool[0]);
+ #endif /* CONFIG_MAC80211_HT_DEBUG */

linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch:

Index: linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch	8 May 2008 08:57:49 -0000	1.7
+++ linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch	16 Jun 2008 10:19:26 -0000	1.8
@@ -1,4 +1,4 @@
-From af6eed7bbc5ccbca547b0fd22499a9b9c704caa0 Mon Sep 17 00:00:00 2001
+From 63633e32db93e0cc030f680c19050e72b64fc3ce Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Wed, 5 Mar 2008 12:50:50 +0000
 Subject: [PATCH] squashfs: Fix build without CONFIG_SMP

linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch:

Index: linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch	8 May 2008 08:57:49 -0000	1.7
+++ linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch	16 Jun 2008 10:19:26 -0000	1.8
@@ -1,4 +1,4 @@
-From 97f35f84839a7f77b3b1eda2885ab93d2ec37cc4 Mon Sep 17 00:00:00 2001
+From fd2d1e66166e8077b1221d752ac4133e1e1f1187 Mon Sep 17 00:00:00 2001
 From: Stephen Tweedie <sct at redhat.com>
 Date: Tue, 11 Mar 2008 18:05:30 +0000
 Subject: [PATCH] xen execshield: Add xen-specific load_user_cs_desc()
@@ -18,10 +18,10 @@
  4 files changed, 30 insertions(+), 2 deletions(-)
 
 diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
-index 075962c..d59db07 100644
+index 74f0c5e..afdbfb3 100644
 --- a/arch/x86/kernel/paravirt.c
 +++ b/arch/x86/kernel/paravirt.c
-@@ -331,6 +331,7 @@ struct pv_cpu_ops pv_cpu_ops = {
+@@ -315,6 +315,7 @@ struct pv_cpu_ops pv_cpu_ops = {
  	.read_tscp = native_read_tscp,
  	.load_tr_desc = native_load_tr_desc,
  	.set_ldt = native_set_ldt,
@@ -30,10 +30,10 @@
  	.load_idt = native_load_idt,
  	.store_gdt = native_store_gdt,
 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index 27ee26a..66ffdb2 100644
+index c8a56e4..042a72d 100644
 --- a/arch/x86/xen/enlighten.c
 +++ b/arch/x86/xen/enlighten.c
-@@ -290,6 +290,22 @@ static void xen_set_ldt(const void *addr, unsigned entries)
+@@ -292,6 +292,22 @@ static void xen_set_ldt(const void *addr, unsigned entries)
  	xen_mc_issue(PARAVIRT_LAZY_CPU);
  }
  
@@ -56,7 +56,7 @@
  static void xen_load_gdt(const struct desc_ptr *dtr)
  {
  	unsigned long *frames;
-@@ -998,6 +1014,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+@@ -1012,6 +1028,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
  
  	.load_tr_desc = paravirt_nop,
  	.set_ldt = xen_set_ldt,
@@ -65,7 +65,7 @@
  	.load_idt = xen_load_idt,
  	.load_tls = xen_load_tls,
 diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
-index 7ad80b9..ec3a84a 100644
+index 5ad3fc8..428376e 100644
 --- a/include/asm-x86/desc.h
 +++ b/include/asm-x86/desc.h
 @@ -6,6 +6,7 @@
@@ -82,9 +82,9 @@
  #define set_ldt native_set_ldt
 +#define load_user_cs_desc native_load_user_cs_desc
  
- #define write_ldt_entry(dt, entry, desc) \
- 				native_write_ldt_entry(dt, entry, desc)
-@@ -360,8 +362,10 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
+ #define write_ldt_entry(dt, entry, desc)	\
+ 	native_write_ldt_entry(dt, entry, desc)
+@@ -362,8 +364,10 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
  	desc->b = (limit & 0xf0000) | 0x00c0fb00;
  }
  
@@ -95,10 +95,10 @@
 +	get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
 +}
  
- #ifdef CONFIG_X86_32
  extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
+ extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
 diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
-index d6236eb..ff8d218 100644
+index 0f13b94..cde8985 100644
 --- a/include/asm-x86/paravirt.h
 +++ b/include/asm-x86/paravirt.h
 @@ -113,6 +113,7 @@ struct pv_cpu_ops {
@@ -109,7 +109,7 @@
  	unsigned long (*store_tr)(void);
  	void (*load_tls)(struct thread_struct *t, unsigned int cpu);
  	void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
-@@ -754,6 +755,11 @@ static inline void set_ldt(const void *addr, unsigned entries)
+@@ -771,6 +772,11 @@ static inline void set_ldt(const void *addr, unsigned entries)
  {
  	PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
  }

linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch:

Index: linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch	8 May 2008 08:57:49 -0000	1.7
+++ linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch	16 Jun 2008 10:19:26 -0000	1.8
@@ -1,4 +1,4 @@
-From 7880c7d164f328bab85fc0e24b7adaf7b392b0e6 Mon Sep 17 00:00:00 2001
+From 586da25fd1f8644508e95dce72fc484dae297316 Mon Sep 17 00:00:00 2001
 From: Stephen Tweedie <sct at redhat.com>
 Date: Tue, 11 Mar 2008 18:07:31 +0000
 Subject: [PATCH] xen execshield: fix endless GPF fault loop
@@ -34,10 +34,10 @@
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
-index 7865615..3d36a99 100644
+index d70620c..ef726b5 100644
 --- a/arch/x86/kernel/traps_32.c
 +++ b/arch/x86/kernel/traps_32.c
-@@ -629,7 +629,8 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
+@@ -640,7 +640,8 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
  	desc1 = &current->mm->context.user_cs;
  	desc2 = get_cpu_gdt_table(cpu) + GDT_ENTRY_DEFAULT_USER_CS;
  


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/sources,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- sources	8 May 2008 08:57:50 -0000	1.17
+++ sources	16 Jun 2008 10:19:27 -0000	1.18
@@ -1,3 +1,4 @@
 db95a49a656a3247d4995a797d333153  linux-2.6.25.tar.bz2
-c1d1c1542d676ce3143e5713bab2cca4  patch-2.6.25.2.bz2
+ec4864dc8a70490d883c6dd85e2bc076  patch-2.6.26-rc6.bz2
+6bdd7a956260030aee287b2822fdf6bc  patch-2.6.26-rc6-git2.bz2
 4aa57328d0802a063fa67dfc063da30e  xen-3.2.0.tar.gz


Index: upstream
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/upstream,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- upstream	8 May 2008 08:57:50 -0000	1.7
+++ upstream	16 Jun 2008 10:19:27 -0000	1.8
@@ -1,2 +1,4 @@
 linux-2.6.25.tar.bz2
-patch-2.6.25.2.bz2
+patch-2.6.26-rc6.bz2
+patch-2.6.26-rc6-git2.bz2
+


--- linux-2.6-25.3-queue.patch DELETED ---


--- linux-2.6-acpi-eeepc-hotkey.patch DELETED ---


--- linux-2.6-debug-no-quiet.patch DELETED ---


--- linux-2.6-devmem.patch DELETED ---


--- linux-2.6-ext4-stable-queue.patch DELETED ---


--- linux-2.6-firewire-git-pending.patch DELETED ---


--- linux-2.6-firewire-git-update.patch DELETED ---


--- linux-2.6-libata-ata_piix-check-sidpr.patch DELETED ---


--- linux-2.6-md-fix-oops-in-rdev_attr_store.patch DELETED ---


--- linux-2.6-ppc-rtc.patch DELETED ---


--- linux-2.6-rt2x00-configure_filter.patch DELETED ---


--- linux-2.6-smp-boot-delay.patch DELETED ---


--- linux-2.6-windfarm-pm121-fix.patch DELETED ---


--- linux-2.6-windfarm-pm121.patch DELETED ---


--- linux-2.6-wireless-pending-too.patch DELETED ---


--- linux-2.6-xen-0004-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch DELETED ---


--- linux-2.6-xen-0005-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch DELETED ---


--- linux-2.6-xen-0006-xen-Enable-Xen-console-by-default-in-domU.patch DELETED ---


--- linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch DELETED ---


--- linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch DELETED ---


--- linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch DELETED ---


--- linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch DELETED ---


--- linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch DELETED ---


--- linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch DELETED ---


--- linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch DELETED ---


--- linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch DELETED ---


--- linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch DELETED ---


--- linux-2.6-xen-0016-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch DELETED ---


--- linux-2.6-xen-0017-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch DELETED ---


--- linux-2.6-xen-0018-xen-expose-set_pte_vaddr-and-make-xen-use-it.patch DELETED ---


--- linux-2.6-xen-0019-xen-dom0-Add-set_fixmap-pv_mmu_ops.patch DELETED ---


--- linux-2.6-xen-0020-x86_64-Expose-set_pte_vaddr.patch DELETED ---


--- linux-2.6-xen-0021-x86_64-Split-set_pte_vaddr.patch DELETED ---


--- linux-2.6-xen-0022-x86_64-Add-clear_fixmap.patch DELETED ---


--- linux-2.6-xen-0023-xen-x86_64-Make-set_fixmap-a-paravirt-op-on-64-bi.patch DELETED ---


--- linux-2.6-xen-0024-xen-x86_64-Hack-to-set-vsyscall-pages-on-user-space.patch DELETED ---


--- linux-2.6-xen-0025-Handle-VSYSCALL_FIRST_PAGE-on-xen_set_pte.patch DELETED ---


--- linux-2.6-xen-0026-DMI-Define-dmi_scan_machine-as-no-op-if-CONFIG_DM.patch DELETED ---


--- linux-2.6-xen-0027-ACPI-thermal-Compile-without-CONFIG_DMI.patch DELETED ---


--- linux-2.6-xen-0028-xen-x86_64-Remove-the-640K-1M-hole-and-disable-DMI.patch DELETED ---


--- linux-2.6-xen-0029-xen-x86_64-Add-update_va_mapping-64-bit-code.patch DELETED ---


--- linux-2.6-xen-0030-x86_64-Add-sync_cmpxchg.patch DELETED ---


--- linux-2.6-xen-0031-xen-x86_64-Implement-HYPERVISOR-MULTI-_update_desc.patch DELETED ---


--- linux-2.6-xen-0032-xen-x86_64-Add-hacky-64-bit-x86_-read-write-_percpu.patch DELETED ---


--- linux-2.6-xen-0033-xen-x86_64-Use-x86_read_percpu-only-to-refer-to-a.patch DELETED ---


--- linux-2.6-xen-0034-Better-implementation-of-pte-functions.patch DELETED ---


--- linux-2.6-xen-0035-Add-FIX_PARAVIRT_BOOTAP-to-fixmap_64.h-too.patch DELETED ---


--- linux-2.6-xen-0036-Add-gate_offset-and-gate_segment-macros.patch DELETED ---


--- linux-2.6-xen-0037-xen_write_idt_entry-and-cvt_gate_to_trap.patch DELETED ---


--- linux-2.6-xen-0038-typedefs-for-pte_val-and-friends.patch DELETED ---


--- linux-2.6-xen-0039-x86_64-implementation-of-some-page.h-macros.patch DELETED ---


--- linux-2.6-xen-0040-Chainsaw-style-ifdefs.patch DELETED ---


--- linux-2.6-xen-0041-xen-Make-xen_pte_val-generic.patch DELETED ---


--- linux-2.6-xen-0042-More-chainsaw-ifdefs.patch DELETED ---


--- linux-2.6-xen-0043-Chainsaw-ifdefs-on-assembly-percpu-handling.patch DELETED ---


--- linux-2.6-xen-0044-x86_64-percpu-assembly-macros.patch DELETED ---


--- linux-2.6-xen-0045-Some-xen-asm.S-x86_64-code.patch DELETED ---


--- linux-2.6-xen-0046-Chainsaw-party-SPLITME.patch DELETED ---


--- linux-2.6-xen-0047-xen-asm.S-x86_64-notes.patch DELETED ---


--- linux-2.6-xen-0048-xen-x86_64-Make-hypercall-assembly-code-work.patch DELETED ---


--- linux-2.6-xen-0049-xen-x86_64-pda-initialization.patch DELETED ---


--- linux-2.6-xen-0050-Disable-discover_ebda-under-paravirt.patch DELETED ---


--- linux-2.6-xen-0051-Disable-early_printk-by-default.patch DELETED ---


--- linux-2.6-xen-0052-xen-Set-__HYPERVISOR_VIRT_START-for-x86_64.patch DELETED ---


--- linux-2.6-xen-0053-Set-__PAGE_OFFSET-as-required-by-Xen.patch DELETED ---


--- linux-2.6-xen-0054-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch DELETED ---


--- linux-2.6-xen-0055-DEBUG-Add-xprintk-debugging-printk-prototype-to-hvc.patch DELETED ---


--- linux-2.6-xen-0056-Use-__pgd-on-mk_kernel_pgd.patch DELETED ---


--- linux-2.6-xen-0057-Include-user-page-tables-on-head_64.S.patch DELETED ---


--- linux-2.6-xen-0058-Avoid-using-mk_unsigned_long.patch DELETED ---


--- linux-2.6-xen-0059-Lots-of-unrelated-changes.patch DELETED ---


--- linux-2.6-xen-0060-Hack-disable-vsmp.patch DELETED ---


--- linux-2.6-xen-0061-Export-early_make_page_readonly.patch DELETED ---


--- linux-2.6-xen-0062-Disable-multicalls.c-too-verbose-debugging.patch DELETED ---


--- linux-2.6-xen-0063-Xen-64-bit-ready-MMU-operations.patch DELETED ---


--- linux-2.6-xen-0064-Some-xen-mmu-pv-ops-implemented.patch DELETED ---


--- linux-2.6-xen-0065-Trying-to-make-the-pagetable-initialization-code-wor.patch DELETED ---


--- linux-2.6-xen-0066-Xen-specific-find_early_table_space-FIXME.patch DELETED ---


--- linux-2.6-xen-0067-Xen-call-e820_print_map-when-setting-up-memory.patch DELETED ---


--- linux-2.6-xen-0068-Comment-debugging-msgs.patch DELETED ---


--- linux-2.6-xen-0069-Try-to-make-pagetables-read-only.patch DELETED ---


--- linux-2.6-xen-0070-Debug-dump-pgtables-on-make_page_readonly.patch DELETED ---


--- linux-2.6-xen-0071-Disable-apic-at-compile-time-FIXME.patch DELETED ---


--- linux-2.6-xen-0072-Parse-early-params-after-init_memory_mapping.patch DELETED ---


--- linux-2.6-xen-0073-xen-Move-addr_to_page-to-init.h.patch DELETED ---


--- linux-2.6-xen-0074-Make-xen_pxx_val-and-xen_make_pxx-handle-attr-bi.patch DELETED ---


--- linux-2.6-xen-0075-Pull-xen_finish_init_mappin-from-XS-upstream.patch DELETED ---


--- linux-2.6-xen-0076-Pull-spp_getpage-changes-from-XS-upstream-REVIEWM.patch DELETED ---


--- linux-2.6-xen-0077-Pull-xen_extend_init_mapping-from-XS-upstream-FIX.patch DELETED ---


--- linux-2.6-xen-0078-New-enum-fixed_addresses-values-REVIEWME.patch DELETED ---


--- linux-2.6-xen-0079-Reserve-bootmem-areas-used-by-Xen-FIXME.patch DELETED ---


--- linux-2.6-xen-0080-xen_convert_trap_info-use-sizeof-struct-gate_desc.patch DELETED ---


--- linux-2.6-xen-0081-Call-paravirt_pagetable_setup_-start-done-REVIEW.patch DELETED ---


--- linux-2.6-xen-0082-ifdef-CONFIG_X86_32-on-xen-enlighten.c-REVIEWME.patch DELETED ---


--- linux-2.6-xen-0083-Handle-Xen-exception-stack-it-is-different-from-bar.patch DELETED ---


--- linux-2.6-xen-0084-Implement-64-bit-version-of-HYPERVISOR_set_callbacks.patch DELETED ---


--- linux-2.6-xen-0085-Make-arch_vcpu_info-be-of-the-right-size-on-both-32.patch DELETED ---


--- linux-2.6-xen-0086-Implement-asm-xen_iret.patch DELETED ---


--- linux-2.6-xen-0087-xen-64-xen_iret-use-iretq-directly-if-returning-t.patch DELETED ---


--- linux-2.6-xen-0088-Implement-xen_irqenable_syscall_ret.patch DELETED ---


--- linux-2.6-xen-0089-DEBUG-xen_iret-always-return-through-the-hyperviso.patch DELETED ---


--- linux-2.6-xen-0090-Implement-some-xen-callbacks-on-xen-entry_64.S.patch DELETED ---


--- linux-2.6-xen-0091-Xen-specific-ifdef-hacks-on-kernel-entry_64.S-FIXM.patch DELETED ---


--- linux-2.6-xen-0092-Disable-syscall32-code-temporarily-FIXME.patch DELETED ---


--- linux-2.6-xen-0093-Use-__KERNEL_DS-as-SS-when-returning-to-a-kernel-thr.patch DELETED ---


--- linux-2.6-xen-0094-Use-apic_xen-on-genapic-by-default-FIXME.patch DELETED ---


--- linux-2.6-xen-0095-irq-vector-ifdef-chainsaw-FIXME.patch DELETED ---


--- linux-2.6-xen-0096-ifdef-chainsaw-on-syscall_init-FIXME.patch DELETED ---


--- linux-2.6-xen-0097-Pull-xen-genapic-implementation-from-upstream-Xen.patch DELETED ---


--- linux-2.6-xen-0098-Debugging-printk-s.patch DELETED ---


--- linux-2.6-xen-0099-Leave-lazy_cpu_mode-on-__switch_to.patch DELETED ---


--- linux-2.6-xen-0100-xen-64-Handle-fs-and-gs-on-xen_load_tls-properl.patch DELETED ---


--- linux-2.6-xen-0101-Disable-vcpu_info_placement-temporarily-FIXME.patch DELETED ---


--- linux-2.6-xen-0102-Fix-typo-on-ifdef-again.patch DELETED ---


--- linux-2.6-xen-0103-DEBUG-Don-t-try-to-actually-read-the-page-on-show_.patch DELETED ---


--- linux-2.6-xen-0104-Make-load_gs_index-a-paravirt-operation.patch DELETED ---


--- linux-2.6-xen-0105-xen-pgd_walk-use-limit-argument-instead-of-FIXADD.patch DELETED ---


--- linux-2.6-xen-0106-xen-pgd_walk-Eliminate-BUG_ON-limit-FIXADDR_TOP.patch DELETED ---


--- linux-2.6-xen-0107-xen-pgd_walk-accept-start-parameter.patch DELETED ---


--- linux-2.6-xen-0108-xen-64-reserve_bootmem-xen_start_info-area.patch DELETED ---


--- linux-2.6-xen-0109-pvops-64-call-paravirt_post_allocator_init-on-set.patch DELETED ---


--- linux-2.6-xen-0110-use-write_gdt_entry-on-vsyscall_set_cpu-CLEANME.patch DELETED ---


--- linux-2.6-xen-0111-xen-64-implement-xen_load_gs_index.patch DELETED ---


--- linux-2.6-xen-0112-include-asm-x86-pgalloc_64.h-pvops-hacks-SPLITME.patch DELETED ---


--- linux-2.6-xen-0113-Multi-pagetable-write_cr3-implementation-FIXME.patch DELETED ---


--- linux-2.6-xen-0114-Disable-the-weird-count-loop-on-kcons_write_dom0.patch DELETED ---


--- linux-2.6-xen-0115-Make-xen_start_info-read-only.patch DELETED ---


--- linux-2.6-xen-0116-Hack-to-implement-return-to-userspace-without-SWAPGS.patch DELETED ---


--- linux-2.6-xen-0117-Xen-SEGBASE_-defines.patch DELETED ---


--- linux-2.6-xen-0118-Xen-HYPERVISOR_set_segment_base-implementation.patch DELETED ---


--- linux-2.6-xen-0119-Change-signature-of-paravirt_alloc_-pt-pd-REVIEWME.patch DELETED ---


--- linux-2.6-xen-0120-Comment-e820_print_map-call-TEMPORARY.patch DELETED ---


--- linux-2.6-xen-0121-Xen-missing-includes.patch DELETED ---


--- linux-2.6-xen-0122-asm-x86-pgtable_64.h-include-linux-spinlock.h.patch DELETED ---


--- linux-2.6-xen-0123-asm-x86-pgtable.h-include-asm-page.h.patch DELETED ---


--- linux-2.6-xen-0124-fix-pxxval_t-usage-on-mm-init_64.c.patch DELETED ---


--- linux-2.6-xen-0125-Missing-Xen-include.patch DELETED ---


--- linux-2.6-xen-0126-un-static-ipi_to_irq.patch DELETED ---


--- linux-2.6-xen-0127-Don-t-use-_PAGE_GLOBAL-bit-under-Xen-FIXME.patch DELETED ---


--- linux-2.6-xen-0128-Trying-to-organize-the-xen-bootmem-allocation-mess.patch DELETED ---


--- linux-2.6-xen-0129-Xen-reserve_bootmem-xenstore-and-console-interfac.patch DELETED ---


--- linux-2.6-xen-0130-pvops-64-call-paravirt_activate_mm-on-activate_mm.patch DELETED ---


--- linux-2.6-xen-0131-Xen-64-bit-support-on-xen_pgd_pin.patch DELETED ---


--- linux-2.6-xen-0132-Xen-64-pin-user-PGD-on-activate_mm-and-dup_mmap.patch DELETED ---


--- linux-2.6-xen-0133-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.patch DELETED ---


--- linux-2.6-xen-0134-Xen-Add-a-order-parameter-to-pgd_walk.patch DELETED ---


--- linux-2.6-xen-0135-Xen-64-Unpin-user-pagetable-on-xen_pgd_unpin.patch DELETED ---


--- linux-2.6-xen-0136-Use-un-pin_page-when-un-pinning-pgd.patch DELETED ---


--- linux-2.6-xen-0137-Allow-enabling-Xen-on-x86_64.patch DELETED ---


--- linux-2.6-xen-0138-Add-include-linux-spinlock_types.h-to-asm-x86-pgt.patch DELETED ---


--- linux-2.6-xen-0139-Restore-some-sanity-on-the-initial-pagetable-bootmem.patch DELETED ---


--- linux-2.6-xen-0140-Xen-Use-system_call_after_swapgs-as-the-syscall-c.patch DELETED ---


--- linux-2.6-xen-0141-Add-a-system_call_after_saveargs-label-to-entry_64.S.patch DELETED ---


--- linux-2.6-xen-0142-Create-xen-specific-syscall-entry.patch DELETED ---


--- linux-2.6-xen-0143-syscall-related-Xen-ifdefs-FIXME.patch DELETED ---


--- linux-2.6-xen-0144-Point-set_pte-to-xen_set_pte-since-the-beginning.patch DELETED ---


--- linux-2.6-xen-0145-DEBUG-slab-debugging.patch DELETED ---


--- linux-2.6-xen-0146-pvops-64-Include-rsi-on-the-register-clobber-list.patch DELETED ---


--- linux-2.6-xen-0147-Xen-64-quick-ugly-hack-to-fix-pgd_clear-pagetabl.patch DELETED ---


--- linux-2.6-xen-0148-Add-missing-acpi-include-to-xen-setup.c.patch DELETED ---


--- linux-2.6-xen-0149-Don-t-use-FIX_VDSO-on-64-bit.patch DELETED ---


--- linux-2.6-xen-0150-Mark-init-pages-read-write-again-on-free_init_pages.patch DELETED ---


--- linux-2.6-xen-0151-reserve_early-kernel-text-and-data-segments.patch DELETED ---


--- linux-2.6-xen-0152-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch DELETED ---


--- linux-2.6-xen-0153-Set-pvops-machine_ops-for-Xen-on-x86_64-also-MERGE.patch DELETED ---


--- linux-2.6-xen-0154-Pull-xen_failsafe_callback-implementation-from-XenSo.patch DELETED ---


--- linux-2.6-xen-0155-Save-fs-and-gs-before-load_TLS-and-arch_leave_la.patch DELETED ---


--- linux-2.6-xen-0156-xen-64-Clear-fs-on-xen_load_tls.patch DELETED ---


--- linux-2.6-xen-0157-ia32entry.S-Replace-cli-sti-cases-with-DISABLE_INTE.patch DELETED ---


--- linux-2.6-xen-0158-Introduce-xen_ia32_syscall.patch DELETED ---


--- linux-2.6-xen-0159-Use-xen_ia32_syscall-if-CONFIG_XEN-is-enabled-FIX.patch DELETED ---


--- linux-2.6-xen-0160-Make-the-int80-and-syscall-vdso32-implementations-se.patch DELETED ---


--- linux-2.6-xen-0161-Use-vdso32-int80-by-default-if-Xen-is-enabled-FIXME.patch DELETED ---


--- linux-2.6-xen-0162-xen_pgd_pin-use-TASK_SIZE64-on-x86_64.patch DELETED ---


--- linux-2.6-xen-0163-paravirt-ops-64-Save-rdi-also-on-asm-version-of-PV.patch DELETED ---


--- linux-2.6.25-sparc64-semctl.patch DELETED ---


--- patch-2.6.25.2.bz2.sign DELETED ---




More information about the fedora-extras-commits mailing list