Blob Blame Raw
diff -up ./arch/x86/include/asm/irq_remapping.h.dist ./arch/x86/include/asm/irq_remapping.h
--- ./arch/x86/include/asm/irq_remapping.h.dist	2017-09-20 20:37:14.000000000 +0900
+++ ./arch/x86/include/asm/irq_remapping.h	2017-09-20 21:41:47.000000000 +0900
@@ -35,6 +35,11 @@ enum irq_remap_cap {
 	IRQ_POSTING_CAP = 0,
 };
 
+struct vcpu_data {
+	u64 pi_desc_addr;	/* Physical address of PI Descriptor */
+	u32 vector;		/* Guest vector of the interrupt */
+};
+
 #ifdef CONFIG_IRQ_REMAP
 
 extern bool irq_remapping_cap(enum irq_remap_cap cap);
@@ -62,11 +67,6 @@ extern bool setup_remapped_irq(int irq,
 void irq_remap_modify_chip_defaults(struct irq_chip *chip);
 int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info);
 
-struct vcpu_data {
-	u64 pi_desc_addr;	/* Physical address of PI Descriptor */
-	u32 vector;		/* Guest vector of the interrupt */
-};
-
 #else  /* CONFIG_IRQ_REMAP */
 
 static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; }
diff -up ./arch/x86/include/asm/kvm_host.h.dist ./arch/x86/include/asm/kvm_host.h
--- ./arch/x86/include/asm/kvm_host.h.dist	2017-09-09 16:06:42.000000000 +0900
+++ ./arch/x86/include/asm/kvm_host.h	2017-09-20 22:16:42.000000000 +0900
@@ -55,7 +55,7 @@
 			  | X86_CR0_NW | X86_CR0_CD | X86_CR0_PG))
 
 #define CR3_L_MODE_RESERVED_BITS 0xFFFFFF0000000000ULL
-#define CR3_PCID_INVD		 (1UL << 63)
+#define CR3_PCID_INVD		 BIT_64(63)
 #define CR4_RESERVED_BITS                                               \
 	(~(unsigned long)(X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | X86_CR4_DE\
 			  | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE     \
diff -up ./arch/x86/kvm/x86.c.dist ./arch/x86/kvm/x86.c
--- ./arch/x86/kvm/x86.c.dist	2017-09-09 16:06:42.000000000 +0900
+++ ./arch/x86/kvm/x86.c	2017-09-20 22:09:28.000000000 +0900
@@ -5968,6 +5968,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vc
 }
 EXPORT_SYMBOL_GPL(kvm_emulate_halt);
 
+#ifdef CONFIG_X86_64
 static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
 			        unsigned long clock_type)
 {
@@ -5994,6 +5995,7 @@ static int kvm_pv_clock_pairing(struct k
 
 	return ret;
 }
+#endif
 
 /*
  * kvm_pv_kick_cpu_op:  Kick a vcpu.
@@ -6059,9 +6061,11 @@ int kvm_emulate_hypercall(struct kvm_vcp
 		kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1);
 		ret = 0;
 		break;
+#ifdef CONFIG_X86_64
 	case KVM_HC_CLOCK_PAIRING:
 		ret = kvm_pv_clock_pairing(vcpu, a0, a1);
 		break;
+#endif
 	default:
 		ret = -KVM_ENOSYS;
 		break;
diff -up ./crypto/tcrypt.c.dist ./crypto/tcrypt.c
--- ./crypto/tcrypt.c.dist	2017-09-09 16:06:42.000000000 +0900
+++ ./crypto/tcrypt.c	2017-09-21 20:48:11.000000000 +0900
@@ -865,7 +865,7 @@ static void test_mb_ahash_speed(const ch
 
 		printk("\nBlock: %lld cycles (%lld cycles/byte), %d bytes\n",
 			(s64) (end[7]-start[0])/1,
-			(s64) (end[7]-start[0])/(8*speed[i].blen),
+			div_s64((s64) (end[7]-start[0]), (8*speed[i].blen)),
 			8*speed[i].blen);
 	}
 	ret = 0;
diff -up ./drivers/misc/ioc4.c.dist ./drivers/misc/ioc4.c
--- ./drivers/misc/ioc4.c.dist	2017-09-09 16:06:42.000000000 +0900
+++ ./drivers/misc/ioc4.c	2017-09-20 23:52:17.000000000 +0900
@@ -168,19 +168,20 @@ ioc4_clock_calibrate(struct ioc4_driver_
 	mmiowb();
 
 	/* Check square wave period averaged over some number of cycles */
-	do {
-		int_out.raw = readl(&idd->idd_misc_regs->int_out.raw);
-		state = int_out.fields.int_out;
-		if (!last_state && state) {
-			count++;
-			if (count == IOC4_CALIBRATE_END) {
-				ktime_get_ts(&end_ts);
-				break;
-			} else if (count == IOC4_CALIBRATE_DISCARD)
-				ktime_get_ts(&start_ts);
-		}
-		last_state = state;
-	} while (1);
+	ktime_get_ts(&start_ts);
+	state = 1; /* make sure the first read isn't a rising edge */
+	for (count = 0; count <= IOC4_CALIBRATE_END; count++) {
+		do { /* wait for a rising edge */
+			last_state = state;
+			int_out.raw = readl(&idd->idd_misc_regs->int_out.raw);
+			state = int_out.fields.int_out;
+		} while (last_state || !state);
+
+		/* discard the first few cycles */
+		if (count == IOC4_CALIBRATE_DISCARD)
+			ktime_get_ts(&start_ts);
+	}
+	ktime_get_ts(&end_ts);
 
 	/* Calculation rearranged to preserve intermediate precision.
 	 * Logically:
diff -up ./fs/xfs/libxfs/xfs_format.h.dist ./fs/xfs/libxfs/xfs_format.h
--- ./fs/xfs/libxfs/xfs_format.h.dist	2017-09-09 16:06:42.000000000 +0900
+++ ./fs/xfs/libxfs/xfs_format.h	2017-09-20 22:23:47.000000000 +0900
@@ -786,7 +786,7 @@ typedef struct xfs_agfl {
 	__be64		agfl_lsn;
 	__be32		agfl_crc;
 	__be32		agfl_bno[];	/* actually XFS_AGFL_SIZE(mp) */
-} xfs_agfl_t;
+} __attribute__((packed)) xfs_agfl_t;
 
 #define XFS_AGFL_CRC_OFF	offsetof(struct xfs_agfl, agfl_crc)
 
diff -up ./fs/xfs/xfs_ondisk.h.dist ./fs/xfs/xfs_ondisk.h
--- ./fs/xfs/xfs_ondisk.h.dist	2017-09-20 22:39:15.000000000 +0900
+++ ./fs/xfs/xfs_ondisk.h	2017-09-20 22:37:41.000000000 +0900
@@ -29,7 +29,7 @@ xfs_check_ondisk_structs(void)
 	XFS_CHECK_STRUCT_SIZE(struct xfs_acl,			4);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_acl_entry,		12);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_agf,			224);
-	XFS_CHECK_STRUCT_SIZE(struct xfs_agfl,			40);
+	XFS_CHECK_STRUCT_SIZE(struct xfs_agfl,			36);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_agi,			336);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_key,		8);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_bmbt_rec,		16);