Skip to content

Commit ce6cd7b

Browse files
author
Alex Shi
committed
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
2 parents e8c57f8 + 218dea0 commit ce6cd7b

37 files changed

Lines changed: 215 additions & 47 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 = 92
3+
SUBLEVEL = 93
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/mips/math-emu/cp1emu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
23602360
break;
23612361
default:
23622362
/* Reserved R6 ops */
2363-
pr_err("Reserved MIPS R6 CMP.condn.S operation\n");
23642363
return SIGILL;
23652364
}
23662365
}
@@ -2434,7 +2433,6 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
24342433
break;
24352434
default:
24362435
/* Reserved R6 ops */
2437-
pr_err("Reserved MIPS R6 CMP.condn.D operation\n");
24382436
return SIGILL;
24392437
}
24402438
}

arch/x86/include/asm/alternative-asm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@
6262
#define new_len2 145f-144f
6363

6464
/*
65-
* max without conditionals. Idea adapted from:
65+
* gas compatible max based on the idea from:
6666
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
67+
*
68+
* The additional "-" is needed because gas uses a "true" value of -1.
6769
*/
6870
#define alt_max_short(a, b) ((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
6971

arch/x86/include/asm/alternative.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ static inline int alternatives_text_reserved(void *start, void *end)
102102
alt_end_marker ":\n"
103103

104104
/*
105-
* max without conditionals. Idea adapted from:
105+
* gas compatible max based on the idea from:
106106
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
107107
*
108-
* The additional "-" is needed because gas works with s32s.
108+
* The additional "-" is needed because gas uses a "true" value of -1.
109109
*/
110-
#define alt_max_short(a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") - (" b ")))))"
110+
#define alt_max_short(a, b) "((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") < (" b ")))))"
111111

112112
/*
113113
* Pad the second replacement alternative with additional NOPs if it is

arch/x86/kvm/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10369,7 +10369,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
1036910369
* (KVM doesn't change it)- no reason to call set_cr4_guest_host_mask();
1037010370
*/
1037110371
vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
10372-
kvm_set_cr4(vcpu, vmcs12->host_cr4);
10372+
vmx_set_cr4(vcpu, vmcs12->host_cr4);
1037310373

1037410374
nested_ept_uninit_mmu_context(vcpu);
1037510375

block/bio.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
13201320
offset = uaddr & ~PAGE_MASK;
13211321
for (j = cur_page; j < page_limit; j++) {
13221322
unsigned int bytes = PAGE_SIZE - offset;
1323+
unsigned short prev_bi_vcnt = bio->bi_vcnt;
13231324

13241325
if (len <= 0)
13251326
break;
@@ -1334,6 +1335,13 @@ struct bio *bio_map_user_iov(struct request_queue *q,
13341335
bytes)
13351336
break;
13361337

1338+
/*
1339+
* check if vector was merged with previous
1340+
* drop page reference if needed
1341+
*/
1342+
if (bio->bi_vcnt == prev_bi_vcnt)
1343+
put_page(pages[j]);
1344+
13371345
len -= bytes;
13381346
offset = 0;
13391347
}

crypto/shash.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,14 @@ static int shash_async_finup(struct ahash_request *req)
274274

275275
int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
276276
{
277-
struct scatterlist *sg = req->src;
278-
unsigned int offset = sg->offset;
279277
unsigned int nbytes = req->nbytes;
278+
struct scatterlist *sg;
279+
unsigned int offset;
280280
int err;
281281

282-
if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) {
282+
if (nbytes &&
283+
(sg = req->src, offset = sg->offset,
284+
nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset))) {
283285
void *data;
284286

285287
data = kmap_atomic(sg_page(sg));

drivers/dma/edma.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,11 +1126,24 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(
11261126
struct edma_desc *edesc;
11271127
struct device *dev = chan->device->dev;
11281128
struct edma_chan *echan = to_edma_chan(chan);
1129-
unsigned int width, pset_len;
1129+
unsigned int width, pset_len, array_size;
11301130

11311131
if (unlikely(!echan || !len))
11321132
return NULL;
11331133

1134+
/* Align the array size (acnt block) with the transfer properties */
1135+
switch (__ffs((src | dest | len))) {
1136+
case 0:
1137+
array_size = SZ_32K - 1;
1138+
break;
1139+
case 1:
1140+
array_size = SZ_32K - 2;
1141+
break;
1142+
default:
1143+
array_size = SZ_32K - 4;
1144+
break;
1145+
}
1146+
11341147
if (len < SZ_64K) {
11351148
/*
11361149
* Transfer size less than 64K can be handled with one paRAM
@@ -1152,7 +1165,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(
11521165
* When the full_length is multibple of 32767 one slot can be
11531166
* used to complete the transfer.
11541167
*/
1155-
width = SZ_32K - 1;
1168+
width = array_size;
11561169
pset_len = rounddown(len, width);
11571170
/* One slot is enough for lengths multiple of (SZ_32K -1) */
11581171
if (unlikely(pset_len == len))
@@ -1202,7 +1215,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy(
12021215
}
12031216
dest += pset_len;
12041217
src += pset_len;
1205-
pset_len = width = len % (SZ_32K - 1);
1218+
pset_len = width = len % array_size;
12061219

12071220
ret = edma_config_pset(chan, &edesc->pset[1], src, dest, 1,
12081221
width, pset_len, DMA_MEM_TO_MEM);

drivers/hid/usbhid/hid-core.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,8 @@ static int usbhid_parse(struct hid_device *hid)
971971
unsigned int rsize = 0;
972972
char *rdesc;
973973
int ret, n;
974+
int num_descriptors;
975+
size_t offset = offsetof(struct hid_descriptor, desc);
974976

975977
quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
976978
le16_to_cpu(dev->descriptor.idProduct));
@@ -993,10 +995,18 @@ static int usbhid_parse(struct hid_device *hid)
993995
return -ENODEV;
994996
}
995997

998+
if (hdesc->bLength < sizeof(struct hid_descriptor)) {
999+
dbg_hid("hid descriptor is too short\n");
1000+
return -EINVAL;
1001+
}
1002+
9961003
hid->version = le16_to_cpu(hdesc->bcdHID);
9971004
hid->country = hdesc->bCountryCode;
9981005

999-
for (n = 0; n < hdesc->bNumDescriptors; n++)
1006+
num_descriptors = min_t(int, hdesc->bNumDescriptors,
1007+
(hdesc->bLength - offset) / sizeof(struct hid_class_descriptor));
1008+
1009+
for (n = 0; n < num_descriptors; n++)
10001010
if (hdesc->desc[n].bDescriptorType == HID_DT_REPORT)
10011011
rsize = le16_to_cpu(hdesc->desc[n].wDescriptorLength);
10021012

drivers/iommu/amd_iommu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,
30963096
mutex_unlock(&domain->api_lock);
30973097

30983098
domain_flush_tlb_pde(domain);
3099+
domain_flush_complete(domain);
30993100

31003101
return unmap_size;
31013102
}

0 commit comments

Comments
 (0)