<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/entry/calling.h, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-09-04T08:59:21Z</updated>
<entry>
<title>x86/entry/64: Do not include inst.h in calling.h</title>
<updated>2020-09-04T08:59:21Z</updated>
<author>
<name>Uros Bizjak</name>
</author>
<published>2020-08-27T17:17:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb3621798bcdd34ba480109bac357ba6a784d3e2'/>
<id>urn:sha1:eb3621798bcdd34ba480109bac357ba6a784d3e2</id>
<content type='text'>
inst.h was included in calling.h solely to instantiate the RDPID macro.
The usage of RDPID was removed in

  6a3ea3e68b8a ("x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVM")

so remove the include.

Fixes: 6a3ea3e68b8a ("x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVM")
Signed-off-by: Uros Bizjak &lt;ubizjak@gmail.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20200827171735.93825-1-ubizjak@gmail.com
</content>
</entry>
<entry>
<title>x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVM</title>
<updated>2020-08-21T14:15:27Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2020-08-21T10:52:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a3ea3e68b8a8a26c4aaac03432ed92269c9a14e'/>
<id>urn:sha1:6a3ea3e68b8a8a26c4aaac03432ed92269c9a14e</id>
<content type='text'>
KVM has an optmization to avoid expensive MRS read/writes on
VMENTER/EXIT. It caches the MSR values and restores them either when
leaving the run loop, on preemption or when going out to user space.

The affected MSRs are not required for kernel context operations. This
changed with the recently introduced mechanism to handle FSGSBASE in the
paranoid entry code which has to retrieve the kernel GSBASE value by
accessing per CPU memory. The mechanism needs to retrieve the CPU number
and uses either LSL or RDPID if the processor supports it.

Unfortunately RDPID uses MSR_TSC_AUX which is in the list of cached and
lazily restored MSRs, which means between the point where the guest value
is written and the point of restore, MSR_TSC_AUX contains a random number.

If an NMI or any other exception which uses the paranoid entry path happens
in such a context, then RDPID returns the random guest MSR_TSC_AUX value.

As a consequence this reads from the wrong memory location to retrieve the
kernel GSBASE value. Kernel GS is used to for all regular this_cpu_*()
operations. If the GSBASE in the exception handler points to the per CPU
memory of a different CPU then this has the obvious consequences of data
corruption and crashes.

As the paranoid entry path is the only place which accesses MSR_TSX_AUX
(via RDPID) and the fallback via LSL is not significantly slower, remove
the RDPID alternative from the entry path and always use LSL.

The alternative would be to write MSR_TSC_AUX on every VMENTER and VMEXIT
which would be inflicting massive overhead on that code path.

[ tglx: Rewrote changelog ]

Fixes: eaad981291ee3 ("x86/entry/64: Introduce the FIND_PERCPU_BASE macro")
Reported-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Debugged-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Suggested-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Sean Christopherson &lt;sean.j.christopherson@intel.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20200821105229.18938-1-pbonzini@redhat.com
</content>
</entry>
<entry>
<title>x86/entry/64: Handle FSGSBASE enabled paranoid entry/exit</title>
<updated>2020-06-18T13:47:04Z</updated>
<author>
<name>Chang S. Bae</name>
</author>
<published>2020-05-28T20:13:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c82965f9e53005c1c62632c468968293262056cb'/>
<id>urn:sha1:c82965f9e53005c1c62632c468968293262056cb</id>
<content type='text'>
Without FSGSBASE, user space cannot change GSBASE other than through a
PRCTL. The kernel enforces that the user space GSBASE value is postive as
negative values are used for detecting the kernel space GSBASE value in the
paranoid entry code.

If FSGSBASE is enabled, user space can set arbitrary GSBASE values without
kernel intervention, including negative ones, which breaks the paranoid
entry assumptions.

To avoid this, paranoid entry needs to unconditionally save the current
GSBASE value independent of the interrupted context, retrieve and write the
kernel GSBASE and unconditionally restore the saved value on exit. The
restore happens either in paranoid_exit or in the special exit path of the
NMI low level code.

All other entry code pathes which use unconditional SWAPGS are not affected
as they do not depend on the actual content.

[ tglx: Massaged changelogs and comments ]

Suggested-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Suggested-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Chang S. Bae &lt;chang.seok.bae@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/1557309753-24073-13-git-send-email-chang.seok.bae@intel.com
Link: https://lkml.kernel.org/r/20200528201402.1708239-12-sashal@kernel.org


</content>
</entry>
<entry>
<title>x86/entry/64: Introduce the FIND_PERCPU_BASE macro</title>
<updated>2020-06-18T13:47:04Z</updated>
<author>
<name>Chang S. Bae</name>
</author>
<published>2020-05-28T20:13:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eaad981291ee36efee15a5e515d4598ae94ace07'/>
<id>urn:sha1:eaad981291ee36efee15a5e515d4598ae94ace07</id>
<content type='text'>
GSBASE is used to find per-CPU data in the kernel. But when GSBASE is
unknown, the per-CPU base can be found from the per_cpu_offset table with a
CPU NR.  The CPU NR is extracted from the limit field of the CPUNODE entry
in GDT, or by the RDPID instruction. This is a prerequisite for using
FSGSBASE in the low level entry code.

Also, add the GAS-compatible RDPID macro as binutils 2.23 do not support
it. Support is added in version 2.27.

[ tglx: Massaged changelog ]

Suggested-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Chang S. Bae &lt;chang.seok.bae@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/1557309753-24073-12-git-send-email-chang.seok.bae@intel.com
Link: https://lkml.kernel.org/r/20200528201402.1708239-11-sashal@kernel.org


</content>
</entry>
<entry>
<title>x86/entry: Remove the apic/BUILD interrupt leftovers</title>
<updated>2020-06-11T13:15:16Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2020-05-21T20:05:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75da04f7f3cb416a68475e040175dc013da32de2'/>
<id>urn:sha1:75da04f7f3cb416a68475e040175dc013da32de2</id>
<content type='text'>
Remove all the code which was there to emit the system vector stubs. All
users are gone.

Move the now unused GET_CR2_INTO macro muck to head_64.S where the last
user is. Fixup the eye hurting comment there while at it.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20200521202119.927433002@linutronix.de


</content>
</entry>
<entry>
<title>x86/irq: Convey vector as argument and not in ptregs</title>
<updated>2020-06-11T13:15:11Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2020-05-21T20:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=633260fa143bbed05e65dc557a492667dfdc45bb'/>
<id>urn:sha1:633260fa143bbed05e65dc557a492667dfdc45bb</id>
<content type='text'>
Device interrupts which go through do_IRQ() or the spurious interrupt
handler have their separate entry code on 64 bit for no good reason.

Both 32 and 64 bit transport the vector number through ORIG_[RE]AX in
pt_regs. Further the vector number is forced to fit into an u8 and is
complemented and offset by 0x80 so it's in the signed character
range. Otherwise GAS would expand the pushq to a 5 byte instruction for any
vector &gt; 0x7F.

Treat the vector number like an error code and hand it to the C function as
argument. This allows to get rid of the extra entry code in a later step.

Simplify the error code push magic by implementing the pushq imm8 via a
'.byte 0x6a, vector' sequence so GAS is not able to screw it up. As the
pushq imm8 is sign extending the resulting error code needs to be truncated
to 8 bits in C code.

Originally-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lore.kernel.org/r/20200521202118.796915981@linutronix.de


</content>
</entry>
<entry>
<title>x86/entry/64: Fix unwind hints in register clearing code</title>
<updated>2020-04-25T10:22:27Z</updated>
<author>
<name>Josh Poimboeuf</name>
</author>
<published>2020-04-25T10:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06a9750edcffa808494d56da939085c35904e618'/>
<id>urn:sha1:06a9750edcffa808494d56da939085c35904e618</id>
<content type='text'>
The PUSH_AND_CLEAR_REGS macro zeroes each register immediately after
pushing it.  If an NMI or exception hits after a register is cleared,
but before the UNWIND_HINT_REGS annotation, the ORC unwinder will
wrongly think the previous value of the register was zero.  This can
confuse the unwinding process and cause it to exit early.

Because ORC is simpler than DWARF, there are a limited number of unwind
annotation states, so it's not possible to add an individual unwind hint
after each push/clear combination.  Instead, the register clearing
instructions need to be consolidated and moved to after the
UNWIND_HINT_REGS annotation.

Fixes: 3f01daecd545 ("x86/entry/64: Introduce the PUSH_AND_CLEAN_REGS macro")
Reviewed-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Dave Jones &lt;dsj@fb.com&gt;
Cc: Jann Horn &lt;jannh@google.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Link: https://lore.kernel.org/r/68fd3d0bc92ae2d62ff7879d15d3684217d51f08.1587808742.git.jpoimboe@redhat.com
</content>
</entry>
<entry>
<title>context_tracking: Rename context_tracking_is_enabled() =&gt; context_tracking_enabled()</title>
<updated>2019-10-29T09:01:12Z</updated>
<author>
<name>Frederic Weisbecker</name>
</author>
<published>2019-10-16T02:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74c578759f15cb5a0d0107759bdad671d7b52ab9'/>
<id>urn:sha1:74c578759f15cb5a0d0107759bdad671d7b52ab9</id>
<content type='text'>
Remove the superfluous "is" in the middle of the name. We want to
standardize the naming so that it can be expanded through suffixes:

	context_tracking_enabled()
	context_tracking_enabled_cpu()
	context_tracking_enabled_this_cpu()

Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Rafael J . Wysocki &lt;rjw@rjwysocki.net&gt;
Cc: Rik van Riel &lt;riel@surriel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: Wanpeng Li &lt;wanpengli@tencent.com&gt;
Cc: Yauheni Kaliuta &lt;yauheni.kaliuta@redhat.com&gt;
Link: https://lkml.kernel.org/r/20191016025700.31277-6-frederic@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch master from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git</title>
<updated>2019-07-28T20:22:40Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-07-28T20:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a30bdd99f37352b188575b27924c407c6ddff9e'/>
<id>urn:sha1:7a30bdd99f37352b188575b27924c407c6ddff9e</id>
<content type='text'>
Pick up the spectre documentation so the Grand Schemozzle can be added.
</content>
</entry>
<entry>
<title>x86/paravirt: Make read_cr2() CALLEE_SAVE</title>
<updated>2019-07-17T21:17:37Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2019-07-11T11:40:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55aedddb6149ab71bec9f050846855113977b033'/>
<id>urn:sha1:55aedddb6149ab71bec9f050846855113977b033</id>
<content type='text'>
The one paravirt read_cr2() implementation (Xen) is actually quite trivial
and doesn't need to clobber anything other than the return register.

Making read_cr2() CALLEE_SAVE avoids all the PUSH/POP nonsense and allows
more convenient use from assembly.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: bp@alien8.de
Cc: rostedt@goodmis.org
Cc: luto@kernel.org
Cc: torvalds@linux-foundation.org
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: zhe.he@windriver.com
Cc: joel@joelfernandes.org
Cc: devel@etsukata.com
Link: https://lkml.kernel.org/r/20190711114335.887392493@infradead.org

</content>
</entry>
</feed>
