tleleu / rpms / kernel

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