Skip to content

Commit 832dfd1

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.64' into linux-linaro-lsk-v4.4
This is the 4.4.64 stable release
2 parents c2a5f1f + 12f4e1f commit 832dfd1

27 files changed

Lines changed: 282 additions & 128 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 63
3+
SUBLEVEL = 64
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/arm/kvm/mmu.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
301301
next = kvm_pgd_addr_end(addr, end);
302302
if (!pgd_none(*pgd))
303303
unmap_puds(kvm, pgd, addr, next);
304+
/*
305+
* If we are dealing with a large range in
306+
* stage2 table, release the kvm->mmu_lock
307+
* to prevent starvation and lockup detector
308+
* warnings.
309+
*/
310+
if (kvm && (next != end))
311+
cond_resched_lock(&kvm->mmu_lock);
304312
} while (pgd++, addr = next, addr != end);
305313
}
306314

@@ -745,6 +753,7 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
745753
*/
746754
static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size)
747755
{
756+
assert_spin_locked(&kvm->mmu_lock);
748757
unmap_range(kvm, kvm->arch.pgd, start, size);
749758
}
750759

@@ -831,7 +840,10 @@ void kvm_free_stage2_pgd(struct kvm *kvm)
831840
if (kvm->arch.pgd == NULL)
832841
return;
833842

843+
spin_lock(&kvm->mmu_lock);
834844
unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
845+
spin_unlock(&kvm->mmu_lock);
846+
835847
kvm_free_hwpgd(kvm_get_hwpgd(kvm));
836848
if (KVM_PREALLOC_LEVEL > 0)
837849
kfree(kvm->arch.pgd);

arch/powerpc/kernel/entry_64.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ resume_kernel:
716716

717717
addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */
718718

719-
lwz r3,GPR1(r1)
719+
ld r3,GPR1(r1)
720720
subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */
721721
mr r4,r1 /* src: current exception frame */
722722
mr r1,r3 /* Reroute the trampoline frame to r1 */
@@ -730,8 +730,8 @@ resume_kernel:
730730
addi r6,r6,8
731731
bdnz 2b
732732

733-
/* Do real store operation to complete stwu */
734-
lwz r5,GPR1(r1)
733+
/* Do real store operation to complete stdu */
734+
ld r5,GPR1(r1)
735735
std r8,0(r5)
736736

737737
/* Clear _TIF_EMULATE_STACK_STORE flag */

arch/s390/include/asm/pgtable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
829829
{
830830
pgste_t pgste;
831831

832+
if (pte_present(entry))
833+
pte_val(entry) &= ~_PAGE_UNUSED;
832834
if (mm_has_pgste(mm)) {
833835
pgste = pgste_get_lock(ptep);
834836
pgste_val(pgste) &= ~_PGSTE_GPS_ZERO;

arch/x86/include/asm/pmem.h

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ static inline void arch_wmb_pmem(void)
7272
* @size: number of bytes to write back
7373
*
7474
* Write back a cache range using the CLWB (cache line write back)
75-
* instruction. This function requires explicit ordering with an
76-
* arch_wmb_pmem() call. This API is internal to the x86 PMEM implementation.
75+
* instruction. Note that @size is internally rounded up to be cache
76+
* line size aligned.
7777
*/
7878
static inline void __arch_wb_cache_pmem(void *vaddr, size_t size)
7979
{
@@ -87,15 +87,6 @@ static inline void __arch_wb_cache_pmem(void *vaddr, size_t size)
8787
clwb(p);
8888
}
8989

90-
/*
91-
* copy_from_iter_nocache() on x86 only uses non-temporal stores for iovec
92-
* iterators, so for other types (bvec & kvec) we must do a cache write-back.
93-
*/
94-
static inline bool __iter_needs_pmem_wb(struct iov_iter *i)
95-
{
96-
return iter_is_iovec(i) == false;
97-
}
98-
9990
/**
10091
* arch_copy_from_iter_pmem - copy data from an iterator to PMEM
10192
* @addr: PMEM destination address
@@ -114,8 +105,36 @@ static inline size_t arch_copy_from_iter_pmem(void __pmem *addr, size_t bytes,
114105
/* TODO: skip the write-back by always using non-temporal stores */
115106
len = copy_from_iter_nocache(vaddr, bytes, i);
116107

117-
if (__iter_needs_pmem_wb(i))
118-
__arch_wb_cache_pmem(vaddr, bytes);
108+
/*
109+
* In the iovec case on x86_64 copy_from_iter_nocache() uses
110+
* non-temporal stores for the bulk of the transfer, but we need
111+
* to manually flush if the transfer is unaligned. A cached
112+
* memory copy is used when destination or size is not naturally
113+
* aligned. That is:
114+
* - Require 8-byte alignment when size is 8 bytes or larger.
115+
* - Require 4-byte alignment when size is 4 bytes.
116+
*
117+
* In the non-iovec case the entire destination needs to be
118+
* flushed.
119+
*/
120+
if (iter_is_iovec(i)) {
121+
unsigned long flushed, dest = (unsigned long) addr;
122+
123+
if (bytes < 8) {
124+
if (!IS_ALIGNED(dest, 4) || (bytes != 4))
125+
__arch_wb_cache_pmem(addr, 1);
126+
} else {
127+
if (!IS_ALIGNED(dest, 8)) {
128+
dest = ALIGN(dest, boot_cpu_data.x86_clflush_size);
129+
__arch_wb_cache_pmem(addr, 1);
130+
}
131+
132+
flushed = dest - (unsigned long) addr;
133+
if (bytes > flushed && !IS_ALIGNED(bytes - flushed, 8))
134+
__arch_wb_cache_pmem(addr + bytes - 1, 1);
135+
}
136+
} else
137+
__arch_wb_cache_pmem(addr, bytes);
119138

120139
return len;
121140
}

arch/x86/kernel/cpu/mcheck/mce_amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static const char * const th_names[] = {
5353
"load_store",
5454
"insn_fetch",
5555
"combined_unit",
56-
"",
56+
"decode_unit",
5757
"northbridge",
5858
"execution_unit",
5959
};

block/genhd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ void del_gendisk(struct gendisk *disk)
664664

665665
kobject_put(disk->part0.holder_dir);
666666
kobject_put(disk->slave_dir);
667-
disk->driverfs_dev = NULL;
668667
if (!sysfs_deprecated)
669668
sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
670669
pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);

drivers/acpi/power.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ static int acpi_power_get_list_state(struct list_head *list, int *state)
200200
return -EINVAL;
201201

202202
/* The state of the list is 'on' IFF all resources are 'on'. */
203+
cur_state = 0;
203204
list_for_each_entry(entry, list, node) {
204205
struct acpi_power_resource *resource = entry->resource;
205206
acpi_handle handle = resource->device.handle;

drivers/hv/channel.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
7373
void *in, *out;
7474
unsigned long flags;
7575
int ret, err = 0;
76-
unsigned long t;
7776
struct page *page;
7877

7978
spin_lock_irqsave(&newchannel->lock, flags);
@@ -183,11 +182,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
183182
goto error1;
184183
}
185184

186-
t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ);
187-
if (t == 0) {
188-
err = -ETIMEDOUT;
189-
goto error1;
190-
}
185+
wait_for_completion(&open_info->waitevent);
191186

192187
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
193188
list_del(&open_info->msglistentry);
@@ -375,7 +370,7 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
375370
struct vmbus_channel_gpadl_header *gpadlmsg;
376371
struct vmbus_channel_gpadl_body *gpadl_body;
377372
struct vmbus_channel_msginfo *msginfo = NULL;
378-
struct vmbus_channel_msginfo *submsginfo;
373+
struct vmbus_channel_msginfo *submsginfo, *tmp;
379374
u32 msgcount;
380375
struct list_head *curr;
381376
u32 next_gpadl_handle;
@@ -437,6 +432,13 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
437432
list_del(&msginfo->msglistentry);
438433
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
439434

435+
if (msgcount > 1) {
436+
list_for_each_entry_safe(submsginfo, tmp, &msginfo->submsglist,
437+
msglistentry) {
438+
kfree(submsginfo);
439+
}
440+
}
441+
440442
kfree(msginfo);
441443
return ret;
442444
}

drivers/hv/connection.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ int vmbus_post_msg(void *buffer, size_t buflen)
429429
union hv_connection_id conn_id;
430430
int ret = 0;
431431
int retries = 0;
432-
u32 msec = 1;
432+
u32 usec = 1;
433433

434434
conn_id.asu32 = 0;
435435
conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
@@ -462,9 +462,9 @@ int vmbus_post_msg(void *buffer, size_t buflen)
462462
}
463463

464464
retries++;
465-
msleep(msec);
466-
if (msec < 2048)
467-
msec *= 2;
465+
udelay(usec);
466+
if (usec < 2048)
467+
usec *= 2;
468468
}
469469
return ret;
470470
}

0 commit comments

Comments
 (0)