<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-obmc-linux/arch/x86/kernel/cpu/microcode, branch dev-5.0</title>
<subtitle>Talos™ II Linux sources for OpenBMC</subtitle>
<id>https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-5.0</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-5.0'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/'/>
<updated>2019-01-31T15:54:32+00:00</updated>
<entry>
<title>x86/microcode/amd: Don't falsely trick the late loading mechanism</title>
<updated>2019-01-31T15:54:32+00:00</updated>
<author>
<name>Thomas Lendacky</name>
<email>Thomas.Lendacky@amd.com</email>
</author>
<published>2019-01-31T14:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=912139cfbfa6a2bc1da052314d2c29338dae1f6a'/>
<id>urn:sha1:912139cfbfa6a2bc1da052314d2c29338dae1f6a</id>
<content type='text'>
The load_microcode_amd() function searches for microcode patches and
attempts to apply a microcode patch if it is of different level than the
currently installed level.

While the processor won't actually load a level that is less than
what is already installed, the logic wrongly returns UCODE_NEW thus
signaling to its caller reload_store() that a late loading should be
attempted.

If the file-system contains an older microcode revision than what is
currently running, such a late microcode reload can result in these
misleading messages:

  x86/CPU: CPU features have changed after loading microcode, but might not take effect.
  x86/CPU: Please consider either early loading through initrd/built-in or a potential BIOS update.

These messages were issued on a system where SME/SEV are not
enabled by the BIOS (MSR C001_0010[23] = 0b) because during boot,
early_detect_mem_encrypt() is called and cleared the SME and SEV
features in this case.

However, after the wrong late load attempt, get_cpu_cap() is called and
reloads the SME and SEV feature bits, resulting in the messages.

Update the microcode level check to not attempt microcode loading if the
current level is greater than(!) and not only equal to the current patch
level.

 [ bp: massage commit message. ]

Fixes: 2613f36ed965 ("x86/microcode: Attempt late loading only when new microcode is present")
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: x86-ml &lt;x86@kernel.org&gt;
Link: https://lkml.kernel.org/r/154894518427.9406.8246222496874202773.stgit@tlendack-t1.amdoffice.net
</content>
</entry>
<entry>
<title>mm: convert totalram_pages and totalhigh_pages variables to atomic</title>
<updated>2018-12-28T20:11:47+00:00</updated>
<author>
<name>Arun KS</name>
<email>arunks@codeaurora.org</email>
</author>
<published>2018-12-28T08:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=ca79b0c211af63fa3276f0e3fd7dd9ada2439839'/>
<id>urn:sha1:ca79b0c211af63fa3276f0e3fd7dd9ada2439839</id>
<content type='text'>
totalram_pages and totalhigh_pages are made static inline function.

Main motivation was that managed_page_count_lock handling was complicating
things.  It was discussed in length here,
https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes
better to remove the lock and convert variables to atomic, with preventing
poteintial store-to-read tearing as a bonus.

[akpm@linux-foundation.org: coding style fixes]
Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org
Signed-off-by: Arun KS &lt;arunks@codeaurora.org&gt;
Suggested-by: Michal Hocko &lt;mhocko@suse.com&gt;
Suggested-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Reviewed-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: reference totalram_pages and managed_pages once per function</title>
<updated>2018-12-28T20:11:47+00:00</updated>
<author>
<name>Arun KS</name>
<email>arunks@codeaurora.org</email>
</author>
<published>2018-12-28T08:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=3d6357de8aa09e1966770dc1171c72679946464f'/>
<id>urn:sha1:3d6357de8aa09e1966770dc1171c72679946464f</id>
<content type='text'>
Patch series "mm: convert totalram_pages, totalhigh_pages and managed
pages to atomic", v5.

This series converts totalram_pages, totalhigh_pages and
zone-&gt;managed_pages to atomic variables.

totalram_pages, zone-&gt;managed_pages and totalhigh_pages updates are
protected by managed_page_count_lock, but readers never care about it.
Convert these variables to atomic to avoid readers potentially seeing a
store tear.

Main motivation was that managed_page_count_lock handling was complicating
things.  It was discussed in length here,
https://lore.kernel.org/patchwork/patch/995739/#1181785 It seemes better
to remove the lock and convert variables to atomic.  With the change,
preventing poteintial store-to-read tearing comes as a bonus.

This patch (of 4):

This is in preparation to a later patch which converts totalram_pages and
zone-&gt;managed_pages to atomic variables.  Please note that re-reading the
value might lead to a different value and as such it could lead to
unexpected behavior.  There are no known bugs as a result of the current
code but it is better to prevent from them in principle.

Link: http://lkml.kernel.org/r/1542090790-21750-2-git-send-email-arunks@codeaurora.org
Signed-off-by: Arun KS &lt;arunks@codeaurora.org&gt;
Reviewed-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Update copyright</title>
<updated>2018-11-19T09:55:12+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-10-20T13:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=2ffcbce39ea1e355eed8c6527308624f366f1c58'/>
<id>urn:sha1:2ffcbce39ea1e355eed8c6527308624f366f1c58</id>
<content type='text'>
Adjust copyright.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-17-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Check the equivalence table size when scanning it</title>
<updated>2018-11-19T09:55:12+00:00</updated>
<author>
<name>Maciej S. Szmigiero</name>
<email>mail@maciej.szmigiero.name</email>
</author>
<published>2018-09-13T10:01:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=413c89154c6759cbd5e17febd04c187470613173'/>
<id>urn:sha1:413c89154c6759cbd5e17febd04c187470613173</id>
<content type='text'>
Currently, the code scanning the CPU equivalence table read from a
microcode container file assumes that it actually contains a terminating
zero entry.

Check also the size of this table to make sure that no reads past its
end happen, in case there's no terminating zero entry at the end of the
table.

 [ bp: Adjust to new changes. ]

Signed-off-by: Maciej S. Szmigiero &lt;mail@maciej.szmigiero.name&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-16-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Convert CPU equivalence table variable into a struct</title>
<updated>2018-11-19T09:55:12+00:00</updated>
<author>
<name>Maciej S. Szmigiero</name>
<email>mail@maciej.szmigiero.name</email>
</author>
<published>2018-09-13T09:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=39cd7c17f9bc3fe3737dacd4225eeabe56df197c'/>
<id>urn:sha1:39cd7c17f9bc3fe3737dacd4225eeabe56df197c</id>
<content type='text'>
Convert the CPU equivalence table into a proper struct in preparation
for tracking also the size of this table.

 [ bp: Have functions deal with struct equiv_cpu_table pointers only. Rediff. ]

Signed-off-by: Maciej S. Szmigiero &lt;mail@maciej.szmigiero.name&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-15-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Check microcode container data in the late loader</title>
<updated>2018-11-19T09:55:11+00:00</updated>
<author>
<name>Maciej S. Szmigiero</name>
<email>mail@maciej.szmigiero.name</email>
</author>
<published>2018-09-13T06:49:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=38673f623dfcaa03921aa5704ade176cd584c886'/>
<id>urn:sha1:38673f623dfcaa03921aa5704ade176cd584c886</id>
<content type='text'>
Convert the late loading path to use the newly introduced microcode
container data checking functions as it was previously done for the
early loader.

[ bp: Keep header length addition in install_equiv_cpu_table() and rediff. ]

Signed-off-by: Maciej S. Szmigiero &lt;mail@maciej.szmigiero.name&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-14-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Fix container size's type</title>
<updated>2018-11-19T09:55:06+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-09-12T16:50:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=72dc571a3a77081112944fe0c2dbff614114b04a'/>
<id>urn:sha1:72dc571a3a77081112944fe0c2dbff614114b04a</id>
<content type='text'>
Make it size_t everywhere as this is what we get from cpio.

 [ bp: Fix a smatch warning. ]

Originally-by: Maciej S. Szmigiero &lt;mail@maciej.szmigiero.name&gt;
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lkml.kernel.org/r/20181107170218.7596-13-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Convert early parser to the new verification routines</title>
<updated>2018-11-19T09:51:06+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-09-12T16:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=c45e80358cb3c61eaf6f5d35af86c6a874935bd0'/>
<id>urn:sha1:c45e80358cb3c61eaf6f5d35af86c6a874935bd0</id>
<content type='text'>
Now that they have the required functionality, use them to verify the
equivalence table and each patch, thus making parse_container() more
readable.

Originally-by: "Maciej S. Szmigiero" &lt;mail@maciej.szmigiero.name&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-12-bp@alien8.de
</content>
</entry>
<entry>
<title>x86/microcode/AMD: Change verify_patch()'s return value</title>
<updated>2018-11-19T09:51:06+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-10-19T12:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=d430a305b7f8127d992e79e90b6fac00f99d23b3'/>
<id>urn:sha1:d430a305b7f8127d992e79e90b6fac00f99d23b3</id>
<content type='text'>
Have it return 0 on success, positive value when the current patch
should be skipped and negative on error.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-11-bp@alien8.de
</content>
</entry>
</feed>
