The patch titled revert x86_64-mm-i386-pda-vm86 has been removed from the -mm tree. Its filename is revert-x86_64-mm-i386-pda-vm86.patch This patch was dropped because it is obsolete ------------------------------------------------------ Subject: revert x86_64-mm-i386-pda-vm86 From: Andrew Morton <akpm@xxxxxxxx> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Cc: Andi Kleen <ak@xxxxxx> Cc: Chuck Ebbert <76306.1226@xxxxxxxxxxxxxx> Cc: Zachary Amsden <zach@xxxxxxxxxx> Cc: Jan Beulich <jbeulich@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/i386/kernel/vm86.c | 121 ++++++++++++++------------------------ include/asm-i386/vm86.h | 17 ++++- 2 files changed, 62 insertions(+), 76 deletions(-) diff -puN arch/i386/kernel/vm86.c~revert-x86_64-mm-i386-pda-vm86 arch/i386/kernel/vm86.c --- a/arch/i386/kernel/vm86.c~revert-x86_64-mm-i386-pda-vm86 +++ a/arch/i386/kernel/vm86.c @@ -43,7 +43,6 @@ #include <linux/highmem.h> #include <linux/ptrace.h> #include <linux/audit.h> -#include <linux/stddef.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -73,10 +72,10 @@ /* * 8- and 16-bit register defines.. */ -#define AL(regs) (((unsigned char *)&((regs)->pt.eax))[0]) -#define AH(regs) (((unsigned char *)&((regs)->pt.eax))[1]) -#define IP(regs) (*(unsigned short *)&((regs)->pt.eip)) -#define SP(regs) (*(unsigned short *)&((regs)->pt.esp)) +#define AL(regs) (((unsigned char *)&((regs)->eax))[0]) +#define AH(regs) (((unsigned char *)&((regs)->eax))[1]) +#define IP(regs) (*(unsigned short *)&((regs)->eip)) +#define SP(regs) (*(unsigned short *)&((regs)->esp)) /* * virtual flags (16 and 32-bit versions) @@ -90,37 +89,10 @@ #define SAFE_MASK (0xDD5) #define RETURN_MASK (0xDFF) -/* convert kernel_vm86_regs to vm86_regs */ -static int copy_vm86_regs_to_user(struct vm86_regs __user *user, - const struct kernel_vm86_regs *regs) -{ - int ret = 0; - - /* kernel_vm86_regs is missing xfs, so copy everything up to - (but not including) xgs, and then rest after xgs. */ - ret += copy_to_user(user, regs, offsetof(struct kernel_vm86_regs, pt.xgs)); - ret += copy_to_user(&user->__null_gs, ®s->pt.xgs, - sizeof(struct kernel_vm86_regs) - - offsetof(struct kernel_vm86_regs, pt.xgs)); - - return ret; -} - -/* convert vm86_regs to kernel_vm86_regs */ -static int copy_vm86_regs_from_user(struct kernel_vm86_regs *regs, - const struct vm86_regs __user *user, - unsigned extra) -{ - int ret = 0; - - ret += copy_from_user(regs, user, offsetof(struct kernel_vm86_regs, pt.xgs)); - ret += copy_from_user(®s->pt.xgs, &user->__null_gs, - sizeof(struct kernel_vm86_regs) - - offsetof(struct kernel_vm86_regs, pt.xgs) + - extra); - - return ret; -} +#define VM86_REGS_PART2 orig_eax +#define VM86_REGS_SIZE1 \ + ( (unsigned)( & (((struct kernel_vm86_regs *)0)->VM86_REGS_PART2) ) ) +#define VM86_REGS_SIZE2 (sizeof(struct kernel_vm86_regs) - VM86_REGS_SIZE1) struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs)); struct pt_regs * fastcall save_v86_state(struct kernel_vm86_regs * regs) @@ -140,8 +112,10 @@ struct pt_regs * fastcall save_v86_state printk("no vm86_info: BAD\n"); do_exit(SIGSEGV); } - set_flags(regs->pt.eflags, VEFLAGS, VIF_MASK | current->thread.v86mask); - tmp = copy_vm86_regs_to_user(¤t->thread.vm86_info->regs,regs); + set_flags(regs->eflags, VEFLAGS, VIF_MASK | current->thread.v86mask); + tmp = copy_to_user(¤t->thread.vm86_info->regs,regs, VM86_REGS_SIZE1); + tmp += copy_to_user(¤t->thread.vm86_info->regs.VM86_REGS_PART2, + ®s->VM86_REGS_PART2, VM86_REGS_SIZE2); tmp += put_user(current->thread.screen_bitmap,¤t->thread.vm86_info->screen_bitmap); if (tmp) { printk("vm86: could not access userspace vm86_info\n"); @@ -155,11 +129,9 @@ struct pt_regs * fastcall save_v86_state current->thread.saved_esp0 = 0; put_cpu(); - ret = KVM86->regs32; - loadsegment(fs, current->thread.saved_fs); - ret->xgs = current->thread.saved_gs; - + loadsegment(gs, current->thread.saved_gs); + ret = KVM86->regs32; return ret; } @@ -211,9 +183,9 @@ asmlinkage int sys_vm86old(struct pt_reg tsk = current; if (tsk->thread.saved_esp0) goto out; - tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, - offsetof(struct kernel_vm86_struct, vm86plus) - - sizeof(info.regs)); + tmp = copy_from_user(&info, v86, VM86_REGS_SIZE1); + tmp += copy_from_user(&info.regs.VM86_REGS_PART2, &v86->regs.VM86_REGS_PART2, + (long)&info.vm86plus - (long)&info.regs.VM86_REGS_PART2); ret = -EFAULT; if (tmp) goto out; @@ -261,9 +233,9 @@ asmlinkage int sys_vm86(struct pt_regs r if (tsk->thread.saved_esp0) goto out; v86 = (struct vm86plus_struct __user *)regs.ecx; - tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, - offsetof(struct kernel_vm86_struct, regs32) - - sizeof(info.regs)); + tmp = copy_from_user(&info, v86, VM86_REGS_SIZE1); + tmp += copy_from_user(&info.regs.VM86_REGS_PART2, &v86->regs.VM86_REGS_PART2, + (long)&info.regs32 - (long)&info.regs.VM86_REGS_PART2); ret = -EFAULT; if (tmp) goto out; @@ -280,15 +252,15 @@ out: static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk) { struct tss_struct *tss; + long eax; /* * make sure the vm86() system call doesn't try to do anything silly */ - info->regs.pt.xds = 0; - info->regs.pt.xes = 0; - info->regs.pt.xgs = 0; + info->regs.__null_ds = 0; + info->regs.__null_es = 0; -/* we are clearing fs later just before "jmp resume_userspace", - * because it is not saved/restored. +/* we are clearing fs,gs later just before "jmp resume_userspace", + * because starting with Linux 2.1.x they aren't no longer saved/restored */ /* @@ -296,10 +268,10 @@ static void do_sys_vm86(struct kernel_vm * has set it up safely, so this makes sure interrupt etc flags are * inherited from protected mode. */ - VEFLAGS = info->regs.pt.eflags; - info->regs.pt.eflags &= SAFE_MASK; - info->regs.pt.eflags |= info->regs32->eflags & ~SAFE_MASK; - info->regs.pt.eflags |= VM_MASK; + VEFLAGS = info->regs.eflags; + info->regs.eflags &= SAFE_MASK; + info->regs.eflags |= info->regs32->eflags & ~SAFE_MASK; + info->regs.eflags |= VM_MASK; switch (info->cpu_type) { case CPU_286: @@ -322,7 +294,7 @@ static void do_sys_vm86(struct kernel_vm info->regs32->eax = 0; tsk->thread.saved_esp0 = tsk->thread.esp0; savesegment(fs, tsk->thread.saved_fs); - tsk->thread.saved_gs = info->regs32->xgs; + savesegment(gs, tsk->thread.saved_gs); tss = &per_cpu(init_tss, get_cpu()); tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; @@ -334,18 +306,19 @@ static void do_sys_vm86(struct kernel_vm tsk->thread.screen_bitmap = info->screen_bitmap; if (info->flags & VM86_SCREEN_BITMAP) mark_screen_rdonly(tsk->mm); + __asm__ __volatile__("xorl %eax,%eax; movl %eax,%fs; movl %eax,%gs\n\t"); + __asm__ __volatile__("movl %%eax, %0\n" :"=r"(eax)); /*call audit_syscall_exit since we do not exit via the normal paths */ if (unlikely(current->audit_context)) - audit_syscall_exit(AUDITSC_RESULT(0), 0); + audit_syscall_exit(AUDITSC_RESULT(eax), eax); __asm__ __volatile__( "movl %0,%%esp\n\t" "movl %1,%%ebp\n\t" - "mov %2, %%fs\n\t" "jmp resume_userspace" : /* no outputs */ - :"r" (&info->regs), "r" (task_thread_info(tsk)), "r" (0)); + :"r" (&info->regs), "r" (task_thread_info(tsk))); /* we never return here */ } @@ -375,12 +348,12 @@ static inline void clear_IF(struct kerne static inline void clear_TF(struct kernel_vm86_regs * regs) { - regs->pt.eflags &= ~TF_MASK; + regs->eflags &= ~TF_MASK; } static inline void clear_AC(struct kernel_vm86_regs * regs) { - regs->pt.eflags &= ~AC_MASK; + regs->eflags &= ~AC_MASK; } /* It is correct to call set_IF(regs) from the set_vflags_* @@ -397,7 +370,7 @@ static inline void clear_AC(struct kerne static inline void set_vflags_long(unsigned long eflags, struct kernel_vm86_regs * regs) { set_flags(VEFLAGS, eflags, current->thread.v86mask); - set_flags(regs->pt.eflags, eflags, SAFE_MASK); + set_flags(regs->eflags, eflags, SAFE_MASK); if (eflags & IF_MASK) set_IF(regs); else @@ -407,7 +380,7 @@ static inline void set_vflags_long(unsig static inline void set_vflags_short(unsigned short flags, struct kernel_vm86_regs * regs) { set_flags(VFLAGS, flags, current->thread.v86mask); - set_flags(regs->pt.eflags, flags, SAFE_MASK); + set_flags(regs->eflags, flags, SAFE_MASK); if (flags & IF_MASK) set_IF(regs); else @@ -416,7 +389,7 @@ static inline void set_vflags_short(unsi static inline unsigned long get_vflags(struct kernel_vm86_regs * regs) { - unsigned long flags = regs->pt.eflags & RETURN_MASK; + unsigned long flags = regs->eflags & RETURN_MASK; if (VEFLAGS & VIF_MASK) flags |= IF_MASK; @@ -520,7 +493,7 @@ static void do_int(struct kernel_vm86_re unsigned long __user *intr_ptr; unsigned long segoffs; - if (regs->pt.xcs == BIOSSEG) + if (regs->cs == BIOSSEG) goto cannot_handle; if (is_revectored(i, &KVM86->int_revectored)) goto cannot_handle; @@ -532,9 +505,9 @@ static void do_int(struct kernel_vm86_re if ((segoffs >> 16) == BIOSSEG) goto cannot_handle; pushw(ssp, sp, get_vflags(regs), cannot_handle); - pushw(ssp, sp, regs->pt.xcs, cannot_handle); + pushw(ssp, sp, regs->cs, cannot_handle); pushw(ssp, sp, IP(regs), cannot_handle); - regs->pt.xcs = segoffs >> 16; + regs->cs = segoffs >> 16; SP(regs) -= 6; IP(regs) = segoffs & 0xffff; clear_TF(regs); @@ -551,7 +524,7 @@ int handle_vm86_trap(struct kernel_vm86_ if (VMPI.is_vm86pus) { if ( (trapno==3) || (trapno==1) ) return_to_32bit(regs, VM86_TRAP + (trapno << 8)); - do_int(regs, trapno, (unsigned char __user *) (regs->pt.xss << 4), SP(regs)); + do_int(regs, trapno, (unsigned char __user *) (regs->ss << 4), SP(regs)); return 0; } if (trapno !=1) @@ -587,10 +560,10 @@ void handle_vm86_fault(struct kernel_vm8 handle_vm86_trap(regs, 0, 1); \ return; } while (0) - orig_flags = *(unsigned short *)®s->pt.eflags; + orig_flags = *(unsigned short *)®s->eflags; - csp = (unsigned char __user *) (regs->pt.xcs << 4); - ssp = (unsigned char __user *) (regs->pt.xss << 4); + csp = (unsigned char __user *) (regs->cs << 4); + ssp = (unsigned char __user *) (regs->ss << 4); sp = SP(regs); ip = IP(regs); @@ -677,7 +650,7 @@ void handle_vm86_fault(struct kernel_vm8 SP(regs) += 6; } IP(regs) = newip; - regs->pt.xcs = newcs; + regs->cs = newcs; CHECK_IF_IN_TRAP; if (data32) { set_vflags_long(newflags, regs); diff -puN include/asm-i386/vm86.h~revert-x86_64-mm-i386-pda-vm86 include/asm-i386/vm86.h --- a/include/asm-i386/vm86.h~revert-x86_64-mm-i386-pda-vm86 +++ a/include/asm-i386/vm86.h @@ -145,13 +145,26 @@ struct vm86plus_struct { * at the end of the structure. Look at ptrace.h to see the "normal" * setup. For user space layout see 'struct vm86_regs' above. */ -#include <asm/ptrace.h> struct kernel_vm86_regs { /* * normal regs, with special meaning for the segment descriptors.. */ - struct pt_regs pt; + long ebx; + long ecx; + long edx; + long esi; + long edi; + long ebp; + long eax; + long __null_ds; + long __null_es; + long orig_eax; + long eip; + unsigned short cs, __csh; + long eflags; + long esp; + unsigned short ss, __ssh; /* * these are specific to v86 mode: */ _ Patches currently in -mm which might be from akpm@xxxxxxxx are origin.patch convert-i386-numa-kva-space-to-bootmem.patch reduce-max_nr_zones-make-display-of-highmem-counters-conditional-on-config_highmem.patch reduce-max_nr_zones-page-allocator-zone_highmem-cleanup.patch reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment.patch reduce-max_nr_zones-remove-display-of-counters-for-unconfigured-zones.patch out-of-memory-notifier.patch mm-swap-write-failure-fixup.patch slab-optimize-kmalloc_node-the-same-way-as-kmalloc.patch slab-fix-lockdep-warnings.patch zone_reclaim-dynamic-slab-reclaim.patch binfmt_elf-consistently-use-loff_t.patch i386-adds-smp_call_function_single-fix.patch swsusp-write-timer.patch swsusp-write-speedup.patch swsusp-read-timer.patch swsusp-read-speedup.patch git-acpi.patch acpi-asus-s3-resume-fix.patch sony_apci-resume.patch kauditd_thread-warning-fix.patch git-block.patch git-block-fixup.patch git-block-hack.patch git-drm.patch git-dvb.patch git-dvb-fixup.patch git-geode-fixup.patch git-gfs2.patch git-ia64.patch git-ieee1394.patch git-input.patch git-intelfb-fixup.patch hdrcheck-permission-fix.patch mmc-driver-for-ti-flashmedia-card-reader-source.patch git-mtd-fixup.patch git-netdev-all.patch drivers-net-ns83820c-add-paramter-to-disable-auto.patch revert-allow-file-systems-to-manually-d_move-inside-of-rename.patch revert-genirq-core-fix-handle_level_irq.patch git-parisc-fixup.patch git-parisc-powerpc-fix.patch git-pcmcia-fixup.patch git-serial.patch git-serial-fixup.patch serial-fix-uart_bug_txen-test.patch pcie-check-and-return-bus_register-errors-fix.patch git-block-vs-git-sas.patch scsi-device_reprobe-can-fail.patch git-scsi-target-fixup.patch git-scsi-target-vs-git-block.patch gregkh-usb-usb-storage-add-rio-karma-eject-support-fix.patch fix-gregkh-usb-usbcore-add-autosuspend-autoresume-infrastructure.patch xpad-dance-pad-support-tidy.patch git-watchdog.patch revert-x86_64-mm-i386-remove-lock-section.patch fix-x86_64-mm-i386-pda-smp-processorid.patch fix-x86_64-mm-spinlock-cleanup.patch revert-x86_64-mm-i386-pda-vm86.patch revert-x86_64-mm-i386-pda-user-abi.patch revert-x86_64-mm-i386-pda-use-gs.patch revert-x86_64-mm-i386-pda-init-pda.patch xfs-rename-uio_read.patch reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-fix.patch have-x86-use-add_active_range-and-free_area_init_nodes-fix.patch vm-add-per-zone-writeout-counter.patch convert-s390-page-handling-macros-to-functions-fix.patch slab-fix-kmalloc_node-applying-memory-policies-if-nodeid-==-numa_node_id-fix.patch gfp_thisnode-for-the-slab-allocator-v2-fix.patch get-rid-of-zone_table-fix.patch do_no_pfn-tweaks.patch shared-page-table-for-hugetlb-page-v2-tidy.patch radix-tree-rcu-lockless-readside.patch acx1xx-wireless-driver.patch tiacx-pci-build-fix.patch tiacx-ia64-fix.patch tiacx-build-fix.patch nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy.patch nommu-move-the-fallback-arch_vma_name-to-a-sensible-place-fix.patch convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls-tidy.patch deprecate-smbfs-in-favour-of-cifs.patch edac-new-opteron-athlon64-memory-controller-driver-tidy.patch inode_diet-replace-inodeugeneric_ip-with-inodei_private-gfs-fix.patch inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-fix-fix.patch x86-microcode-microcode-driver-cleanup-tidy.patch x86-microcode-add-sysfs-and-hotplug-support-fix.patch eisa-bus-modalias-attributes-support-1-fix-git-kbuild-fix.patch add-address_space_operationsbatch_write-fix.patch alloc_fdtable-cleanup.patch sysctl-allow-proc-sys-without-sys_sysctl-fix.patch add-probe_kernel_address.patch x86-use-probe_kernel_address-in-handle_bug.patch blockdevc-check-errors.patch let-warn_on-warn_on_once-return-the-condition-fix.patch let-warn_on-warn_on_once-return-the-condition-fix-2.patch omap-add-watchdog-driver-support-tweaks.patch move-valid_dma_direction-from-x86_64-to-generic-code-fix.patch single-bit-flip-detector-tidy.patch fix-unserialized-task-files-changing-fix.patch tty-make-termios_sem-a-mutex-fix.patch solaris-emulation-incorrect-tty-locking-fix.patch solaris-emulation-incorrect-tty-locking-fix-2.patch cpuset-top_cpuset-tracks-hotplug-changes-to-node_online_map-fix.patch remove-sound-oss-copying.patch maximum-latency-tracking-infrastructure-tidy.patch fs-nameic-replace-multiple-current-fs-by-shortcut-variable-tidy.patch call-mm-page-writebackcset_ratelimit-when-new-pages-tidy.patch sys-modules-patch-allow-full-length-section-names.patch expand_fdtable-remove-pointless-unlocklock.patch add-config_headers_check-option-to-automatically-run-make-headers_check-nobble.patch submit-checklist-mention-headers_check.patch ntp-move-all-the-ntp-related-code-to-ntpc-fix.patch reiserfs-on-demand-bitmap-loading.patch streamline-generic_file_-interfaces-and-filemap-gfs-fix.patch add-vector-aio-support-fix.patch csa-basic-accounting-over-taskstats-fix.patch fs-cache-make-kafs-use-fs-cache-fix.patch fs-cache-make-kafs-use-fs-cache-vs-streamline-generic_file_-interfaces-and-filemap.patch nfs-use-local-caching-12-fix.patch stack-overflow-safe-kdump-crash_use_safe_smp_processor_id-fix.patch generic-ioremap_page_range-x86_64-conversion-fix.patch vfs-make-filldir_t-and-struct-kstat-deal-in-64-bit-inode-numbers-alpha-fix.patch some-cleanup-in-the-pipe-code-tidy.patch support-piping-into-commands-in-proc-sys-kernel-core_pattern-fix.patch move-pidmap-to-pspaceh-fix.patch kprobes-handle-symbol-resolution-when-modulesymbol-is-specified-tidy.patch isdn-work-around-excessive-udelay.patch knfsd-add-a-callback-for-when-last-rpc-thread-finishes-tidy.patch knfsd-add-a-callback-for-when-last-rpc-thread-finishes-fix.patch knfsd-separate-out-some-parts-of-nfsd_svc-which-start-nfs-servers-tweaks.patch knfsd-define-new-nfsdfs-file-portlist-contains-list-of-ports-tidy.patch knfsd-define-new-nfsdfs-file-portlist-contains-list-of-ports-fix.patch knfsd-drop-serv-option-to-svc_recv-and-svc_process-nfs-callback-fix-nfs-callback-fix.patch knfsd-move-tempsock-aging-to-a-timer-tidy.patch sched-remove-unnecessary-sched-group-allocations-fix.patch swap_prefetch-vs-zoned-counters.patch ecryptfs-mmap-operations.patch ecryptfs-alpha-build-fix.patch ecryptfs-more-elegant-aes-key-size-manipulation.patch ecryptfs-get_sb_dev-fix.patch make-kmem_cache_destroy-return-void-ecryptfs.patch ecryptfs-versioning-fixes-tidy.patch namespaces-add-nsproxy.patch namespaces-utsname-switch-to-using-uts-namespaces.patch namespaces-utsname-switch-to-using-uts-namespaces-klibc-bit-sparc.patch namespaces-utsname-use-init_utsname-when-appropriate.patch namespaces-utsname-implement-utsname-namespaces.patch namespaces-utsname-sysctl-hack.patch ipc-namespace-core.patch rename-the-provided-execve-functions-to-kernel_execve-headers-fix.patch replace-cad_pid-by-a-struct-pid-fixes.patch readahead-sysctl-parameters-fix.patch make-copy_from_user_inatomic-not-zero-the-tail-on-i386-vs-reiser4.patch make-kmem_cache_destroy-return-void-reiser4.patch reiser4-hardirq-include-fix.patch reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch reiser4-get_sb_dev-fix.patch reiser4-vs-zoned-allocator.patch reiser4-rename-generic_sounding_globalspatch-fix.patch hpt3xx-rework-rate-filtering-tidy.patch genirq-convert-the-i386-architecture-to-irq-chips.patch genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch genirq-msi-simplify-msi-enable-and-disable.patch genirq-ia64-irq-dynamic-irq-support.patch genirq-msi-only-build-msi-apicc-on-ia64-fix.patch genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-x86_64-irq-make-vector_irq-per-cpu-fix.patch genirq-x86_64-irq-make-vector_irq-per-cpu-warning-fix.patch add-hypertransport-capability-defines-fix.patch initial-generic-hypertransport-interrupt-support-Kconfig-fix.patch srcu-report-out-of-memory-errors-fixlet.patch isdn-debug-build-fix.patch isdn-more-pr_debug-fixes.patch nr_blockdev_pages-in_interrupt-warning.patch device-suspend-debug.patch slab-leaks3-default-y.patch x86-kmap_atomic-debugging.patch restore-rogue-readahead-printk.patch put_bh-debug.patch acpi_format_exception-debug.patch jmicron-warning-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html