jianhai / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
e293be
Replace this with i686-7-4.patch .
e293be
e293be
diff -up ./arch/x86/include/asm/irq_remapping.h.7-4 ./arch/x86/include/asm/irq_remapping.h
e293be
--- ./arch/x86/include/asm/irq_remapping.h.7-4	2018-10-30 19:54:34.000000000 +0900
e293be
+++ ./arch/x86/include/asm/irq_remapping.h	2018-10-30 19:56:23.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
@@ -67,11 +72,6 @@ enum {
e293be
 	IRQ_REMAP_X2APIC_MODE,
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
 #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.7-4 ./arch/x86/include/asm/kvm_host.h
e293be
--- ./arch/x86/include/asm/kvm_host.h.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./arch/x86/include/asm/kvm_host.h	2018-10-30 19:54:34.000000000 +0900
e293be
@@ -56,7 +56,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.7-4 ./arch/x86/kvm/x86.c
e293be
--- ./arch/x86/kvm/x86.c.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./arch/x86/kvm/x86.c	2018-10-30 19:54:34.000000000 +0900
e293be
@@ -5993,6 +5993,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
@@ -6019,6 +6020,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
@@ -6084,9 +6086,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.7-4 ./crypto/tcrypt.c
e293be
--- ./crypto/tcrypt.c.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./crypto/tcrypt.c	2018-10-30 19:54:34.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.7-4 ./drivers/misc/ioc4.c
e293be
--- ./drivers/misc/ioc4.c.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./drivers/misc/ioc4.c	2018-10-30 19:54:34.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.7-4 ./fs/xfs/libxfs/xfs_format.h
e293be
--- ./fs/xfs/libxfs/xfs_format.h.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./fs/xfs/libxfs/xfs_format.h	2018-10-30 19:54:34.000000000 +0900
e293be
@@ -791,7 +791,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.7-4 ./fs/xfs/xfs_ondisk.h
e293be
--- ./fs/xfs/xfs_ondisk.h.7-4	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./fs/xfs/xfs_ondisk.h	2018-10-30 19:54:34.000000000 +0900
e293be
@@ -34,7 +34,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);