Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108995499
D38542.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38542.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/asm/intel-family.h b/sys/compat/linuxkpi/common/include/asm/intel-family.h
new file mode 100644
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/asm/intel-family.h
@@ -0,0 +1,3 @@
+/* Public domain. */
+
+#define INTEL_FAM6_ROCKETLAKE 0xA7
diff --git a/sys/compat/linuxkpi/common/include/asm/processor.h b/sys/compat/linuxkpi/common/include/asm/processor.h
--- a/sys/compat/linuxkpi/common/include/asm/processor.h
+++ b/sys/compat/linuxkpi/common/include/asm/processor.h
@@ -35,11 +35,14 @@
#if defined(__i386__) || defined(__amd64__)
struct cpuinfo_x86 {
uint8_t x86;
+ uint8_t x86_model;
uint16_t x86_clflush_size;
uint16_t x86_max_cores;
};
extern struct cpuinfo_x86 boot_cpu_data;
+extern struct cpuinfo_x86 __cpu_data[];
+#define cpu_data(cpu) __cpu_data[cpu]
#endif
#define cpu_relax() cpu_spinwait()
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -2745,6 +2745,7 @@
#if defined(__i386__) || defined(__amd64__)
bool linux_cpu_has_clflush;
struct cpuinfo_x86 boot_cpu_data;
+struct cpuinfo_x86 __cpu_data[MAXCPU];
#endif
cpumask_t *
@@ -2767,7 +2768,15 @@
linux_cpu_has_clflush = (cpu_feature & CPUID_CLFSH);
boot_cpu_data.x86_clflush_size = cpu_clflush_line_size;
boot_cpu_data.x86_max_cores = mp_ncpus;
- boot_cpu_data.x86 = ((cpu_id & 0xf0000) >> 12) | ((cpu_id & 0xf0) >> 4);
+ boot_cpu_data.x86 = CPUID_TO_FAMILY(cpu_id);
+ boot_cpu_data.x86_model = CPUID_TO_MODEL(cpu_id);
+
+ for (i = 0; i < MAXCPU; i++) {
+ __cpu_data[i].x86_clflush_size = cpu_clflush_line_size;
+ __cpu_data[i].x86_max_cores = mp_ncpus;
+ __cpu_data[i].x86 = CPUID_TO_FAMILY(cpu_id);
+ __cpu_data[i].x86_model = CPUID_TO_MODEL(cpu_id);
+ }
#endif
rw_init(&linux_vma_lock, "lkpi-vma-lock");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 10:31 AM (14 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16360920
Default Alt Text
D38542.diff (1 KB)
Attached To
Mode
D38542: linuxkpi: Define `cpu_data(cpu)`
Attached
Detach File
Event Timeline
Log In to Comment