<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/x86/kernel/cpu/microcode, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/cpu/microcode?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/cpu/microcode?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-18T09:03:27Z</updated>
<entry>
<title>x86/microcode/AMD: Apply the patch early on every logical thread</title>
<updated>2022-10-18T09:03:27Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-10-05T10:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e7ad18d1169c62e6c78c01ff693fd362d9d65278'/>
<id>urn:sha1:e7ad18d1169c62e6c78c01ff693fd362d9d65278</id>
<content type='text'>
Currently, the patch application logic checks whether the revision
needs to be applied on each logical CPU (SMT thread). Therefore, on SMT
designs where the microcode engine is shared between the two threads,
the application happens only on one of them as that is enough to update
the shared microcode engine.

However, there are microcode patches which do per-thread modification,
see Link tag below.

Therefore, drop the revision check and try applying on each thread. This
is what the BIOS does too so this method is very much tested.

Btw, change only the early paths. On the late loading paths, there's no
point in doing per-thread modification because if is it some case like
in the bugzilla below - removing a CPUID flag - the kernel cannot go and
un-use features it has detected are there early. For that, one should
use early loading anyway.

  [ bp: Fixes does not contain the oldest commit which did check for
    equality but that is good enough. ]

Fixes: 8801b3fcb574 ("x86/microcode/AMD: Rework container parsing")
Reported-by:  Ștefan Talpalaru &lt;stefantalpalaru@yahoo.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Tested-by:  Ștefan Talpalaru &lt;stefantalpalaru@yahoo.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216211
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Track patch allocation size explicitly</title>
<updated>2022-09-23T11:46:26Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2022-09-22T03:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=712f210a457d9c32414df246a72781550bc23ef6'/>
<id>urn:sha1:712f210a457d9c32414df246a72781550bc23ef6</id>
<content type='text'>
In preparation for reducing the use of ksize(), record the actual
allocation size for later memcpy(). This avoids copying extra
(uninitialized!) bytes into the patch buffer when the requested
allocation size isn't exactly the size of a kmalloc bucket.
Additionally, fix potential future issues where runtime bounds checking
will notice that the buffer was allocated to a smaller value than
returned by ksize().

Fixes: 757885e94a22 ("x86, microcode, amd: Early microcode patch loading support for AMD")
Suggested-by: Daniel Micay &lt;danielmicay@gmail.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/lkml/CA+DvKQ+bp7Y7gmaVhacjv9uF6Ar-o4tet872h4Q8RPYPJjcJQA@mail.gmail.com/
</content>
</entry>
<entry>
<title>x86/microcode: Print previous version of microcode after reload</title>
<updated>2022-09-02T06:01:58Z</updated>
<author>
<name>Ashok Raj</name>
<email>ashok.raj@intel.com</email>
</author>
<published>2022-08-29T18:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7fce8d6eccbc31a561d07c79f359ad09f0424347'/>
<id>urn:sha1:7fce8d6eccbc31a561d07c79f359ad09f0424347</id>
<content type='text'>
Print both old and new versions of microcode after a reload is complete
because knowing the previous microcode version is sometimes important
from a debugging perspective.

  [ bp: Massage commit message. ]

Signed-off-by: Ashok Raj &lt;ashok.raj@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Link: https://lore.kernel.org/r/20220829181030.722891-1-ashok.raj@intel.com
</content>
</entry>
<entry>
<title>x86/microcode: Remove -&gt;request_microcode_user()</title>
<updated>2022-08-26T09:56:08Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-08-25T07:51:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8c61eafd22d7207039bff85c6e1d386f15abd17e'/>
<id>urn:sha1:8c61eafd22d7207039bff85c6e1d386f15abd17e</id>
<content type='text'>
  181b6f40e9ea ("x86/microcode: Rip out the OLD_INTERFACE")

removed the old microcode loading interface but forgot to remove the
related -&gt;request_microcode_user() functionality which it uses.

Rip it out now too.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220825075445.28171-1-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode: Remove unnecessary perf callback</title>
<updated>2022-05-31T07:31:19Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-05-25T16:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0c0fe08c76485fe0178ebb0fa1a2052c727abe94'/>
<id>urn:sha1:0c0fe08c76485fe0178ebb0fa1a2052c727abe94</id>
<content type='text'>
c93dc84cbe32 ("perf/x86: Add a microcode revision check for SNB-PEBS")
checks whether the microcode revision has fixed PEBS issues.

This can happen either:

1. At PEBS init time, where the early microcode has been loaded already

2. During late loading, in the microcode_check() callback.

So remove the unnecessary call in the microcode loader init routine.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20220525161232.14924-5-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/microcode: Taint and warn on late loading</title>
<updated>2022-05-31T07:31:19Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-05-25T16:12:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d23d33ea0fcdc4bbb484990bf53867f99c63ccab'/>
<id>urn:sha1:d23d33ea0fcdc4bbb484990bf53867f99c63ccab</id>
<content type='text'>
Warn before it is attempted and taint the kernel. Late loading microcode
can lead to malfunction of the kernel when the microcode update changes
behaviour. There is no way for the kernel to determine whether its safe or
not.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20220525161232.14924-4-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/microcode: Default-disable late loading</title>
<updated>2022-05-31T07:31:19Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-05-25T16:12:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a77a94f86273ce42a39cb479217dd8d68acfe0ff'/>
<id>urn:sha1:a77a94f86273ce42a39cb479217dd8d68acfe0ff</id>
<content type='text'>
It is dangerous and it should not be used anyway - there's a nice early
loading already.

Requested-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20220525161232.14924-3-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode: Rip out the OLD_INTERFACE</title>
<updated>2022-05-31T07:31:19Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-05-25T16:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=181b6f40e9ea80c76756d4d0cdeed396016c487e'/>
<id>urn:sha1:181b6f40e9ea80c76756d4d0cdeed396016c487e</id>
<content type='text'>
Everything should be using the early initrd loading by now.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20220525161232.14924-2-bp@alien8.de

</content>
</entry>
<entry>
<title>Merge tag 'platform-drivers-x86-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86</title>
<updated>2022-05-24T03:38:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-05-24T03:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8443516da676be839b54ee11350baa2605f0a445'/>
<id>urn:sha1:8443516da676be839b54ee11350baa2605f0a445</id>
<content type='text'>
Pull x86 platform driver updates from Hans de Goede:
 "This includes some small changes to kernel/stop_machine.c and arch/x86
  which are deps of the new Intel IFS support.

  Highlights:

   - New drivers:
       - Intel "In Field Scan" (IFS) support
       - Winmate FM07/FM07P buttons
       - Mellanox SN2201 support

   -  AMD PMC driver enhancements

   -  Lots of various other small fixes and hardware-id additions"

* tag 'platform-drivers-x86-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (54 commits)
  platform/x86/intel/ifs: Add CPU_SUP_INTEL dependency
  platform/x86: intel_cht_int33fe: Set driver data
  platform/x86: intel-hid: fix _DSM function index handling
  platform/x86: toshiba_acpi: use kobj_to_dev()
  platform/x86: samsung-laptop: use kobj_to_dev()
  platform/x86: gigabyte-wmi: Add support for Z490 AORUS ELITE AC and X570 AORUS ELITE WIFI
  tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu
  tools/power/x86/intel-speed-select: Display error on turbo mode disabled
  Documentation: In-Field Scan
  platform/x86/intel/ifs: add ABI documentation for IFS
  trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations
  platform/x86/intel/ifs: Add IFS sysfs interface
  platform/x86/intel/ifs: Add scan test support
  platform/x86/intel/ifs: Authenticate and copy to secured memory
  platform/x86/intel/ifs: Check IFS Image sanity
  platform/x86/intel/ifs: Read IFS firmware image
  platform/x86/intel/ifs: Add stub driver for In-Field Scan
  stop_machine: Add stop_core_cpuslocked() for per-core operations
  x86/msr-index: Define INTEGRITY_CAPABILITIES MSR
  x86/microcode/intel: Expose collect_cpu_info_early() for IFS
  ...
</content>
</entry>
<entry>
<title>x86/microcode/intel: Expose collect_cpu_info_early() for IFS</title>
<updated>2022-05-12T13:35:29Z</updated>
<author>
<name>Jithu Joseph</name>
<email>jithu.joseph@intel.com</email>
</author>
<published>2022-05-06T22:53:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d3287fb0d3c8afdfd4870a6cd4a852abc9008b3b'/>
<id>urn:sha1:d3287fb0d3c8afdfd4870a6cd4a852abc9008b3b</id>
<content type='text'>
IFS is a CPU feature that allows a binary blob, similar to microcode,
to be loaded and consumed to perform low level validation of CPU
circuitry. In fact, it carries the same Processor Signature
(family/model/stepping) details that are contained in Intel microcode
blobs.

In support of an IFS driver to trigger loading, validation, and running
of these tests blobs, make the functionality of cpu_signatures_match()
and collect_cpu_info_early() available outside of the microcode driver.

Add an "intel_" prefix and drop the "_early" suffix from
collect_cpu_info_early() and EXPORT_SYMBOL_GPL() it. Add
declaration to x86 &lt;asm/cpu.h&gt;

Make cpu_signatures_match() an inline function in x86 &lt;asm/cpu.h&gt;,
and also give it an "intel_" prefix.

No functional change intended.

Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Jithu Joseph &lt;jithu.joseph@intel.com&gt;
Co-developed-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20220506225410.1652287-2-tony.luck@intel.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
</feed>
