zhang / rpms / kernel

Forked from rpms/kernel 5 years ago
Clone
Blob Blame History Raw
Replace this with i686-7-4.patch .

diff -up ./arch/x86/include/asm/irq_remapping.h.7-4 ./arch/x86/include/asm/irq_remapping.h
--- ./arch/x86/include/asm/irq_remapping.h.7-4	2018-10-30 19:54:34.000000000 +0900
+++ ./arch/x86/include/asm/irq_remapping.h	2018-10-30 19:56:23.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);
@@ -67,11 +72,6 @@ enum {
 	IRQ_REMAP_X2APIC_MODE,
 };
 
-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.7-4 ./arch/x86/include/asm/kvm_host.h
--- ./arch/x86/include/asm/kvm_host.h.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./arch/x86/include/asm/kvm_host.h	2018-10-30 19:54:34.000000000 +0900
@@ -56,7 +56,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.7-4 ./arch/x86/kvm/x86.c
--- ./arch/x86/kvm/x86.c.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./arch/x86/kvm/x86.c	2018-10-30 19:54:34.000000000 +0900
@@ -5993,6 +5993,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)
 {
@@ -6019,6 +6020,7 @@ static int kvm_pv_clock_pairing(struct k
 
 	return ret;
 }
+#endif
 
 /*
  * kvm_pv_kick_cpu_op:  Kick a vcpu.
@@ -6084,9 +6086,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.7-4 ./crypto/tcrypt.c
--- ./crypto/tcrypt.c.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./crypto/tcrypt.c	2018-10-30 19:54:34.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.7-4 ./drivers/misc/ioc4.c
--- ./drivers/misc/ioc4.c.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./drivers/misc/ioc4.c	2018-10-30 19:54:34.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.7-4 ./fs/xfs/libxfs/xfs_format.h
--- ./fs/xfs/libxfs/xfs_format.h.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./fs/xfs/libxfs/xfs_format.h	2018-10-30 19:54:34.000000000 +0900
@@ -791,7 +791,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.7-4 ./fs/xfs/xfs_ondisk.h
--- ./fs/xfs/xfs_ondisk.h.7-4	2018-10-05 05:18:19.000000000 +0900
+++ ./fs/xfs/xfs_ondisk.h	2018-10-30 19:54:34.000000000 +0900
@@ -34,7 +34,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);