Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1356014
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table |
| Date | 2016-03-11 17:00 +0100 |
| Message-ID | <rbxDP-8op-1@gated-at.bofh.it> (permalink) |
| References | <rbmp4-f1-7@gated-at.bofh.it> <rbmp4-f1-5@gated-at.bofh.it> <rbroJ-3VO-11@gated-at.bofh.it> <rbxkt-8dl-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Mar 11, 2016 at 09:27:40AM -0700, Toshi Kani wrote:
> How about pat_disable_setup()? It's only used for the disabled case, so
> I'd prefer to keep the word "disable".
What for?
Renaming pat_init() to pat_setup() is perfectly fine as it sets up PAT
after looking at pat_disabled() setting and after looking at the CPU
vendor. Sounds like a perfectly sane design to me.
> Yes, calling pat_init() from pat_disable() works too. I changed it in this
> way because:
> - pat_bsp_init() calls pat_disabled() in an error case. It is simpler to
> avoid a recursive call to pat_init().
So do this:
static inline void pat_disable(const char *reason)
{
if (!__pat_enabled)
return;
> - pat_bsp_init() has two different error paths, 1) call pat_disable() and
> return, and 2) goto done and call pat_init_cache_modes(). We can remove
> case 2) to keep the error handling consistent in this way.
Above.
> > Then you don't have to add yet another static disable_init_done but rely
> > on boot_cpu_done which gets set in pat_init().
>
> Right, but it will do 'boot_cpu_done = true' twice, and this implicit
> recursive call may cause an issue in future if someone makes change
> carelessly.
So move boot_cpu_done into pat_bsp_init() and make it protect that
function from a being called a second time.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Refactor MTRR and PAT initializations Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 05:00 +0100
[PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 05:00 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-11 10:20 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 16:40 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-11 17:00 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 19:40 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-12 13:00 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-14 21:50 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-15 12:10 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-15 22:10 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-15 01:30 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-15 03:20 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-15 12:10 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-15 16:00 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-15 16:50 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Toshi Kani <toshi.kani@hpe.com> - 2016-03-15 17:20 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table Borislav Petkov <bp@alien8.de> - 2016-03-15 17:40 +0100
Re: [PATCH 1/2] x86/mm/pat: Change pat_disable() to emulate PAT table "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-15 22:40 +0100
[PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 05:00 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Ingo Molnar <mingo@kernel.org> - 2016-03-11 10:10 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Ingo Molnar <mingo@kernel.org> - 2016-03-11 10:20 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 18:50 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Ingo Molnar <mingo@kernel.org> - 2016-03-12 17:20 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-14 20:00 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-03-15 00:00 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-15 00:50 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Borislav Petkov <bp@suse.de> - 2016-03-15 17:00 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Borislav Petkov <bp@alien8.de> - 2016-03-11 10:30 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-11 19:10 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-11 23:20 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-12 00:10 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-12 00:40 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-12 01:30 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-15 01:20 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code Toshi Kani <toshi.kani@hpe.com> - 2016-03-16 00:00 +0100
Re: [PATCH 2/2] x86/mtrr: Refactor PAT initialization code "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-03-16 00:30 +0100
csiph-web