public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: Ashok Raj <ashok.raj@intel.com>, Dave Hansen <dave.hansen@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <tony.luck@intel.com>,
	Yan Hua Wu <yanhua1.wu@intel.com>,
	William Xie <william.xie@intel.com>
Subject: Re: [PATCH 1/1] arch/x86/microcode/intel: Remove unnecessary cache writeback and invalidation
Date: Wed, 3 Jul 2024 17:05:53 -0700	[thread overview]
Message-ID: <cb646736-1ebb-4273-b90e-734a318b59ca@intel.com> (raw)
In-Reply-To: <ZoXDxldNlTYRo-0h@a4bf019067fa.jf.intel.com>

On 7/3/2024 2:33 PM, Ashok Raj wrote:
> 
> When wbinvd() was introduced I do believe we added to both early and late.
> Although I don't recall entirely.

Yes, it was added for both:

$ git show --source 91df9fdf5149
...
diff --git a/arch/x86/kernel/cpu/microcode/intel.c 
b/arch/x86/kernel/cpu/microcode/intel.c
index 87bd6dc94081..e2864bc2d575 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -600,6 +600,12 @@ static int apply_microcode_early(struct 
ucode_cpu_info *uci, bool early)
                 return UCODE_OK;
         }

+       /*
+        * Writeback and invalidate caches before updating microcode to 
avoid
+        * internal issues depending on what the microcode is updating.
+        */
+       native_wbinvd();
+
         /* write microcode via MSR 0x79 */
         native_wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits);

@@ -816,6 +822,12 @@ static enum ucode_state apply_microcode_intel(int cpu)
                 return UCODE_OK;
         }

+       /*
+        * Writeback and invalidate caches before updating microcode to 
avoid
+        * internal issues depending on what the microcode is updating.
+        */
+       native_wbinvd();
+
         /* write microcode via MSR 0x79 */
         wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits);

Thanks,
Chang

  reply	other threads:[~2024-07-04  0:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 21:20 [PATCH 0/1] x86/microcode: Revert cache flush on Intel microcode loading Chang S. Bae
2024-07-01 21:20 ` [PATCH 1/1] arch/x86/microcode/intel: Remove unnecessary cache writeback and invalidation Chang S. Bae
2024-07-01 22:56   ` Dave Hansen
2024-07-03 20:50     ` Ashok Raj
2024-07-03 20:55       ` Dave Hansen
2024-07-03 21:03         ` Ashok Raj
2024-07-03 21:11           ` Dave Hansen
2024-07-03 21:33             ` Ashok Raj
2024-07-04  0:05               ` Chang S. Bae [this message]
2024-07-02 23:24   ` Chang S. Bae
2024-09-10 18:35   ` Chang S. Bae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb646736-1ebb-4273-b90e-734a318b59ca@intel.com \
    --to=chang.seok.bae@intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=william.xie@intel.com \
    --cc=x86@kernel.org \
    --cc=yanhua1.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox