diff options
40 files changed, 207 insertions, 96 deletions
diff --git a/arch/ia64/kvm/kvm_lib.c b/arch/ia64/kvm/kvm_lib.c index a85cb611ecd7..f1268b8e6f9e 100644 --- a/arch/ia64/kvm/kvm_lib.c +++ b/arch/ia64/kvm/kvm_lib.c | |||
| @@ -11,5 +11,11 @@ | |||
| 11 | * | 11 | * |
| 12 | */ | 12 | */ |
| 13 | #undef CONFIG_MODULES | 13 | #undef CONFIG_MODULES |
| 14 | #include <linux/module.h> | ||
| 15 | #undef CONFIG_KALLSYMS | ||
| 16 | #undef EXPORT_SYMBOL | ||
| 17 | #undef EXPORT_SYMBOL_GPL | ||
| 18 | #define EXPORT_SYMBOL(sym) | ||
| 19 | #define EXPORT_SYMBOL_GPL(sym) | ||
| 14 | #include "../../../lib/vsprintf.c" | 20 | #include "../../../lib/vsprintf.c" |
| 15 | #include "../../../lib/ctype.c" | 21 | #include "../../../lib/ctype.c" |
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index a27d0d5a6f86..1cd02f6073a0 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
| @@ -99,7 +99,9 @@ struct kvm_s390_sie_block { | |||
| 99 | __u8 reservedd0[48]; /* 0x00d0 */ | 99 | __u8 reservedd0[48]; /* 0x00d0 */ |
| 100 | __u64 gcr[16]; /* 0x0100 */ | 100 | __u64 gcr[16]; /* 0x0100 */ |
| 101 | __u64 gbea; /* 0x0180 */ | 101 | __u64 gbea; /* 0x0180 */ |
| 102 | __u8 reserved188[120]; /* 0x0188 */ | 102 | __u8 reserved188[24]; /* 0x0188 */ |
| 103 | __u32 fac; /* 0x01a0 */ | ||
| 104 | __u8 reserved1a4[92]; /* 0x01a4 */ | ||
| 103 | } __attribute__((packed)); | 105 | } __attribute__((packed)); |
| 104 | 106 | ||
| 105 | struct kvm_vcpu_stat { | 107 | struct kvm_vcpu_stat { |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index c18b21d6991c..90d9d1ba258b 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <asm/lowcore.h> | 25 | #include <asm/lowcore.h> |
| 26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
| 27 | #include <asm/nmi.h> | 27 | #include <asm/nmi.h> |
| 28 | #include <asm/system.h> | ||
| 28 | #include "kvm-s390.h" | 29 | #include "kvm-s390.h" |
| 29 | #include "gaccess.h" | 30 | #include "gaccess.h" |
| 30 | 31 | ||
| @@ -69,6 +70,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
| 69 | { NULL } | 70 | { NULL } |
| 70 | }; | 71 | }; |
| 71 | 72 | ||
| 73 | static unsigned long long *facilities; | ||
| 72 | 74 | ||
| 73 | /* Section: not file related */ | 75 | /* Section: not file related */ |
| 74 | void kvm_arch_hardware_enable(void *garbage) | 76 | void kvm_arch_hardware_enable(void *garbage) |
| @@ -288,6 +290,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
| 288 | vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin; | 290 | vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin; |
| 289 | vcpu->arch.sie_block->ecb = 2; | 291 | vcpu->arch.sie_block->ecb = 2; |
| 290 | vcpu->arch.sie_block->eca = 0xC1002001U; | 292 | vcpu->arch.sie_block->eca = 0xC1002001U; |
| 293 | vcpu->arch.sie_block->fac = (int) (long) facilities; | ||
| 291 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); | 294 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); |
| 292 | tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, | 295 | tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, |
| 293 | (unsigned long) vcpu); | 296 | (unsigned long) vcpu); |
| @@ -739,11 +742,29 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) | |||
| 739 | 742 | ||
| 740 | static int __init kvm_s390_init(void) | 743 | static int __init kvm_s390_init(void) |
| 741 | { | 744 | { |
| 742 | return kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE); | 745 | int ret; |
| 746 | ret = kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE); | ||
| 747 | if (ret) | ||
| 748 | return ret; | ||
| 749 | |||
| 750 | /* | ||
| 751 | * guests can ask for up to 255+1 double words, we need a full page | ||
| 752 | * to hold the maximum amount of facilites. On the other hand, we | ||
| 753 | * only set facilities that are known to work in KVM. | ||
| 754 | */ | ||
| 755 | facilities = (unsigned long long *) get_zeroed_page(GFP_DMA); | ||
| 756 | if (!facilities) { | ||
| 757 | kvm_exit(); | ||
| 758 | return -ENOMEM; | ||
| 759 | } | ||
| 760 | stfle(facilities, 1); | ||
| 761 | facilities[0] &= 0xff00fff3f0700000ULL; | ||
| 762 | return 0; | ||
| 743 | } | 763 | } |
| 744 | 764 | ||
| 745 | static void __exit kvm_s390_exit(void) | 765 | static void __exit kvm_s390_exit(void) |
| 746 | { | 766 | { |
| 767 | free_page((unsigned long) facilities); | ||
| 747 | kvm_exit(); | 768 | kvm_exit(); |
| 748 | } | 769 | } |
| 749 | 770 | ||
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 93ecd06e1a74..d426aac8095d 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
| @@ -158,7 +158,7 @@ static int handle_stfl(struct kvm_vcpu *vcpu) | |||
| 158 | 158 | ||
| 159 | vcpu->stat.instruction_stfl++; | 159 | vcpu->stat.instruction_stfl++; |
| 160 | /* only pass the facility bits, which we can handle */ | 160 | /* only pass the facility bits, which we can handle */ |
| 161 | facility_list &= 0xfe00fff3; | 161 | facility_list &= 0xff00fff3; |
| 162 | 162 | ||
| 163 | rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list), | 163 | rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list), |
| 164 | &facility_list, sizeof(facility_list)); | 164 | &facility_list, sizeof(facility_list)); |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 6b26d4deada0..f1961c07af9a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -848,9 +848,6 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | |||
| 848 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) | 848 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) |
| 849 | numa_add_cpu(smp_processor_id()); | 849 | numa_add_cpu(smp_processor_id()); |
| 850 | #endif | 850 | #endif |
| 851 | |||
| 852 | /* Cap the iomem address space to what is addressable on all CPUs */ | ||
| 853 | iomem_resource.end &= (1ULL << c->x86_phys_bits) - 1; | ||
| 854 | } | 851 | } |
| 855 | 852 | ||
| 856 | #ifdef CONFIG_X86_64 | 853 | #ifdef CONFIG_X86_64 |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5c3d6e81a7dc..7030b5f911bf 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
| @@ -2157,7 +2157,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level) | |||
| 2157 | else | 2157 | else |
| 2158 | /* 32 bits PSE 4MB page */ | 2158 | /* 32 bits PSE 4MB page */ |
| 2159 | context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21); | 2159 | context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21); |
| 2160 | context->rsvd_bits_mask[1][0] = ~0ull; | 2160 | context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0]; |
| 2161 | break; | 2161 | break; |
| 2162 | case PT32E_ROOT_LEVEL: | 2162 | case PT32E_ROOT_LEVEL: |
| 2163 | context->rsvd_bits_mask[0][2] = | 2163 | context->rsvd_bits_mask[0][2] = |
| @@ -2170,7 +2170,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level) | |||
| 2170 | context->rsvd_bits_mask[1][1] = exb_bit_rsvd | | 2170 | context->rsvd_bits_mask[1][1] = exb_bit_rsvd | |
| 2171 | rsvd_bits(maxphyaddr, 62) | | 2171 | rsvd_bits(maxphyaddr, 62) | |
| 2172 | rsvd_bits(13, 20); /* large page */ | 2172 | rsvd_bits(13, 20); /* large page */ |
| 2173 | context->rsvd_bits_mask[1][0] = ~0ull; | 2173 | context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0]; |
| 2174 | break; | 2174 | break; |
| 2175 | case PT64_ROOT_LEVEL: | 2175 | case PT64_ROOT_LEVEL: |
| 2176 | context->rsvd_bits_mask[0][3] = exb_bit_rsvd | | 2176 | context->rsvd_bits_mask[0][3] = exb_bit_rsvd | |
| @@ -2186,7 +2186,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level) | |||
| 2186 | context->rsvd_bits_mask[1][1] = exb_bit_rsvd | | 2186 | context->rsvd_bits_mask[1][1] = exb_bit_rsvd | |
| 2187 | rsvd_bits(maxphyaddr, 51) | | 2187 | rsvd_bits(maxphyaddr, 51) | |
| 2188 | rsvd_bits(13, 20); /* large page */ | 2188 | rsvd_bits(13, 20); /* large page */ |
| 2189 | context->rsvd_bits_mask[1][0] = ~0ull; | 2189 | context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0]; |
| 2190 | break; | 2190 | break; |
| 2191 | } | 2191 | } |
| 2192 | } | 2192 | } |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 258e4591e1ca..67785f635399 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
| @@ -281,7 +281,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
| 281 | { | 281 | { |
| 282 | unsigned access = gw->pt_access; | 282 | unsigned access = gw->pt_access; |
| 283 | struct kvm_mmu_page *shadow_page; | 283 | struct kvm_mmu_page *shadow_page; |
| 284 | u64 spte, *sptep; | 284 | u64 spte, *sptep = NULL; |
| 285 | int direct; | 285 | int direct; |
| 286 | gfn_t table_gfn; | 286 | gfn_t table_gfn; |
| 287 | int r; | 287 | int r; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e770bf349ec4..356a0ce85c68 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -3012,6 +3012,12 @@ static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
| 3012 | return 1; | 3012 | return 1; |
| 3013 | } | 3013 | } |
| 3014 | 3014 | ||
| 3015 | static int handle_vmx_insn(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | ||
| 3016 | { | ||
| 3017 | kvm_queue_exception(vcpu, UD_VECTOR); | ||
| 3018 | return 1; | ||
| 3019 | } | ||
| 3020 | |||
| 3015 | static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | 3021 | static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
| 3016 | { | 3022 | { |
| 3017 | unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); | 3023 | unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); |
| @@ -3198,6 +3204,15 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu, | |||
| 3198 | [EXIT_REASON_HLT] = handle_halt, | 3204 | [EXIT_REASON_HLT] = handle_halt, |
| 3199 | [EXIT_REASON_INVLPG] = handle_invlpg, | 3205 | [EXIT_REASON_INVLPG] = handle_invlpg, |
| 3200 | [EXIT_REASON_VMCALL] = handle_vmcall, | 3206 | [EXIT_REASON_VMCALL] = handle_vmcall, |
| 3207 | [EXIT_REASON_VMCLEAR] = handle_vmx_insn, | ||
| 3208 | [EXIT_REASON_VMLAUNCH] = handle_vmx_insn, | ||
| 3209 | [EXIT_REASON_VMPTRLD] = handle_vmx_insn, | ||
| 3210 | [EXIT_REASON_VMPTRST] = handle_vmx_insn, | ||
| 3211 | [EXIT_REASON_VMREAD] = handle_vmx_insn, | ||
| 3212 | [EXIT_REASON_VMRESUME] = handle_vmx_insn, | ||
| 3213 | [EXIT_REASON_VMWRITE] = handle_vmx_insn, | ||
| 3214 | [EXIT_REASON_VMOFF] = handle_vmx_insn, | ||
| 3215 | [EXIT_REASON_VMON] = handle_vmx_insn, | ||
| 3201 | [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold, | 3216 | [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold, |
| 3202 | [EXIT_REASON_APIC_ACCESS] = handle_apic_access, | 3217 | [EXIT_REASON_APIC_ACCESS] = handle_apic_access, |
| 3203 | [EXIT_REASON_WBINVD] = handle_wbinvd, | 3218 | [EXIT_REASON_WBINVD] = handle_wbinvd, |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 249540f98513..fe5474aec41a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -898,6 +898,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) | |||
| 898 | case MSR_VM_HSAVE_PA: | 898 | case MSR_VM_HSAVE_PA: |
| 899 | case MSR_P6_EVNTSEL0: | 899 | case MSR_P6_EVNTSEL0: |
| 900 | case MSR_P6_EVNTSEL1: | 900 | case MSR_P6_EVNTSEL1: |
| 901 | case MSR_K7_EVNTSEL0: | ||
| 901 | data = 0; | 902 | data = 0; |
| 902 | break; | 903 | break; |
| 903 | case MSR_MTRRcap: | 904 | case MSR_MTRRcap: |
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index c1b6c232e02b..616de4628d60 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
| @@ -1361,7 +1361,7 @@ static inline int writeback(struct x86_emulate_ctxt *ctxt, | |||
| 1361 | return 0; | 1361 | return 0; |
| 1362 | } | 1362 | } |
| 1363 | 1363 | ||
| 1364 | void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask) | 1364 | static void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask) |
| 1365 | { | 1365 | { |
| 1366 | u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask); | 1366 | u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask); |
| 1367 | /* | 1367 | /* |
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index a19e935847b0..913aa8d3f1c5 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c | |||
| @@ -867,15 +867,22 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty) | |||
| 867 | tty_ldisc_wait_idle(tty); | 867 | tty_ldisc_wait_idle(tty); |
| 868 | 868 | ||
| 869 | /* | 869 | /* |
| 870 | * Shutdown the current line discipline, and reset it to N_TTY. | 870 | * Now kill off the ldisc |
| 871 | * | ||
| 872 | * FIXME: this MUST get fixed for the new reflocking | ||
| 873 | */ | 871 | */ |
| 872 | tty_ldisc_close(tty, tty->ldisc); | ||
| 873 | tty_ldisc_put(tty->ldisc); | ||
| 874 | /* Force an oops if we mess this up */ | ||
| 875 | tty->ldisc = NULL; | ||
| 876 | |||
| 877 | /* Ensure the next open requests the N_TTY ldisc */ | ||
| 878 | tty_set_termios_ldisc(tty, N_TTY); | ||
| 874 | 879 | ||
| 875 | tty_ldisc_reinit(tty); | ||
| 876 | /* This will need doing differently if we need to lock */ | 880 | /* This will need doing differently if we need to lock */ |
| 877 | if (o_tty) | 881 | if (o_tty) |
| 878 | tty_ldisc_release(o_tty, NULL); | 882 | tty_ldisc_release(o_tty, NULL); |
| 883 | |||
| 884 | /* And the memory resources remaining (buffers, termios) will be | ||
| 885 | disposed of when the kref hits zero */ | ||
| 879 | } | 886 | } |
| 880 | 887 | ||
| 881 | /** | 888 | /** |
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c index e4afbd628c23..607007d75b6f 100644 --- a/drivers/net/atl1c/atl1c_ethtool.c +++ b/drivers/net/atl1c/atl1c_ethtool.c | |||
| @@ -281,6 +281,8 @@ static int atl1c_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 281 | if (wol->wolopts & WAKE_PHY) | 281 | if (wol->wolopts & WAKE_PHY) |
| 282 | adapter->wol |= AT_WUFC_LNKC; | 282 | adapter->wol |= AT_WUFC_LNKC; |
| 283 | 283 | ||
| 284 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 285 | |||
| 284 | return 0; | 286 | return 0; |
| 285 | } | 287 | } |
| 286 | 288 | ||
diff --git a/drivers/net/atl1e/atl1e_ethtool.c b/drivers/net/atl1e/atl1e_ethtool.c index 619c6583e1aa..4003955d7a96 100644 --- a/drivers/net/atl1e/atl1e_ethtool.c +++ b/drivers/net/atl1e/atl1e_ethtool.c | |||
| @@ -365,6 +365,8 @@ static int atl1e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 365 | if (wol->wolopts & WAKE_PHY) | 365 | if (wol->wolopts & WAKE_PHY) |
| 366 | adapter->wol |= AT_WUFC_LNKC; | 366 | adapter->wol |= AT_WUFC_LNKC; |
| 367 | 367 | ||
| 368 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 369 | |||
| 368 | return 0; | 370 | return 0; |
| 369 | } | 371 | } |
| 370 | 372 | ||
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index f703758f0a6e..5b4bf3d2cdc2 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
| @@ -73,7 +73,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
| 73 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) | 73 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) |
| 74 | 74 | ||
| 75 | #define BE_MAX_LRO_DESCRIPTORS 16 | 75 | #define BE_MAX_LRO_DESCRIPTORS 16 |
| 76 | #define BE_MAX_FRAGS_PER_FRAME 16 | 76 | #define BE_MAX_FRAGS_PER_FRAME (min((u32) 16, (u32) MAX_SKB_FRAGS)) |
| 77 | 77 | ||
| 78 | struct be_dma_mem { | 78 | struct be_dma_mem { |
| 79 | void *va; | 79 | void *va; |
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 9592f22e4c8c..cccc5419ad72 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
| @@ -162,8 +162,8 @@ be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce) | |||
| 162 | return -EINVAL; | 162 | return -EINVAL; |
| 163 | 163 | ||
| 164 | adapter->max_rx_coal = coalesce->rx_max_coalesced_frames; | 164 | adapter->max_rx_coal = coalesce->rx_max_coalesced_frames; |
| 165 | if (adapter->max_rx_coal > MAX_SKB_FRAGS) | 165 | if (adapter->max_rx_coal > BE_MAX_FRAGS_PER_FRAME) |
| 166 | adapter->max_rx_coal = MAX_SKB_FRAGS - 1; | 166 | adapter->max_rx_coal = BE_MAX_FRAGS_PER_FRAME; |
| 167 | 167 | ||
| 168 | /* if AIC is being turned on now, start with an EQD of 0 */ | 168 | /* if AIC is being turned on now, start with an EQD of 0 */ |
| 169 | if (rx_eq->enable_aic == 0 && | 169 | if (rx_eq->enable_aic == 0 && |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 66c10c87f517..308eb09ca56b 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
| @@ -666,7 +666,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
| 666 | { | 666 | { |
| 667 | struct be_queue_info *rxq = &adapter->rx_obj.q; | 667 | struct be_queue_info *rxq = &adapter->rx_obj.q; |
| 668 | struct be_rx_page_info *page_info; | 668 | struct be_rx_page_info *page_info; |
| 669 | u16 rxq_idx, i, num_rcvd; | 669 | u16 rxq_idx, i, num_rcvd, j; |
| 670 | u32 pktsize, hdr_len, curr_frag_len; | 670 | u32 pktsize, hdr_len, curr_frag_len; |
| 671 | u8 *start; | 671 | u8 *start; |
| 672 | 672 | ||
| @@ -709,22 +709,33 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
| 709 | 709 | ||
| 710 | /* More frags present for this completion */ | 710 | /* More frags present for this completion */ |
| 711 | pktsize -= curr_frag_len; /* account for above copied frag */ | 711 | pktsize -= curr_frag_len; /* account for above copied frag */ |
| 712 | for (i = 1; i < num_rcvd; i++) { | 712 | for (i = 1, j = 0; i < num_rcvd; i++) { |
| 713 | index_inc(&rxq_idx, rxq->len); | 713 | index_inc(&rxq_idx, rxq->len); |
| 714 | page_info = get_rx_page_info(adapter, rxq_idx); | 714 | page_info = get_rx_page_info(adapter, rxq_idx); |
| 715 | 715 | ||
| 716 | curr_frag_len = min(pktsize, rx_frag_size); | 716 | curr_frag_len = min(pktsize, rx_frag_size); |
| 717 | 717 | ||
| 718 | skb_shinfo(skb)->frags[i].page = page_info->page; | 718 | /* Coalesce all frags from the same physical page in one slot */ |
| 719 | skb_shinfo(skb)->frags[i].page_offset = page_info->page_offset; | 719 | if (page_info->page_offset == 0) { |
| 720 | skb_shinfo(skb)->frags[i].size = curr_frag_len; | 720 | /* Fresh page */ |
| 721 | j++; | ||
| 722 | skb_shinfo(skb)->frags[j].page = page_info->page; | ||
| 723 | skb_shinfo(skb)->frags[j].page_offset = | ||
| 724 | page_info->page_offset; | ||
| 725 | skb_shinfo(skb)->frags[j].size = 0; | ||
| 726 | skb_shinfo(skb)->nr_frags++; | ||
| 727 | } else { | ||
| 728 | put_page(page_info->page); | ||
| 729 | } | ||
| 730 | |||
| 731 | skb_shinfo(skb)->frags[j].size += curr_frag_len; | ||
| 721 | skb->len += curr_frag_len; | 732 | skb->len += curr_frag_len; |
| 722 | skb->data_len += curr_frag_len; | 733 | skb->data_len += curr_frag_len; |
| 723 | skb_shinfo(skb)->nr_frags++; | ||
| 724 | pktsize -= curr_frag_len; | 734 | pktsize -= curr_frag_len; |
| 725 | 735 | ||
| 726 | memset(page_info, 0, sizeof(*page_info)); | 736 | memset(page_info, 0, sizeof(*page_info)); |
| 727 | } | 737 | } |
| 738 | BUG_ON(j > MAX_SKB_FRAGS); | ||
| 728 | 739 | ||
| 729 | done: | 740 | done: |
| 730 | be_rx_stats_update(adapter, pktsize, num_rcvd); | 741 | be_rx_stats_update(adapter, pktsize, num_rcvd); |
| @@ -786,7 +797,7 @@ static void be_rx_compl_process_lro(struct be_adapter *adapter, | |||
| 786 | struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME]; | 797 | struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME]; |
| 787 | struct be_queue_info *rxq = &adapter->rx_obj.q; | 798 | struct be_queue_info *rxq = &adapter->rx_obj.q; |
| 788 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; | 799 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; |
| 789 | u16 i, rxq_idx = 0, vid; | 800 | u16 i, rxq_idx = 0, vid, j; |
| 790 | 801 | ||
| 791 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); | 802 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); |
| 792 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); | 803 | pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); |
| @@ -794,20 +805,28 @@ static void be_rx_compl_process_lro(struct be_adapter *adapter, | |||
| 794 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); | 805 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); |
| 795 | 806 | ||
| 796 | remaining = pkt_size; | 807 | remaining = pkt_size; |
| 797 | for (i = 0; i < num_rcvd; i++) { | 808 | for (i = 0, j = -1; i < num_rcvd; i++) { |
| 798 | page_info = get_rx_page_info(adapter, rxq_idx); | 809 | page_info = get_rx_page_info(adapter, rxq_idx); |
| 799 | 810 | ||
| 800 | curr_frag_len = min(remaining, rx_frag_size); | 811 | curr_frag_len = min(remaining, rx_frag_size); |
| 801 | 812 | ||
| 802 | rx_frags[i].page = page_info->page; | 813 | /* Coalesce all frags from the same physical page in one slot */ |
| 803 | rx_frags[i].page_offset = page_info->page_offset; | 814 | if (i == 0 || page_info->page_offset == 0) { |
| 804 | rx_frags[i].size = curr_frag_len; | 815 | /* First frag or Fresh page */ |
| 805 | remaining -= curr_frag_len; | 816 | j++; |
| 817 | rx_frags[j].page = page_info->page; | ||
| 818 | rx_frags[j].page_offset = page_info->page_offset; | ||
| 819 | rx_frags[j].size = 0; | ||
| 820 | } else { | ||
| 821 | put_page(page_info->page); | ||
| 822 | } | ||
| 823 | rx_frags[j].size += curr_frag_len; | ||
| 806 | 824 | ||
| 825 | remaining -= curr_frag_len; | ||
| 807 | index_inc(&rxq_idx, rxq->len); | 826 | index_inc(&rxq_idx, rxq->len); |
| 808 | |||
| 809 | memset(page_info, 0, sizeof(*page_info)); | 827 | memset(page_info, 0, sizeof(*page_info)); |
| 810 | } | 828 | } |
| 829 | BUG_ON(j > MAX_SKB_FRAGS); | ||
| 811 | 830 | ||
| 812 | if (likely(!vlanf)) { | 831 | if (likely(!vlanf)) { |
| 813 | lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size, | 832 | lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size, |
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 58afafbd3b9c..fd5e32cbcb87 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
| @@ -1097,7 +1097,7 @@ static const struct net_device_ops cpmac_netdev_ops = { | |||
| 1097 | .ndo_start_xmit = cpmac_start_xmit, | 1097 | .ndo_start_xmit = cpmac_start_xmit, |
| 1098 | .ndo_tx_timeout = cpmac_tx_timeout, | 1098 | .ndo_tx_timeout = cpmac_tx_timeout, |
| 1099 | .ndo_set_multicast_list = cpmac_set_multicast_list, | 1099 | .ndo_set_multicast_list = cpmac_set_multicast_list, |
| 1100 | .ndo_so_ioctl = cpmac_ioctl, | 1100 | .ndo_do_ioctl = cpmac_ioctl, |
| 1101 | .ndo_set_config = cpmac_config, | 1101 | .ndo_set_config = cpmac_config, |
| 1102 | .ndo_change_mtu = eth_change_mtu, | 1102 | .ndo_change_mtu = eth_change_mtu, |
| 1103 | .ndo_validate_addr = eth_validate_addr, | 1103 | .ndo_validate_addr = eth_validate_addr, |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index 3af581303ca2..d167090248e2 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
| @@ -188,7 +188,7 @@ static int fsl_pq_mdio_find_free(struct mii_bus *new_bus) | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | 190 | ||
| 191 | #ifdef CONFIG_GIANFAR | 191 | #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) |
| 192 | static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) | 192 | static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) |
| 193 | { | 193 | { |
| 194 | struct gfar __iomem *enet_regs; | 194 | struct gfar __iomem *enet_regs; |
| @@ -206,7 +206,7 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs) | |||
| 206 | #endif | 206 | #endif |
| 207 | 207 | ||
| 208 | 208 | ||
| 209 | #ifdef CONFIG_UCC_GETH | 209 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) |
| 210 | static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) | 210 | static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) |
| 211 | { | 211 | { |
| 212 | struct device_node *np = NULL; | 212 | struct device_node *np = NULL; |
| @@ -291,7 +291,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev, | |||
| 291 | if (of_device_is_compatible(np, "fsl,gianfar-mdio") || | 291 | if (of_device_is_compatible(np, "fsl,gianfar-mdio") || |
| 292 | of_device_is_compatible(np, "fsl,gianfar-tbi") || | 292 | of_device_is_compatible(np, "fsl,gianfar-tbi") || |
| 293 | of_device_is_compatible(np, "gianfar")) { | 293 | of_device_is_compatible(np, "gianfar")) { |
| 294 | #ifdef CONFIG_GIANFAR | 294 | #if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE) |
| 295 | tbipa = get_gfar_tbipa(regs); | 295 | tbipa = get_gfar_tbipa(regs); |
| 296 | #else | 296 | #else |
| 297 | err = -ENODEV; | 297 | err = -ENODEV; |
| @@ -299,7 +299,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev, | |||
| 299 | #endif | 299 | #endif |
| 300 | } else if (of_device_is_compatible(np, "fsl,ucc-mdio") || | 300 | } else if (of_device_is_compatible(np, "fsl,ucc-mdio") || |
| 301 | of_device_is_compatible(np, "ucc_geth_phy")) { | 301 | of_device_is_compatible(np, "ucc_geth_phy")) { |
| 302 | #ifdef CONFIG_UCC_GETH | 302 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE) |
| 303 | u32 id; | 303 | u32 id; |
| 304 | static u32 mii_mng_master; | 304 | static u32 mii_mng_master; |
| 305 | 305 | ||
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c index dc45e9856c35..6851bdb2ce29 100644 --- a/drivers/net/mdio.c +++ b/drivers/net/mdio.c | |||
| @@ -14,6 +14,10 @@ | |||
| 14 | #include <linux/mdio.h> | 14 | #include <linux/mdio.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | 16 | ||
| 17 | MODULE_DESCRIPTION("Generic support for MDIO-compatible transceivers"); | ||
| 18 | MODULE_AUTHOR("Copyright 2006-2009 Solarflare Communications Inc."); | ||
| 19 | MODULE_LICENSE("GPL"); | ||
| 20 | |||
| 17 | /** | 21 | /** |
| 18 | * mdio45_probe - probe for an MDIO (clause 45) device | 22 | * mdio45_probe - probe for an MDIO (clause 45) device |
| 19 | * @mdio: MDIO interface | 23 | * @mdio: MDIO interface |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 341882f959f3..a2d82ddb3b4d 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
| @@ -865,8 +865,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
| 865 | struct sh_eth_private *mdp = netdev_priv(ndev); | 865 | struct sh_eth_private *mdp = netdev_priv(ndev); |
| 866 | struct sh_eth_cpu_data *cd = mdp->cd; | 866 | struct sh_eth_cpu_data *cd = mdp->cd; |
| 867 | irqreturn_t ret = IRQ_NONE; | 867 | irqreturn_t ret = IRQ_NONE; |
| 868 | u32 ioaddr, boguscnt = RX_RING_SIZE; | 868 | u32 ioaddr, intr_status = 0; |
| 869 | u32 intr_status = 0; | ||
| 870 | 869 | ||
| 871 | ioaddr = ndev->base_addr; | 870 | ioaddr = ndev->base_addr; |
| 872 | spin_lock(&mdp->lock); | 871 | spin_lock(&mdp->lock); |
| @@ -901,12 +900,6 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
| 901 | if (intr_status & cd->eesr_err_check) | 900 | if (intr_status & cd->eesr_err_check) |
| 902 | sh_eth_error(ndev, intr_status); | 901 | sh_eth_error(ndev, intr_status); |
| 903 | 902 | ||
| 904 | if (--boguscnt < 0) { | ||
| 905 | printk(KERN_WARNING | ||
| 906 | "%s: Too much work at interrupt, status=0x%4.4x.\n", | ||
| 907 | ndev->name, intr_status); | ||
| 908 | } | ||
| 909 | |||
| 910 | other_irq: | 903 | other_irq: |
| 911 | spin_unlock(&mdp->lock); | 904 | spin_unlock(&mdp->lock); |
| 912 | 905 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 7681d28c53d7..daf961ab68bc 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
| @@ -2495,7 +2495,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
| 2495 | if (likely(status >> 16 == (status & 0xffff))) { | 2495 | if (likely(status >> 16 == (status & 0xffff))) { |
| 2496 | skb = sky2->rx_ring[sky2->rx_next].skb; | 2496 | skb = sky2->rx_ring[sky2->rx_next].skb; |
| 2497 | skb->ip_summed = CHECKSUM_COMPLETE; | 2497 | skb->ip_summed = CHECKSUM_COMPLETE; |
| 2498 | skb->csum = status & 0xffff; | 2498 | skb->csum = le16_to_cpu(status); |
| 2499 | } else { | 2499 | } else { |
| 2500 | printk(KERN_NOTICE PFX "%s: hardware receive " | 2500 | printk(KERN_NOTICE PFX "%s: hardware receive " |
| 2501 | "checksum problem (status = %#x)\n", | 2501 | "checksum problem (status = %#x)\n", |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 87197dd9c788..1097c72e44d5 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
| @@ -208,11 +208,14 @@ rx_drop: | |||
| 208 | 208 | ||
| 209 | static struct net_device_stats *veth_get_stats(struct net_device *dev) | 209 | static struct net_device_stats *veth_get_stats(struct net_device *dev) |
| 210 | { | 210 | { |
| 211 | struct veth_priv *priv = netdev_priv(dev); | 211 | struct veth_priv *priv; |
| 212 | struct net_device_stats *dev_stats = &dev->stats; | 212 | struct net_device_stats *dev_stats; |
| 213 | unsigned int cpu; | 213 | int cpu; |
| 214 | struct veth_net_stats *stats; | 214 | struct veth_net_stats *stats; |
| 215 | 215 | ||
| 216 | priv = netdev_priv(dev); | ||
| 217 | dev_stats = &dev->stats; | ||
| 218 | |||
| 216 | dev_stats->rx_packets = 0; | 219 | dev_stats->rx_packets = 0; |
| 217 | dev_stats->tx_packets = 0; | 220 | dev_stats->tx_packets = 0; |
| 218 | dev_stats->rx_bytes = 0; | 221 | dev_stats->rx_bytes = 0; |
| @@ -220,17 +223,16 @@ static struct net_device_stats *veth_get_stats(struct net_device *dev) | |||
| 220 | dev_stats->tx_dropped = 0; | 223 | dev_stats->tx_dropped = 0; |
| 221 | dev_stats->rx_dropped = 0; | 224 | dev_stats->rx_dropped = 0; |
| 222 | 225 | ||
| 223 | if (priv->stats) | 226 | for_each_online_cpu(cpu) { |
| 224 | for_each_online_cpu(cpu) { | 227 | stats = per_cpu_ptr(priv->stats, cpu); |
| 225 | stats = per_cpu_ptr(priv->stats, cpu); | ||
| 226 | 228 | ||
| 227 | dev_stats->rx_packets += stats->rx_packets; | 229 | dev_stats->rx_packets += stats->rx_packets; |
| 228 | dev_stats->tx_packets += stats->tx_packets; | 230 | dev_stats->tx_packets += stats->tx_packets; |
| 229 | dev_stats->rx_bytes += stats->rx_bytes; | 231 | dev_stats->rx_bytes += stats->rx_bytes; |
| 230 | dev_stats->tx_bytes += stats->tx_bytes; | 232 | dev_stats->tx_bytes += stats->tx_bytes; |
| 231 | dev_stats->tx_dropped += stats->tx_dropped; | 233 | dev_stats->tx_dropped += stats->tx_dropped; |
| 232 | dev_stats->rx_dropped += stats->rx_dropped; | 234 | dev_stats->rx_dropped += stats->rx_dropped; |
| 233 | } | 235 | } |
| 234 | 236 | ||
| 235 | return dev_stats; | 237 | return dev_stats; |
| 236 | } | 238 | } |
| @@ -257,8 +259,6 @@ static int veth_close(struct net_device *dev) | |||
| 257 | netif_carrier_off(dev); | 259 | netif_carrier_off(dev); |
| 258 | netif_carrier_off(priv->peer); | 260 | netif_carrier_off(priv->peer); |
| 259 | 261 | ||
| 260 | free_percpu(priv->stats); | ||
| 261 | priv->stats = NULL; | ||
| 262 | return 0; | 262 | return 0; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| @@ -289,6 +289,15 @@ static int veth_dev_init(struct net_device *dev) | |||
| 289 | return 0; | 289 | return 0; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | static void veth_dev_free(struct net_device *dev) | ||
| 293 | { | ||
| 294 | struct veth_priv *priv; | ||
| 295 | |||
| 296 | priv = netdev_priv(dev); | ||
| 297 | free_percpu(priv->stats); | ||
| 298 | free_netdev(dev); | ||
| 299 | } | ||
| 300 | |||
| 292 | static const struct net_device_ops veth_netdev_ops = { | 301 | static const struct net_device_ops veth_netdev_ops = { |
| 293 | .ndo_init = veth_dev_init, | 302 | .ndo_init = veth_dev_init, |
| 294 | .ndo_open = veth_open, | 303 | .ndo_open = veth_open, |
| @@ -306,7 +315,7 @@ static void veth_setup(struct net_device *dev) | |||
| 306 | dev->netdev_ops = &veth_netdev_ops; | 315 | dev->netdev_ops = &veth_netdev_ops; |
| 307 | dev->ethtool_ops = &veth_ethtool_ops; | 316 | dev->ethtool_ops = &veth_ethtool_ops; |
| 308 | dev->features |= NETIF_F_LLTX; | 317 | dev->features |= NETIF_F_LLTX; |
| 309 | dev->destructor = free_netdev; | 318 | dev->destructor = veth_dev_free; |
| 310 | } | 319 | } |
| 311 | 320 | ||
| 312 | /* | 321 | /* |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index fee6a4022bc1..46dad12f952f 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -355,10 +355,9 @@ config EEEPC_LAPTOP | |||
| 355 | depends on INPUT | 355 | depends on INPUT |
| 356 | depends on EXPERIMENTAL | 356 | depends on EXPERIMENTAL |
| 357 | depends on RFKILL || RFKILL = n | 357 | depends on RFKILL || RFKILL = n |
| 358 | depends on HOTPLUG_PCI | ||
| 358 | select BACKLIGHT_CLASS_DEVICE | 359 | select BACKLIGHT_CLASS_DEVICE |
| 359 | select HWMON | 360 | select HWMON |
| 360 | select HOTPLUG | ||
| 361 | select HOTPLUG_PCI if PCI | ||
| 362 | ---help--- | 361 | ---help--- |
| 363 | This driver supports the Fn-Fx keys on Eee PC laptops. | 362 | This driver supports the Fn-Fx keys on Eee PC laptops. |
| 364 | 363 | ||
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index 1dae7f8f3c6b..51422fc4f606 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c | |||
| @@ -356,7 +356,7 @@ static int __devinit tdo24m_probe(struct spi_device *spi) | |||
| 356 | lcd->power = FB_BLANK_POWERDOWN; | 356 | lcd->power = FB_BLANK_POWERDOWN; |
| 357 | lcd->mode = MODE_VGA; /* default to VGA */ | 357 | lcd->mode = MODE_VGA; /* default to VGA */ |
| 358 | 358 | ||
| 359 | lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, sizeof(GFP_KERNEL)); | 359 | lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, GFP_KERNEL); |
| 360 | if (lcd->buf == NULL) { | 360 | if (lcd->buf == NULL) { |
| 361 | kfree(lcd); | 361 | kfree(lcd); |
| 362 | return -ENOMEM; | 362 | return -ENOMEM; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index aacc5449f586..16713dc672e4 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -125,6 +125,7 @@ struct kvm_kernel_irq_routing_entry { | |||
| 125 | struct kvm { | 125 | struct kvm { |
| 126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ | 126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ |
| 127 | spinlock_t mmu_lock; | 127 | spinlock_t mmu_lock; |
| 128 | spinlock_t requests_lock; | ||
| 128 | struct rw_semaphore slots_lock; | 129 | struct rw_semaphore slots_lock; |
| 129 | struct mm_struct *mm; /* userspace tied to this vm */ | 130 | struct mm_struct *mm; /* userspace tied to this vm */ |
| 130 | int nmemslots; | 131 | int nmemslots; |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 5054dc5ea2c2..29d126736611 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
| @@ -45,6 +45,7 @@ int phonet_address_add(struct net_device *dev, u8 addr); | |||
| 45 | int phonet_address_del(struct net_device *dev, u8 addr); | 45 | int phonet_address_del(struct net_device *dev, u8 addr); |
| 46 | u8 phonet_address_get(struct net_device *dev, u8 addr); | 46 | u8 phonet_address_get(struct net_device *dev, u8 addr); |
| 47 | int phonet_address_lookup(struct net *net, u8 addr); | 47 | int phonet_address_lookup(struct net *net, u8 addr); |
| 48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); | ||
| 48 | 49 | ||
| 49 | #define PN_NO_ADDR 0xff | 50 | #define PN_NO_ADDR 0xff |
| 50 | 51 | ||
diff --git a/net/bridge/br.c b/net/bridge/br.c index 9aac5213105a..e1241c76239a 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c | |||
| @@ -93,7 +93,7 @@ static void __exit br_deinit(void) | |||
| 93 | 93 | ||
| 94 | unregister_pernet_subsys(&br_net_ops); | 94 | unregister_pernet_subsys(&br_net_ops); |
| 95 | 95 | ||
| 96 | synchronize_net(); | 96 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ |
| 97 | 97 | ||
| 98 | br_netfilter_fini(); | 98 | br_netfilter_fini(); |
| 99 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) | 99 | #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) |
diff --git a/net/core/dev.c b/net/core/dev.c index 60b572812278..70c27e0c7c32 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2823,9 +2823,11 @@ static void net_rx_action(struct softirq_action *h) | |||
| 2823 | * move the instance around on the list at-will. | 2823 | * move the instance around on the list at-will. |
| 2824 | */ | 2824 | */ |
| 2825 | if (unlikely(work == weight)) { | 2825 | if (unlikely(work == weight)) { |
| 2826 | if (unlikely(napi_disable_pending(n))) | 2826 | if (unlikely(napi_disable_pending(n))) { |
| 2827 | __napi_complete(n); | 2827 | local_irq_enable(); |
| 2828 | else | 2828 | napi_complete(n); |
| 2829 | local_irq_disable(); | ||
| 2830 | } else | ||
| 2829 | list_move_tail(&n->poll_list, list); | 2831 | list_move_tail(&n->poll_list, list); |
| 2830 | } | 2832 | } |
| 2831 | 2833 | ||
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index d351b8db0df5..77d40289653c 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
| @@ -2413,6 +2413,8 @@ static void __exit decnet_exit(void) | |||
| 2413 | proc_net_remove(&init_net, "decnet"); | 2413 | proc_net_remove(&init_net, "decnet"); |
| 2414 | 2414 | ||
| 2415 | proto_unregister(&dn_proto); | 2415 | proto_unregister(&dn_proto); |
| 2416 | |||
| 2417 | rcu_barrier_bh(); /* Wait for completion of call_rcu_bh()'s */ | ||
| 2416 | } | 2418 | } |
| 2417 | module_exit(decnet_exit); | 2419 | module_exit(decnet_exit); |
| 2418 | #endif | 2420 | #endif |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 490ce20faf38..db46b4b5b2b9 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
| @@ -440,6 +440,9 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
| 440 | /* Remove any debris in the socket control block */ | 440 | /* Remove any debris in the socket control block */ |
| 441 | memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); | 441 | memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); |
| 442 | 442 | ||
| 443 | /* Must drop socket now because of tproxy. */ | ||
| 444 | skb_orphan(skb); | ||
| 445 | |||
| 443 | return NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, dev, NULL, | 446 | return NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, dev, NULL, |
| 444 | ip_rcv_finish); | 447 | ip_rcv_finish); |
| 445 | 448 | ||
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 43bbba7926ee..f8d67ccc64f3 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
| @@ -128,7 +128,8 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, | |||
| 128 | goto kill_with_rst; | 128 | goto kill_with_rst; |
| 129 | 129 | ||
| 130 | /* Dup ACK? */ | 130 | /* Dup ACK? */ |
| 131 | if (!after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) || | 131 | if (!th->ack || |
| 132 | !after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) || | ||
| 132 | TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) { | 133 | TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) { |
| 133 | inet_twsk_put(tw); | 134 | inet_twsk_put(tw); |
| 134 | return TCP_TW_SUCCESS; | 135 | return TCP_TW_SUCCESS; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8c1e86afbbf5..3883b4036a74 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -3362,7 +3362,10 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa, | |||
| 3362 | valid = ifa->valid_lft; | 3362 | valid = ifa->valid_lft; |
| 3363 | if (preferred != INFINITY_LIFE_TIME) { | 3363 | if (preferred != INFINITY_LIFE_TIME) { |
| 3364 | long tval = (jiffies - ifa->tstamp)/HZ; | 3364 | long tval = (jiffies - ifa->tstamp)/HZ; |
| 3365 | preferred -= tval; | 3365 | if (preferred > tval) |
| 3366 | preferred -= tval; | ||
| 3367 | else | ||
| 3368 | preferred = 0; | ||
| 3366 | if (valid != INFINITY_LIFE_TIME) | 3369 | if (valid != INFINITY_LIFE_TIME) |
| 3367 | valid -= tval; | 3370 | valid -= tval; |
| 3368 | } | 3371 | } |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 85b3d0036afd..caa0278d30a9 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -1284,6 +1284,8 @@ static void __exit inet6_exit(void) | |||
| 1284 | proto_unregister(&udplitev6_prot); | 1284 | proto_unregister(&udplitev6_prot); |
| 1285 | proto_unregister(&udpv6_prot); | 1285 | proto_unregister(&udpv6_prot); |
| 1286 | proto_unregister(&tcpv6_prot); | 1286 | proto_unregister(&tcpv6_prot); |
| 1287 | |||
| 1288 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ | ||
| 1287 | } | 1289 | } |
| 1288 | module_exit(inet6_exit); | 1290 | module_exit(inet6_exit); |
| 1289 | 1291 | ||
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index c3a07d75b5f5..6d6a4277c677 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
| @@ -139,6 +139,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
| 139 | 139 | ||
| 140 | rcu_read_unlock(); | 140 | rcu_read_unlock(); |
| 141 | 141 | ||
| 142 | /* Must drop socket now because of tproxy. */ | ||
| 143 | skb_orphan(skb); | ||
| 144 | |||
| 142 | return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL, | 145 | return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL, |
| 143 | ip6_rcv_finish); | 146 | ip6_rcv_finish); |
| 144 | err: | 147 | err: |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index fc712e60705d..11cf45bce38a 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
| @@ -494,7 +494,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) | |||
| 494 | * should it be using the interface and enqueuing | 494 | * should it be using the interface and enqueuing |
| 495 | * frames at this very time on another CPU. | 495 | * frames at this very time on another CPU. |
| 496 | */ | 496 | */ |
| 497 | synchronize_rcu(); | 497 | rcu_barrier(); /* Wait for RX path and call_rcu()'s */ |
| 498 | skb_queue_purge(&sdata->u.mesh.skb_queue); | 498 | skb_queue_purge(&sdata->u.mesh.skb_queue); |
| 499 | } | 499 | } |
| 500 | 500 | ||
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 80a322d77909..b0d6ddd82a9d 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
| @@ -69,10 +69,27 @@ static struct phonet_device *__phonet_get(struct net_device *dev) | |||
| 69 | return NULL; | 69 | return NULL; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | static void __phonet_device_free(struct phonet_device *pnd) | 72 | static void phonet_device_destroy(struct net_device *dev) |
| 73 | { | 73 | { |
| 74 | list_del(&pnd->list); | 74 | struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev)); |
| 75 | kfree(pnd); | 75 | struct phonet_device *pnd; |
| 76 | |||
| 77 | ASSERT_RTNL(); | ||
| 78 | |||
| 79 | spin_lock_bh(&pndevs->lock); | ||
| 80 | pnd = __phonet_get(dev); | ||
| 81 | if (pnd) | ||
| 82 | list_del(&pnd->list); | ||
| 83 | spin_unlock_bh(&pndevs->lock); | ||
| 84 | |||
| 85 | if (pnd) { | ||
| 86 | u8 addr; | ||
| 87 | |||
| 88 | for (addr = find_first_bit(pnd->addrs, 64); addr < 64; | ||
| 89 | addr = find_next_bit(pnd->addrs, 64, 1+addr)) | ||
| 90 | phonet_address_notify(RTM_DELADDR, dev, addr); | ||
| 91 | kfree(pnd); | ||
| 92 | } | ||
| 76 | } | 93 | } |
| 77 | 94 | ||
| 78 | struct net_device *phonet_device_get(struct net *net) | 95 | struct net_device *phonet_device_get(struct net *net) |
| @@ -126,8 +143,10 @@ int phonet_address_del(struct net_device *dev, u8 addr) | |||
| 126 | pnd = __phonet_get(dev); | 143 | pnd = __phonet_get(dev); |
| 127 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) | 144 | if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) |
| 128 | err = -EADDRNOTAVAIL; | 145 | err = -EADDRNOTAVAIL; |
| 129 | else if (bitmap_empty(pnd->addrs, 64)) | 146 | else if (bitmap_empty(pnd->addrs, 64)) { |
| 130 | __phonet_device_free(pnd); | 147 | list_del(&pnd->list); |
| 148 | kfree(pnd); | ||
| 149 | } | ||
| 131 | spin_unlock_bh(&pndevs->lock); | 150 | spin_unlock_bh(&pndevs->lock); |
| 132 | return err; | 151 | return err; |
| 133 | } | 152 | } |
| @@ -181,18 +200,8 @@ static int phonet_device_notify(struct notifier_block *me, unsigned long what, | |||
| 181 | { | 200 | { |
| 182 | struct net_device *dev = arg; | 201 | struct net_device *dev = arg; |
| 183 | 202 | ||
| 184 | if (what == NETDEV_UNREGISTER) { | 203 | if (what == NETDEV_UNREGISTER) |
| 185 | struct phonet_device_list *pndevs; | 204 | phonet_device_destroy(dev); |
| 186 | struct phonet_device *pnd; | ||
| 187 | |||
| 188 | /* Destroy phonet-specific device data */ | ||
| 189 | pndevs = phonet_device_list(dev_net(dev)); | ||
| 190 | spin_lock_bh(&pndevs->lock); | ||
| 191 | pnd = __phonet_get(dev); | ||
| 192 | if (pnd) | ||
| 193 | __phonet_device_free(pnd); | ||
| 194 | spin_unlock_bh(&pndevs->lock); | ||
| 195 | } | ||
| 196 | return 0; | 205 | return 0; |
| 197 | 206 | ||
| 198 | } | 207 | } |
| @@ -218,11 +227,12 @@ static int phonet_init_net(struct net *net) | |||
| 218 | static void phonet_exit_net(struct net *net) | 227 | static void phonet_exit_net(struct net *net) |
| 219 | { | 228 | { |
| 220 | struct phonet_net *pnn = net_generic(net, phonet_net_id); | 229 | struct phonet_net *pnn = net_generic(net, phonet_net_id); |
| 221 | struct phonet_device *pnd, *n; | 230 | struct net_device *dev; |
| 222 | |||
| 223 | list_for_each_entry_safe(pnd, n, &pnn->pndevs.list, list) | ||
| 224 | __phonet_device_free(pnd); | ||
| 225 | 231 | ||
| 232 | rtnl_lock(); | ||
| 233 | for_each_netdev(net, dev) | ||
| 234 | phonet_device_destroy(dev); | ||
| 235 | rtnl_unlock(); | ||
| 226 | kfree(pnn); | 236 | kfree(pnn); |
| 227 | } | 237 | } |
| 228 | 238 | ||
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index cec4e5951681..f8b4cee434c2 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr, | 32 | static int fill_addr(struct sk_buff *skb, struct net_device *dev, u8 addr, |
| 33 | u32 pid, u32 seq, int event); | 33 | u32 pid, u32 seq, int event); |
| 34 | 34 | ||
| 35 | static void rtmsg_notify(int event, struct net_device *dev, u8 addr) | 35 | void phonet_address_notify(int event, struct net_device *dev, u8 addr) |
| 36 | { | 36 | { |
| 37 | struct sk_buff *skb; | 37 | struct sk_buff *skb; |
| 38 | int err = -ENOBUFS; | 38 | int err = -ENOBUFS; |
| @@ -94,7 +94,7 @@ static int addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *attr) | |||
| 94 | else | 94 | else |
| 95 | err = phonet_address_del(dev, pnaddr); | 95 | err = phonet_address_del(dev, pnaddr); |
| 96 | if (!err) | 96 | if (!err) |
| 97 | rtmsg_notify(nlh->nlmsg_type, dev, pnaddr); | 97 | phonet_address_notify(nlh->nlmsg_type, dev, pnaddr); |
| 98 | return err; | 98 | return err; |
| 99 | } | 99 | } |
| 100 | 100 | ||
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 843629f55763..adaa81982f74 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
| @@ -66,6 +66,7 @@ cleanup_sunrpc(void) | |||
| 66 | #ifdef CONFIG_PROC_FS | 66 | #ifdef CONFIG_PROC_FS |
| 67 | rpc_proc_exit(); | 67 | rpc_proc_exit(); |
| 68 | #endif | 68 | #endif |
| 69 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ | ||
| 69 | } | 70 | } |
| 70 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
| 71 | module_init(init_sunrpc); | 72 | module_init(init_sunrpc); |
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index d31ccb487730..faf54c6bf96b 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c | |||
| @@ -292,8 +292,8 @@ static struct xfrm_algo_desc ealg_list[] = { | |||
| 292 | } | 292 | } |
| 293 | }, | 293 | }, |
| 294 | { | 294 | { |
| 295 | .name = "cbc(cast128)", | 295 | .name = "cbc(cast5)", |
| 296 | .compat = "cast128", | 296 | .compat = "cast5", |
| 297 | 297 | ||
| 298 | .uinfo = { | 298 | .uinfo = { |
| 299 | .encr = { | 299 | .encr = { |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 764554350ed8..2884baf1d5f9 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
| @@ -746,6 +746,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) | |||
| 746 | cpumask_clear(cpus); | 746 | cpumask_clear(cpus); |
| 747 | 747 | ||
| 748 | me = get_cpu(); | 748 | me = get_cpu(); |
| 749 | spin_lock(&kvm->requests_lock); | ||
| 749 | for (i = 0; i < KVM_MAX_VCPUS; ++i) { | 750 | for (i = 0; i < KVM_MAX_VCPUS; ++i) { |
| 750 | vcpu = kvm->vcpus[i]; | 751 | vcpu = kvm->vcpus[i]; |
| 751 | if (!vcpu) | 752 | if (!vcpu) |
| @@ -762,6 +763,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) | |||
| 762 | smp_call_function_many(cpus, ack_flush, NULL, 1); | 763 | smp_call_function_many(cpus, ack_flush, NULL, 1); |
| 763 | else | 764 | else |
| 764 | called = false; | 765 | called = false; |
| 766 | spin_unlock(&kvm->requests_lock); | ||
| 765 | put_cpu(); | 767 | put_cpu(); |
| 766 | free_cpumask_var(cpus); | 768 | free_cpumask_var(cpus); |
| 767 | return called; | 769 | return called; |
| @@ -982,6 +984,7 @@ static struct kvm *kvm_create_vm(void) | |||
| 982 | kvm->mm = current->mm; | 984 | kvm->mm = current->mm; |
| 983 | atomic_inc(&kvm->mm->mm_count); | 985 | atomic_inc(&kvm->mm->mm_count); |
| 984 | spin_lock_init(&kvm->mmu_lock); | 986 | spin_lock_init(&kvm->mmu_lock); |
| 987 | spin_lock_init(&kvm->requests_lock); | ||
| 985 | kvm_io_bus_init(&kvm->pio_bus); | 988 | kvm_io_bus_init(&kvm->pio_bus); |
| 986 | mutex_init(&kvm->lock); | 989 | mutex_init(&kvm->lock); |
| 987 | kvm_io_bus_init(&kvm->mmio_bus); | 990 | kvm_io_bus_init(&kvm->mmio_bus); |
| @@ -1194,6 +1197,8 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
| 1194 | if (!new.dirty_bitmap) | 1197 | if (!new.dirty_bitmap) |
| 1195 | goto out_free; | 1198 | goto out_free; |
| 1196 | memset(new.dirty_bitmap, 0, dirty_bytes); | 1199 | memset(new.dirty_bitmap, 0, dirty_bytes); |
| 1200 | if (old.npages) | ||
| 1201 | kvm_arch_flush_shadow(kvm); | ||
| 1197 | } | 1202 | } |
| 1198 | #endif /* not defined CONFIG_S390 */ | 1203 | #endif /* not defined CONFIG_S390 */ |
| 1199 | 1204 | ||
