Skip to content

Commit

Permalink
x86: bugfix wbinvd() model check instead of family check
Browse files Browse the repository at this point in the history
wbinvd is supported on all CPUs 486 or later. But,
pageattr.c is checking x86_model >= 4 before wbinvd(), which looks like
an oversight bug. It was first introduced at one place by changeset
d7c8f21 and got copied over to second
place in the same file later.

[ Impact: fix missing cache flush on early-model CPUs, potential data corruption ]

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
venkatesh.pallipadi@intel.com authored and H. Peter Anvin committed May 22, 2009
1 parent 0c752a9 commit 0b82753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void __cpa_flush_all(void *arg)
*/
__flush_tlb_all();

if (cache && boot_cpu_data.x86_model >= 4)
if (cache && boot_cpu_data.x86 >= 4)
wbinvd();
}

Expand Down Expand Up @@ -218,7 +218,7 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,

/* 4M threshold */
if (numpages >= 1024) {
if (boot_cpu_data.x86_model >= 4)
if (boot_cpu_data.x86 >= 4)
wbinvd();
return;
}
Expand Down

0 comments on commit 0b82753

Please sign in to comment.