Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1522631
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME |
| Date | 2016-11-15 13:20 +0100 |
| Message-ID | <sDKSt-4PB-17@gated-at.bofh.it> (permalink) |
| References | <sBVfj-4HF-7@gated-at.bofh.it> <sDKSt-4PB-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Nov 09, 2016 at 06:35:13PM -0600, Tom Lendacky wrote:
> +/*
> + * AMD Secure Memory Encryption (SME) can reduce the size of the physical
> + * address space if it is enabled, even if memory encryption is not active.
> + * Adjust x86_phys_bits if SME is enabled.
> + */
> +static void phys_bits_adjust(struct cpuinfo_x86 *c)
> +{
Better call this function amd_sme_phys_bits_adjust(). This name makes it
clear at the call-site why it is there and what it does.
> + u32 eax, ebx, ecx, edx;
> + u64 msr;
> +
> + if (c->x86_vendor != X86_VENDOR_AMD)
> + return;
> +
> + if (c->extended_cpuid_level < 0x8000001f)
> + return;
> +
> + /* Check for SME feature */
> + cpuid(0x8000001f, &eax, &ebx, &ecx, &edx);
> + if (!(eax & 0x01))
> + return;
Maybe add a comment here why you can't use cpu_has (yet).
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME Joerg Roedel <joro@8bytes.org> - 2016-11-15 13:20 +0100
Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME Borislav Petkov <bp@alien8.de> - 2016-11-15 13:20 +0100
Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME Borislav Petkov <bp@alien8.de> - 2016-11-15 16:40 +0100
Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME Borislav Petkov <bp@alien8.de> - 2016-11-15 17:40 +0100
Re: [RFC PATCH v3 04/20] x86: Handle reduction in physical address size with SME Borislav Petkov <bp@alien8.de> - 2016-11-15 22:40 +0100
csiph-web