<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/segment.h, branch linux-6.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-16T16:32:22Z</updated>
<entry>
<title>x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel</title>
<updated>2023-08-16T16:32:22Z</updated>
<author>
<name>Xin Li</name>
</author>
<published>2023-03-22T06:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84bf9e4a4637e24c9a772588505e6bf7c6636dca'/>
<id>urn:sha1:84bf9e4a4637e24c9a772588505e6bf7c6636dca</id>
<content type='text'>
commit 39163d5479285a36522b6e8f9cc568cc4987db08 upstream.

The vDSO getcpu() reads CPU ID from the GDT_ENTRY_CPUNODE entry when the RDPID
instruction is not available. And GDT_ENTRY_CPUNODE is defined as 28 on 32-bit
Linux kernel and 15 on 64-bit. But the 32-bit getcpu() on 64-bit Linux kernel
is compiled with 32-bit Linux kernel GDT_ENTRY_CPUNODE, i.e., 28, beyond the
64-bit Linux kernel GDT limit. Thus, it just fails _silently_.

When BUILD_VDSO32_64 is defined, choose the 64-bit Linux kernel GDT definitions
to compile the 32-bit getcpu().

Fixes: 877cff5296faa6e ("x86/vdso: Fake 32bit VDSO build on 64bit compile for vgetcpu")
Reported-by: kernel test robot &lt;yujie.liu@intel.com&gt;
Reported-by: Shan Kang &lt;shan.kang@intel.com&gt;
Signed-off-by: Xin Li &lt;xin3.li@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20230322061758.10639-1-xin3.li@intel.com
Link: https://lore.kernel.org/oe-lkp/202303020903.b01fd1de-yujie.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>x86/cpu: Provide the full setup for getcpu() on x86-32</title>
<updated>2023-02-06T14:48:54Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
</author>
<published>2022-11-25T09:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=717cce3bdcf34705417f641bf2fcdf9b038ec36c'/>
<id>urn:sha1:717cce3bdcf34705417f641bf2fcdf9b038ec36c</id>
<content type='text'>
setup_getcpu() configures two things:

  - it writes the current CPU &amp; node information into MSR_TSC_AUX
  - it writes the same information as a GDT entry.

By using the "full" setup_getcpu() on i386 it is possible to read the CPU
information in userland via RDTSCP() or via LSL from the GDT.

Provide an GDT_ENTRY_CPUNODE for x86-32 and make the setup function
unconditionally available.

Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Roland Mainz &lt;roland.mainz@nrubsig.org&gt;
Link: https://lore.kernel.org/r/20221125094216.3663444-2-bigeasy@linutronix.de

</content>
</entry>
<entry>
<title>x86/signal/32: Merge native and compat 32-bit signal code</title>
<updated>2022-10-19T07:58:49Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2022-06-06T20:38:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24e6dc35ccd825de7c71751610ff8f3295347e5b'/>
<id>urn:sha1:24e6dc35ccd825de7c71751610ff8f3295347e5b</id>
<content type='text'>
There are significant differences between signal handling on 32-bit vs.
64-bit, like different structure layouts and legacy syscalls.  Instead
of duplicating that code for native and compat, merge both versions
into one file.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Link: https://lore.kernel.org/r/20220606203802.158958-8-brgerst@gmail.com
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>x86: Remove __USER32_DS</title>
<updated>2022-10-19T07:58:49Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2022-06-06T20:37:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=695c39bc5b8686a6b27254e60fb830f4989f322d'/>
<id>urn:sha1:695c39bc5b8686a6b27254e60fb830f4989f322d</id>
<content type='text'>
Replace all users with the equivalent __USER_DS, which will make merging
native and compat code simpler.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Link: https://lore.kernel.org/r/20220606203802.158958-5-brgerst@gmail.com
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
</content>
</entry>
<entry>
<title>x86/asm: Merge load_gs_index()</title>
<updated>2022-04-14T12:15:54Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2022-03-25T15:39:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=203d8919a9eda5d1bc68ac3cd7637588334c9dc1'/>
<id>urn:sha1:203d8919a9eda5d1bc68ac3cd7637588334c9dc1</id>
<content type='text'>
Merge the 32- and 64-bit implementations of load_gs_index().

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20220325153953.162643-5-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/32: Remove lazy GS macros</title>
<updated>2022-04-14T12:09:43Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2022-03-25T15:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a24a60854d2ef19e0edcd11cdbbb4fabc655dde'/>
<id>urn:sha1:3a24a60854d2ef19e0edcd11cdbbb4fabc655dde</id>
<content type='text'>
GS is always a user segment now.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20220325153953.162643-4-brgerst@gmail.com
</content>
</entry>
<entry>
<title>x86/ibt,entry: Sprinkle ENDBR dust</title>
<updated>2022-03-15T09:32:35Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2022-03-08T15:30:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f93402b92d443573d310250efa0b7f352fec992'/>
<id>urn:sha1:8f93402b92d443573d310250efa0b7f352fec992</id>
<content type='text'>
Kernel entry points should be having ENDBR on for IBT configs.

The SYSCALL entry points are found through taking their respective
address in order to program them in the MSRs, while the exception
entry points are found through UNWIND_HINT_IRET_REGS.

The rule is that any UNWIND_HINT_IRET_REGS at sym+0 should have an
ENDBR, see the later objtool ibt validation patch.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Link: https://lore.kernel.org/r/20220308154317.933157479@infradead.org
</content>
</entry>
<entry>
<title>x86/ibt,xen: Sprinkle the ENDBR</title>
<updated>2022-03-15T09:32:35Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2022-03-08T15:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b2fc51576eff811a614e33cbbd0c3cb05022892'/>
<id>urn:sha1:5b2fc51576eff811a614e33cbbd0c3cb05022892</id>
<content type='text'>
Even though Xen currently doesn't advertise IBT, prepare for when it
will eventually do so and sprinkle the ENDBR dust accordingly.

Even though most of the entry points are IRET like, the CPL0
Hypervisor can set WAIT-FOR-ENDBR and demand ENDBR at these sites.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Link: https://lore.kernel.org/r/20220308154317.873919996@infradead.org
</content>
</entry>
<entry>
<title>x86/segment: Remove .fixup usage</title>
<updated>2021-12-11T08:09:48Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2021-11-10T10:01:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5fc77b916cb82fe476ae2344e0ec37445227a4f8'/>
<id>urn:sha1:5fc77b916cb82fe476ae2344e0ec37445227a4f8</id>
<content type='text'>
Create and use EX_TYPE_ZERO_REG to clear the register and retry the
segment load on exception.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Link: https://lore.kernel.org/r/20211110101325.663529463@infradead.org
</content>
</entry>
<entry>
<title>x86/extable: Rework the exception table mechanics</title>
<updated>2021-09-13T15:51:47Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2021-09-08T13:29:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46d28947d9876fc0f8f93d3c69813ef6e9852595'/>
<id>urn:sha1:46d28947d9876fc0f8f93d3c69813ef6e9852595</id>
<content type='text'>
The exception table entries contain the instruction address, the fixup
address and the handler address. All addresses are relative. Storing the
handler address has a few downsides:

 1) Most handlers need to be exported

 2) Handlers can be defined everywhere and there is no overview about the
    handler types

 3) MCE needs to check the handler type to decide whether an in kernel #MC
    can be recovered. The functionality of the handler itself is not in any
    way special, but for these checks there need to be separate functions
    which in the worst case have to be exported.

    Some of these 'recoverable' exception fixups are pretty obscure and
    just reuse some other handler to spare code. That obfuscates e.g. the
    #MC safe copy functions. Cleaning that up would require more handlers
    and exports

Rework the exception fixup mechanics by storing a fixup type number instead
of the handler address and invoke the proper handler for each fixup
type. Also teach the extable sort to leave the type field alone.

This makes most handlers static except for special cases like the MCE
MSR fixup and the BPF fixup. This allows to add more types for cleaning up
the obscure places without adding more handler code and exports.

There is a marginal code size reduction for a production config and it
removes _eight_ exported symbols.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lkml.kernel.org/r/20210908132525.211958725@linutronix.de
</content>
</entry>
</feed>
