Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 5.4.x+fslc to v5.4.87 #209

Merged
merged 64 commits into from
Jan 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c71c512
net/sched: sch_taprio: reset child qdiscs before freeing them
dcaratti Dec 16, 2020
d3076d0
md/raid10: initialize r10_bio->read_slot before use.
kevin-vigor Nov 6, 2020
faa72d9
thermal/drivers/cpufreq_cooling: Update cpufreq_state only if state h…
Nov 6, 2020
3ebfed3
ext4: prevent creating duplicate encrypted filenames
ebiggers Dec 28, 2020
6fe20a5
ubifs: prevent creating duplicate encrypted filenames
ebiggers Dec 28, 2020
eddc694
f2fs: prevent creating duplicate encrypted filenames
ebiggers Dec 28, 2020
34f0005
fscrypt: add fscrypt_is_nokey_name()
ebiggers Dec 28, 2020
29c2d3e
fscrypt: remove kernel-internal constants from UAPI header
ebiggers Dec 28, 2020
30aea96
vfio/pci: Move dummy_resources_list init in vfio_pci_probe()
eauger Nov 13, 2020
6b0a4f6
btrfs: fix race when defragmenting leads to unnecessary IO
fdmanana Nov 4, 2020
1145913
ext4: don't remount read-only with errors=continue on reboot
jankara Nov 27, 2020
d77c1ab
KVM: x86: avoid incorrect writes to host MSR_IA32_SPEC_CTRL
bonzini Jan 20, 2020
3d4a058
KVM: SVM: relax conditions for allowing MSR_IA32_SPEC_CTRL accesses
bonzini Feb 5, 2020
7cb6087
KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits
bonzini Dec 3, 2020
ee78e7d
powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()
chleroy Oct 22, 2020
3a83e28
jffs2: Allow setting rp_size to zero during remounting
Oct 14, 2020
9ce7ac5
jffs2: Fix NULL pointer dereference in rp_size fs option parsing
Oct 12, 2020
af07e4d
scsi: block: Fix a race in the runtime power management code
bvanassche Dec 9, 2020
376c311
uapi: move constants from <linux/kernel.h> to <linux/const.h>
pevik Dec 15, 2020
7c3d8d7
tools headers UAPI: Sync linux/const.h with the kernel headers
acmel Dec 17, 2020
8ec95e3
null_blk: Fix zone size initialization
damien-lemoal Nov 20, 2020
8ddf028
of: fix linker-section match-table corruption
jhovold Nov 23, 2020
57ba2c7
cgroup: Fix memory leak when parsing multiple source parameters
Dec 10, 2020
b726f86
scsi: cxgb4i: Fix TLS dependency
rddunlap Dec 8, 2020
18e1101
Bluetooth: hci_h5: close serdev device and free hu in h5_close
thazhemadam Sep 29, 2020
01be033
reiserfs: add check for an invalid ih_entry_count
rustylife Nov 1, 2020
750627d
misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_c…
thazhemadam Nov 22, 2020
28a29e3
media: gp8psk: initialize stats at power control logic
mchehab Nov 27, 2020
4250fe6
f2fs: fix shift-out-of-bounds in sanity_check_raw_super()
chaseyu Dec 9, 2020
8d2204a
ALSA: seq: Use bool for snd_seq_queue internal flags
tiwai Dec 6, 2020
3a2a5e1
ALSA: rawmidi: Access runtime->avail always in spinlock
tiwai Dec 6, 2020
5b2f1ad
bfs: don't use WARNING: string when it's just info.
rddunlap Dec 16, 2020
642c2d7
fcntl: Fix potential deadlock in send_sig{io, urg}()
fbq Nov 5, 2020
569da7c
rtc: sun6i: Fix memleak in sun6i_rtc_clk_init
dinghaoliu Oct 20, 2020
1842dde
module: set MODULE_STATE_GOING state when a module fails to load
mirab Oct 27, 2020
e292663
quota: Don't overflow quota file offsets
jankara Nov 2, 2020
a95049c
rtc: pl031: fix resource leak in pl031_probe
z00448126 Nov 12, 2020
22f8156
powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe()
Oct 28, 2020
d52faa7
i3c master: fix missing destroy_workqueue() on error in i3c_master_re…
Oct 28, 2020
dbe184f
NFSv4: Fix a pNFS layout related use-after-free race when freeing the…
Nov 25, 2020
86db718
f2fs: avoid race condition for shrinker count
Nov 6, 2020
9f4e802
module: delay kobject uevent until after module init call
Nov 27, 2020
d32747b
fs/namespace.c: WARN if mnt_count has become negative
ebiggers Nov 1, 2020
1dab82d
um: ubd: Submit all data segments atomically
krisman-at-collabora Nov 22, 2020
480abac
tick/sched: Remove bogus boot "safety" check
KAGA-KOKO Dec 6, 2020
8b3c009
ALSA: pcm: Clear the full allocated memory at hw_params
tiwai Dec 18, 2020
41ae3e5
dm verity: skip verity work if I/O error when system is shutting down
hyeongseok-kim901 Dec 3, 2020
b3f656a
Linux 5.4.87
gregkh Jan 6, 2021
24651c2
Merge tag 'v5.4.87' into 5.4.x+fslc
zandrey Jan 6, 2021
da5b4cf
Revert "drm/amd/display: Fix memory leaks in S3 resume"
agd5f Jan 5, 2021
4d3ba54
Revert "mtd: spinand: Fix OOB read"
nbd168 Jan 5, 2021
f2a0b76
dmaengine: at_hdmac: Substitute kzalloc with kmalloc
ambarus Jan 23, 2020
20d5ee5
dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate()
Aug 17, 2020
61a0d8e
dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
Aug 17, 2020
7a736f4
kdev_t: always inline major/minor helper functions
jpoimboe Dec 29, 2020
06c672d
iio:imu:bmi160: Fix alignment and data leak issues
jic23 Sep 20, 2020
732251c
fuse: fix bad inode
Dec 10, 2020
71b8355
perf: Break deadlock involving exec_update_mutex
Aug 28, 2020
1b75a26
rwsem: Implement down_read_killable_nested
ebiederm Dec 3, 2020
d390fc9
rwsem: Implement down_read_interruptible
ebiederm Dec 3, 2020
1174332
exec: Transform exec_update_mutex into a rw_semaphore
ebiederm Dec 3, 2020
0a49aaf
mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_s…
Dec 6, 2020
f3a4c8d
Linux 5.4.88
gregkh Jan 9, 2021
21b647a
Merge tag 'v5.4.88' into 5.4.x+fslc
zandrey Jan 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 86
SUBLEVEL = 88
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
23 changes: 21 additions & 2 deletions arch/powerpc/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,34 @@ static __inline__ void __clear_bit_unlock(int nr, volatile unsigned long *addr)
*/
static __inline__ int fls(unsigned int x)
{
return 32 - __builtin_clz(x);
int lz;

if (__builtin_constant_p(x))
return x ? 32 - __builtin_clz(x) : 0;
asm("cntlzw %0,%1" : "=r" (lz) : "r" (x));
return 32 - lz;
}

#include <asm-generic/bitops/builtin-__fls.h>

/*
* 64-bit can do this using one cntlzd (count leading zeroes doubleword)
* instruction; for 32-bit we use the generic version, which does two
* 32-bit fls calls.
*/
#ifdef CONFIG_PPC64
static __inline__ int fls64(__u64 x)
{
return 64 - __builtin_clzll(x);
int lz;

if (__builtin_constant_p(x))
return x ? 64 - __builtin_clzll(x) : 0;
asm("cntlzd %0,%1" : "=r" (lz) : "r" (x));
return 64 - lz;
}
#else
#include <asm-generic/bitops/fls64.h>
#endif

#ifdef CONFIG_PPC64
unsigned int __arch_hweight8(unsigned int w);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/mpic_msgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int mpic_msgr_probe(struct platform_device *dev)

/* IO map the message register block. */
of_address_to_resource(np, 0, &rsrc);
msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
msgr_block_addr = devm_ioremap(&dev->dev, rsrc.start, resource_size(&rsrc));
if (!msgr_block_addr) {
dev_err(&dev->dev, "Failed to iomap MPIC message registers");
return -EFAULT;
Expand Down
191 changes: 115 additions & 76 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,25 @@
/* Max request size is determined by sector mask - 32K */
#define UBD_MAX_REQUEST (8 * sizeof(long))

struct io_desc {
char *buffer;
unsigned long length;
unsigned long sector_mask;
unsigned long long cow_offset;
unsigned long bitmap_words[2];
};

struct io_thread_req {
struct request *req;
int fds[2];
unsigned long offsets[2];
unsigned long long offset;
unsigned long length;
char *buffer;
int sectorsize;
unsigned long sector_mask;
unsigned long long cow_offset;
unsigned long bitmap_words[2];
int error;

int desc_cnt;
/* io_desc has to be the last element of the struct */
struct io_desc io_desc[];
};


Expand Down Expand Up @@ -524,12 +531,7 @@ static void ubd_handler(void)
blk_queue_max_write_zeroes_sectors(io_req->req->q, 0);
blk_queue_flag_clear(QUEUE_FLAG_DISCARD, io_req->req->q);
}
if ((io_req->error) || (io_req->buffer == NULL))
blk_mq_end_request(io_req->req, io_req->error);
else {
if (!blk_update_request(io_req->req, io_req->error, io_req->length))
__blk_mq_end_request(io_req->req, io_req->error);
}
blk_mq_end_request(io_req->req, io_req->error);
kfree(io_req);
}
}
Expand Down Expand Up @@ -945,6 +947,7 @@ static int ubd_add(int n, char **error_out)
blk_queue_write_cache(ubd_dev->queue, true, false);

blk_queue_max_segments(ubd_dev->queue, MAX_SG);
blk_queue_segment_boundary(ubd_dev->queue, PAGE_SIZE - 1);
err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]);
if(err){
*error_out = "Failed to register device";
Expand Down Expand Up @@ -1288,64 +1291,116 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
*cow_offset += bitmap_offset;
}

static void cowify_req(struct io_thread_req *req, unsigned long *bitmap,
static void cowify_req(struct io_thread_req *req, struct io_desc *segment,
unsigned long offset, unsigned long *bitmap,
__u64 bitmap_offset, __u64 bitmap_len)
{
__u64 sector = req->offset >> SECTOR_SHIFT;
__u64 sector = offset >> SECTOR_SHIFT;
int i;

if (req->length > (sizeof(req->sector_mask) * 8) << SECTOR_SHIFT)
if (segment->length > (sizeof(segment->sector_mask) * 8) << SECTOR_SHIFT)
panic("Operation too long");

if (req_op(req->req) == REQ_OP_READ) {
for (i = 0; i < req->length >> SECTOR_SHIFT; i++) {
for (i = 0; i < segment->length >> SECTOR_SHIFT; i++) {
if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
ubd_set_bit(i, (unsigned char *)
&req->sector_mask);
&segment->sector_mask);
}
} else {
cowify_bitmap(offset, segment->length, &segment->sector_mask,
&segment->cow_offset, bitmap, bitmap_offset,
segment->bitmap_words, bitmap_len);
}
}

static void ubd_map_req(struct ubd *dev, struct io_thread_req *io_req,
struct request *req)
{
struct bio_vec bvec;
struct req_iterator iter;
int i = 0;
unsigned long byte_offset = io_req->offset;
int op = req_op(req);

if (op == REQ_OP_WRITE_ZEROES || op == REQ_OP_DISCARD) {
io_req->io_desc[0].buffer = NULL;
io_req->io_desc[0].length = blk_rq_bytes(req);
} else {
rq_for_each_segment(bvec, req, iter) {
BUG_ON(i >= io_req->desc_cnt);

io_req->io_desc[i].buffer =
page_address(bvec.bv_page) + bvec.bv_offset;
io_req->io_desc[i].length = bvec.bv_len;
i++;
}
}

if (dev->cow.file) {
for (i = 0; i < io_req->desc_cnt; i++) {
cowify_req(io_req, &io_req->io_desc[i], byte_offset,
dev->cow.bitmap, dev->cow.bitmap_offset,
dev->cow.bitmap_len);
byte_offset += io_req->io_desc[i].length;
}

}
else cowify_bitmap(req->offset, req->length, &req->sector_mask,
&req->cow_offset, bitmap, bitmap_offset,
req->bitmap_words, bitmap_len);
}

static int ubd_queue_one_vec(struct blk_mq_hw_ctx *hctx, struct request *req,
u64 off, struct bio_vec *bvec)
static struct io_thread_req *ubd_alloc_req(struct ubd *dev, struct request *req,
int desc_cnt)
{
struct ubd *dev = hctx->queue->queuedata;
struct io_thread_req *io_req;
int ret;
int i;

io_req = kmalloc(sizeof(struct io_thread_req), GFP_ATOMIC);
io_req = kmalloc(sizeof(*io_req) +
(desc_cnt * sizeof(struct io_desc)),
GFP_ATOMIC);
if (!io_req)
return -ENOMEM;
return NULL;

io_req->req = req;
if (dev->cow.file)
io_req->fds[0] = dev->cow.fd;
else
io_req->fds[0] = dev->fd;
io_req->error = 0;

if (bvec != NULL) {
io_req->buffer = page_address(bvec->bv_page) + bvec->bv_offset;
io_req->length = bvec->bv_len;
} else {
io_req->buffer = NULL;
io_req->length = blk_rq_bytes(req);
}

io_req->sectorsize = SECTOR_SIZE;
io_req->fds[1] = dev->fd;
io_req->cow_offset = -1;
io_req->offset = off;
io_req->sector_mask = 0;
io_req->offset = (u64) blk_rq_pos(req) << SECTOR_SHIFT;
io_req->offsets[0] = 0;
io_req->offsets[1] = dev->cow.data_offset;

if (dev->cow.file)
cowify_req(io_req, dev->cow.bitmap,
dev->cow.bitmap_offset, dev->cow.bitmap_len);
for (i = 0 ; i < desc_cnt; i++) {
io_req->io_desc[i].sector_mask = 0;
io_req->io_desc[i].cow_offset = -1;
}

return io_req;
}

static int ubd_submit_request(struct ubd *dev, struct request *req)
{
int segs = 0;
struct io_thread_req *io_req;
int ret;
int op = req_op(req);

if (op == REQ_OP_FLUSH)
segs = 0;
else if (op == REQ_OP_WRITE_ZEROES || op == REQ_OP_DISCARD)
segs = 1;
else
segs = blk_rq_nr_phys_segments(req);

io_req = ubd_alloc_req(dev, req, segs);
if (!io_req)
return -ENOMEM;

io_req->desc_cnt = segs;
if (segs)
ubd_map_req(dev, io_req, req);

ret = os_write_file(thread_fd, &io_req, sizeof(io_req));
if (ret != sizeof(io_req)) {
Expand All @@ -1356,22 +1411,6 @@ static int ubd_queue_one_vec(struct blk_mq_hw_ctx *hctx, struct request *req,
return ret;
}

static int queue_rw_req(struct blk_mq_hw_ctx *hctx, struct request *req)
{
struct req_iterator iter;
struct bio_vec bvec;
int ret;
u64 off = (u64)blk_rq_pos(req) << SECTOR_SHIFT;

rq_for_each_segment(bvec, req, iter) {
ret = ubd_queue_one_vec(hctx, req, off, &bvec);
if (ret < 0)
return ret;
off += bvec.bv_len;
}
return 0;
}

static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
Expand All @@ -1384,17 +1423,12 @@ static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
spin_lock_irq(&ubd_dev->lock);

switch (req_op(req)) {
/* operations with no lentgth/offset arguments */
case REQ_OP_FLUSH:
ret = ubd_queue_one_vec(hctx, req, 0, NULL);
break;
case REQ_OP_READ:
case REQ_OP_WRITE:
ret = queue_rw_req(hctx, req);
break;
case REQ_OP_DISCARD:
case REQ_OP_WRITE_ZEROES:
ret = ubd_queue_one_vec(hctx, req, (u64)blk_rq_pos(req) << 9, NULL);
ret = ubd_submit_request(ubd_dev, req);
break;
default:
WARN_ON_ONCE(1);
Expand Down Expand Up @@ -1482,22 +1516,22 @@ static int map_error(int error_code)
* will result in unpredictable behaviour and/or crashes.
*/

static int update_bitmap(struct io_thread_req *req)
static int update_bitmap(struct io_thread_req *req, struct io_desc *segment)
{
int n;

if(req->cow_offset == -1)
if (segment->cow_offset == -1)
return map_error(0);

n = os_pwrite_file(req->fds[1], &req->bitmap_words,
sizeof(req->bitmap_words), req->cow_offset);
if (n != sizeof(req->bitmap_words))
n = os_pwrite_file(req->fds[1], &segment->bitmap_words,
sizeof(segment->bitmap_words), segment->cow_offset);
if (n != sizeof(segment->bitmap_words))
return map_error(-n);

return map_error(0);
}

static void do_io(struct io_thread_req *req)
static void do_io(struct io_thread_req *req, struct io_desc *desc)
{
char *buf = NULL;
unsigned long len;
Expand All @@ -1512,21 +1546,20 @@ static void do_io(struct io_thread_req *req)
return;
}

nsectors = req->length / req->sectorsize;
nsectors = desc->length / req->sectorsize;
start = 0;
do {
bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask);
bit = ubd_test_bit(start, (unsigned char *) &desc->sector_mask);
end = start;
while((end < nsectors) &&
(ubd_test_bit(end, (unsigned char *)
&req->sector_mask) == bit))
(ubd_test_bit(end, (unsigned char *) &desc->sector_mask) == bit))
end++;

off = req->offset + req->offsets[bit] +
start * req->sectorsize;
len = (end - start) * req->sectorsize;
if (req->buffer != NULL)
buf = &req->buffer[start * req->sectorsize];
if (desc->buffer != NULL)
buf = &desc->buffer[start * req->sectorsize];

switch (req_op(req->req)) {
case REQ_OP_READ:
Expand Down Expand Up @@ -1566,7 +1599,8 @@ static void do_io(struct io_thread_req *req)
start = end;
} while(start < nsectors);

req->error = update_bitmap(req);
req->offset += len;
req->error = update_bitmap(req, desc);
}

/* Changed in start_io_thread, which is serialized by being called only
Expand Down Expand Up @@ -1599,8 +1633,13 @@ int io_thread(void *arg)
}

for (count = 0; count < n/sizeof(struct io_thread_req *); count++) {
struct io_thread_req *req = (*io_req_buffer)[count];
int i;

io_count++;
do_io((*io_req_buffer)[count]);
for (i = 0; !req->error && i < req->desc_cnt; i++)
do_io(req, &(req->io_desc[i]));

}

written = 0;
Expand Down
14 changes: 14 additions & 0 deletions arch/x86/kvm/cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ static inline int guest_cpuid_stepping(struct kvm_vcpu *vcpu)
return x86_stepping(best->eax);
}

static inline bool guest_has_spec_ctrl_msr(struct kvm_vcpu *vcpu)
{
return (guest_cpuid_has(vcpu, X86_FEATURE_SPEC_CTRL) ||
guest_cpuid_has(vcpu, X86_FEATURE_AMD_STIBP) ||
guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) ||
guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD));
}

static inline bool guest_has_pred_cmd_msr(struct kvm_vcpu *vcpu)
{
return (guest_cpuid_has(vcpu, X86_FEATURE_SPEC_CTRL) ||
guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBPB));
}

static inline bool supports_cpuid_fault(struct kvm_vcpu *vcpu)
{
return vcpu->arch.msr_platform_info & MSR_PLATFORM_INFO_CPUID_FAULT;
Expand Down
Loading