From: Dave Hansen <dave.hansen@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Zixi Chen <zixchen@redhat.com>, Adam Dunlap <acdunlap@google.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Kai Huang <kai.huang@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 0/2] x86/cpu: fix invalid MTRR mask values for SEV or TME
Date: Thu, 1 Feb 2024 10:29:00 -0800 [thread overview]
Message-ID: <2b5e6d68-007e-48bd-be61-9a354be2ccbf@intel.com> (raw)
In-Reply-To: <20240131230902.1867092-1-pbonzini@redhat.com>
On 1/31/24 15:09, Paolo Bonzini wrote:
> However, as noticed by Kirill, the patch I sent as v1 actually works only
> until Linux 6.6. In Linux 6.7, commit fbf6449f84bf ("x86/sev-es: Set
> x86_virt_bits to the correct value straight away, instead of a two-phase
> approach") reorganized the initialization of c->x86_phys_bits in a way
> that broke the patch. But even in 6.7 AMD processors, which did try to
> reduce it in this_cpu->c_early_init(c), had their x86_phys_bits value
> overwritten by get_cpu_address_sizes(), so that early_identify_cpu()
> left the wrong value in x86_phys_bits. This probably went unnoticed
> because on AMD processors you need not apply the reduced MAXPHYADDR to
> MTRR masks.
I really wanted get_cpu_address_sizes() to be the one and only spot
where c->x86_phys_bits is established. That way, we don't get a bunch
of code all of the place tweaking it and fighting for who "wins".
We're not there yet, but the approach in this patch moves it back in the
wrong direction because it permits the random tweaking of c->x86_phys_bits.
Could we instead do something more like the (completely untested)
attached patch?
BTW, I'm pretty sure the WARN_ON() in the patch won't actually work, but
it'd be nice to work toward a point when it does.
next prev parent reply other threads:[~2024-02-01 18:29 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 23:09 [PATCH v2 0/2] x86/cpu: fix invalid MTRR mask values for SEV or TME Paolo Bonzini
2024-01-31 23:09 ` [PATCH v2 1/2] x86/cpu: allow reducing x86_phys_bits during early_identify_cpu() Paolo Bonzini
2024-02-01 8:33 ` Kirill A . Shutemov
2024-02-01 15:44 ` Huang, Kai
2024-01-31 23:09 ` [PATCH v2 2/2] x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers Paolo Bonzini
2024-02-01 8:34 ` Kirill A . Shutemov
2024-02-01 15:42 ` Huang, Kai
2024-02-01 18:29 ` Dave Hansen [this message]
2024-02-01 21:42 ` [PATCH v2 0/2] x86/cpu: fix invalid MTRR mask values for SEV or TME Dave Hansen
2024-02-01 23:08 ` Paolo Bonzini
2024-02-04 17:21 ` Paolo Bonzini
2024-02-13 15:45 ` Paolo Bonzini
2024-02-13 22:02 ` Dave Hansen
2024-02-13 22:25 ` Paolo Bonzini
2024-02-20 12:22 ` Paolo Bonzini
2024-02-22 18:06 ` Dave Hansen
2024-02-22 18:08 ` Paolo Bonzini
2024-02-26 1:57 ` Yin Fengwei
2024-02-26 16:21 ` Dave Hansen
2024-02-27 2:02 ` Yin Fengwei
2024-02-27 6:08 ` Yin Fengwei
2024-02-27 13:30 ` Dave Hansen
2024-02-28 0:07 ` Yin Fengwei
2024-02-13 17:07 ` Dave Hansen
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=2b5e6d68-007e-48bd-be61-9a354be2ccbf@intel.com \
--to=dave.hansen@intel.com \
--cc=acdunlap@google.com \
--cc=dave.hansen@linux.intel.com \
--cc=kai.huang@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=zixchen@redhat.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