Re: Linux 4.9.80

2018-02-04 Thread Greg KH
diff --git a/Makefile b/Makefile
index 4a7e6dff1c2e..9550b6939076 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 79
+SUBLEVEL = 80
 EXTRAVERSION =
 NAME = Roaring Lionus
 
diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
index 7c9e0fae9bb9..65e0db1d3bd7 100644
--- a/arch/arm/boot/dts/bcm-nsp.dtsi
+++ b/arch/arm/boot/dts/bcm-nsp.dtsi
@@ -85,7 +85,7 @@
timer@20200 {
compatible = "arm,cortex-a9-global-timer";
reg = <0x20200 0x100>;
-   interrupts = ;
+   interrupts = ;
clocks = <_clk>;
};
 
@@ -93,7 +93,7 @@
compatible = "arm,cortex-a9-twd-timer";
reg = <0x20600 0x20>;
interrupts = ;
+ IRQ_TYPE_EDGE_RISING)>;
clocks = <_clk>;
};
 
diff --git a/arch/x86/crypto/aesni-intel_glue.c 
b/arch/x86/crypto/aesni-intel_glue.c
index aa8b0672f87a..d9ae404f08c9 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -906,7 +906,7 @@ static int helper_rfc4106_encrypt(struct aead_request *req)
 
if (sg_is_last(req->src) &&
req->src->offset + req->src->length <= PAGE_SIZE &&
-   sg_is_last(req->dst) &&
++  sg_is_last(req->dst) && req->dst->length &&
req->dst->offset + req->dst->length <= PAGE_SIZE) {
one_entry_in_sg = 1;
scatterwalk_start(_sg_walk, req->src);
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index cbd1d44da2d3..20cfeeb681c6 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1113,7 +1113,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, 
unsigned long cr2,
 static inline int emulate_instruction(struct kvm_vcpu *vcpu,
int emulation_type)
 {
-   return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
+   return x86_emulate_instruction(vcpu, 0,
+   emulation_type | EMULTYPE_NO_REEXECUTE, NULL, 0);
 }
 
 void kvm_enable_efer_bits(u64);
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index c8f8dd8ca0a1..6f5a3b076341 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4990,6 +4990,8 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void 
*insn, int insn_len)
bool op_prefix = false;
bool has_seg_override = false;
struct opcode opcode;
+   u16 dummy;
+   struct desc_struct desc;
 
ctxt->memop.type = OP_NONE;
ctxt->memopp = NULL;
@@ -5008,6 +5010,11 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void 
*insn, int insn_len)
switch (mode) {
case X86EMUL_MODE_REAL:
case X86EMUL_MODE_VM86:
+   def_op_bytes = def_ad_bytes = 2;
+   ctxt->ops->get_segment(ctxt, , , NULL, VCPU_SREG_CS);
+   if (desc.d)
+   def_op_bytes = def_ad_bytes = 4;
+   break;
case X86EMUL_MODE_PROT16:
def_op_bytes = def_ad_bytes = 2;
break;
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 6e219e5c07d2..5f810bb80802 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -257,8 +257,7 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, ulong 
*ioapic_handled_vectors)
index == RTC_GSI) {
if (kvm_apic_match_dest(vcpu, NULL, 0,
 e->fields.dest_id, e->fields.dest_mode) ||
-   (e->fields.trig_mode == IOAPIC_EDGE_TRIG &&
-kvm_apic_pending_eoi(vcpu, e->fields.vector)))
+   kvm_apic_pending_eoi(vcpu, e->fields.vector))
__set_bit(e->fields.vector,
  ioapic_handled_vectors);
}
@@ -279,6 +278,7 @@ static void ioapic_write_indirect(struct kvm_ioapic 
*ioapic, u32 val)
 {
unsigned index;
bool mask_before, mask_after;
+   int old_remote_irr, old_delivery_status;
union kvm_ioapic_redirect_entry *e;
 
switch (ioapic->ioregsel) {
@@ -301,14 +301,28 @@ static void ioapic_write_indirect(struct kvm_ioapic 
*ioapic, u32 val)
return;
e = >redirtbl[index];
mask_before = e->fields.mask;
+   /* Preserve read-only fields */
+   old_remote_irr = e->fields.remote_irr;
+   old_delivery_status = e->fields.delivery_status;
if (ioapic->ioregsel & 1) {
e->bits &= 0x;
e->bits |= (u64) val << 32;
} else {
e->bits &= ~0xULL;

Re: Linux 4.9.80

2018-02-04 Thread Greg KH
diff --git a/Makefile b/Makefile
index 4a7e6dff1c2e..9550b6939076 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 79
+SUBLEVEL = 80
 EXTRAVERSION =
 NAME = Roaring Lionus
 
diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
index 7c9e0fae9bb9..65e0db1d3bd7 100644
--- a/arch/arm/boot/dts/bcm-nsp.dtsi
+++ b/arch/arm/boot/dts/bcm-nsp.dtsi
@@ -85,7 +85,7 @@
timer@20200 {
compatible = "arm,cortex-a9-global-timer";
reg = <0x20200 0x100>;
-   interrupts = ;
+   interrupts = ;
clocks = <_clk>;
};
 
@@ -93,7 +93,7 @@
compatible = "arm,cortex-a9-twd-timer";
reg = <0x20600 0x20>;
interrupts = ;
+ IRQ_TYPE_EDGE_RISING)>;
clocks = <_clk>;
};
 
diff --git a/arch/x86/crypto/aesni-intel_glue.c 
b/arch/x86/crypto/aesni-intel_glue.c
index aa8b0672f87a..d9ae404f08c9 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -906,7 +906,7 @@ static int helper_rfc4106_encrypt(struct aead_request *req)
 
if (sg_is_last(req->src) &&
req->src->offset + req->src->length <= PAGE_SIZE &&
-   sg_is_last(req->dst) &&
++  sg_is_last(req->dst) && req->dst->length &&
req->dst->offset + req->dst->length <= PAGE_SIZE) {
one_entry_in_sg = 1;
scatterwalk_start(_sg_walk, req->src);
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index cbd1d44da2d3..20cfeeb681c6 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1113,7 +1113,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, 
unsigned long cr2,
 static inline int emulate_instruction(struct kvm_vcpu *vcpu,
int emulation_type)
 {
-   return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
+   return x86_emulate_instruction(vcpu, 0,
+   emulation_type | EMULTYPE_NO_REEXECUTE, NULL, 0);
 }
 
 void kvm_enable_efer_bits(u64);
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index c8f8dd8ca0a1..6f5a3b076341 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4990,6 +4990,8 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void 
*insn, int insn_len)
bool op_prefix = false;
bool has_seg_override = false;
struct opcode opcode;
+   u16 dummy;
+   struct desc_struct desc;
 
ctxt->memop.type = OP_NONE;
ctxt->memopp = NULL;
@@ -5008,6 +5010,11 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void 
*insn, int insn_len)
switch (mode) {
case X86EMUL_MODE_REAL:
case X86EMUL_MODE_VM86:
+   def_op_bytes = def_ad_bytes = 2;
+   ctxt->ops->get_segment(ctxt, , , NULL, VCPU_SREG_CS);
+   if (desc.d)
+   def_op_bytes = def_ad_bytes = 4;
+   break;
case X86EMUL_MODE_PROT16:
def_op_bytes = def_ad_bytes = 2;
break;
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 6e219e5c07d2..5f810bb80802 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -257,8 +257,7 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, ulong 
*ioapic_handled_vectors)
index == RTC_GSI) {
if (kvm_apic_match_dest(vcpu, NULL, 0,
 e->fields.dest_id, e->fields.dest_mode) ||
-   (e->fields.trig_mode == IOAPIC_EDGE_TRIG &&
-kvm_apic_pending_eoi(vcpu, e->fields.vector)))
+   kvm_apic_pending_eoi(vcpu, e->fields.vector))
__set_bit(e->fields.vector,
  ioapic_handled_vectors);
}
@@ -279,6 +278,7 @@ static void ioapic_write_indirect(struct kvm_ioapic 
*ioapic, u32 val)
 {
unsigned index;
bool mask_before, mask_after;
+   int old_remote_irr, old_delivery_status;
union kvm_ioapic_redirect_entry *e;
 
switch (ioapic->ioregsel) {
@@ -301,14 +301,28 @@ static void ioapic_write_indirect(struct kvm_ioapic 
*ioapic, u32 val)
return;
e = >redirtbl[index];
mask_before = e->fields.mask;
+   /* Preserve read-only fields */
+   old_remote_irr = e->fields.remote_irr;
+   old_delivery_status = e->fields.delivery_status;
if (ioapic->ioregsel & 1) {
e->bits &= 0x;
e->bits |= (u64) val << 32;
} else {
e->bits &= ~0xULL;