From: Jan Beulich Date: Mon, 29 Apr 2024 07:38:47 +0000 (+0200) Subject: x86/MTRR: correct inadvertently inverted WC check X-Git-Tag: RELEASE-4.17.5~68 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb28fa605289968ecd7654718a8d5c2886a6a639;p=xen.git x86/MTRR: correct inadvertently inverted WC check The ! clearly got lost by mistake. Fixes: e9e0eb30d4d6 ("x86/MTRR: avoid several indirect calls") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné master commit: 77e25f0e30ddd11e043e6fce84bf108ce7de5b6f master date: 2024-04-23 14:13:48 +0200 --- diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c index dee59ea168..990f12286a 100644 --- a/xen/arch/x86/cpu/mtrr/main.c +++ b/xen/arch/x86/cpu/mtrr/main.c @@ -316,7 +316,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, } /* If the type is WC, check that this processor supports it */ - if ((type == MTRR_TYPE_WRCOMB) && mtrr_have_wrcomb()) { + if ((type == MTRR_TYPE_WRCOMB) && !mtrr_have_wrcomb()) { printk(KERN_WARNING "mtrr: your processor doesn't support write-combining\n"); return -EOPNOTSUPP;