From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Wei Liu <wl@xen.org>
Cc: Wei Liu <liuwe@microsoft.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Paul Durrant <pdurrant@amazon.com>,
Michael Kelley <mikelley@microsoft.com>,
Xen Development List <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v5 04/12] x86: make paddr_bits available earlier
Date: Thu, 30 Jan 2020 11:17:33 +0100 [thread overview]
Message-ID: <20200130101733.GF4679@Air-de-Roger> (raw)
In-Reply-To: <20200129202034.15052-5-liuwe@microsoft.com>
On Wed, Jan 29, 2020 at 08:20:26PM +0000, Wei Liu wrote:
> Move early_cpu_init before init_e820, such that paddr_bits can be used
> by e820 code.
>
> This will reduce code repetition and prepare for further adjustment when
> L0 hypervisor comes into play.
>
> Signed-off-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
One typo below.
> ---
> xen/arch/x86/e820.c | 14 ++++----------
> xen/arch/x86/setup.c | 5 +++--
> 2 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
> index 082f9928a1..3892c9cfb7 100644
> --- a/xen/arch/x86/e820.c
> +++ b/xen/arch/x86/e820.c
> @@ -420,7 +420,7 @@ static uint64_t __init mtrr_top_of_ram(void)
> {
> uint32_t eax, ebx, ecx, edx;
> uint64_t mtrr_cap, mtrr_def, addr_mask, base, mask, top;
> - unsigned int i, phys_bits = 36;
> + unsigned int i;
>
> /* By default we check only Intel systems. */
> if ( e820_mtrr_clip == -1 )
> @@ -445,15 +445,9 @@ static uint64_t __init mtrr_top_of_ram(void)
> if ( !test_bit(X86_FEATURE_MTRR & 31, &edx) )
> return 0;
>
> - /* Find the physical address size for this CPU. */
> - eax = cpuid_eax(0x80000000);
> - if ( (eax >> 16) == 0x8000 && eax >= 0x80000008 )
> - {
> - phys_bits = (uint8_t)cpuid_eax(0x80000008);
> - if ( phys_bits > PADDR_BITS )
> - phys_bits = PADDR_BITS;
> - }
> - addr_mask = ((1ull << phys_bits) - 1) & ~((1ull << 12) - 1);
> + /* paddr_bits must have been set at this point */
> + ASSERT(paddr_bits);
> + addr_mask = ((1ull << paddr_bits) - 1) & PAGE_MASK;
>
> rdmsrl(MSR_MTRRcap, mtrr_cap);
> rdmsrl(MSR_MTRRdefType, mtrr_def);
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index d858883404..89fe49149f 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -954,6 +954,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> else
> panic("Bootloader provided no memory information\n");
>
> + /* This must come before e820 code becuause it sets paddr_bits. */
^ because
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-01-30 10:17 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 20:20 [Xen-devel] [PATCH v5 00/12] More Hyper-V infrastructures Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 01/12] MAINTAINERS: put Hyper-V code under Viridian maintainership Wei Liu
2020-01-30 9:34 ` Durrant, Paul
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 02/12] x86/hypervisor: make hypervisor_ap_setup return an error code Wei Liu
2020-01-30 10:01 ` Roger Pau Monné
2020-01-30 13:25 ` Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 03/12] x86/smp: don't online cpu if hypervisor_ap_setup fails Wei Liu
2020-01-30 10:10 ` Roger Pau Monné
2020-01-31 13:53 ` Jan Beulich
2020-01-31 14:10 ` Wei Liu
2020-01-31 14:34 ` Jan Beulich
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 04/12] x86: make paddr_bits available earlier Wei Liu
2020-01-30 10:17 ` Roger Pau Monné [this message]
2020-01-30 12:00 ` Wei Liu
2020-01-31 13:57 ` Jan Beulich
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 05/12] x86: provide executable fixmap facility Wei Liu
2020-01-30 0:30 ` Wei Liu
2020-01-31 13:12 ` Wei Liu
2020-01-31 13:19 ` Jan Beulich
2020-01-31 13:20 ` Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 06/12] x86/hypervisor: provide hypervisor_reserve_top_pages Wei Liu
2020-01-30 10:32 ` Roger Pau Monné
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page Wei Liu
2020-01-30 9:57 ` Durrant, Paul
2020-01-30 11:19 ` Wei Liu
2020-01-30 10:41 ` Roger Pau Monné
2020-01-30 11:18 ` Wei Liu
2020-01-30 11:39 ` Roger Pau Monné
2020-01-30 11:47 ` Wei Liu
2020-01-30 12:11 ` Roger Pau Monné
2020-01-31 12:49 ` Wei Liu
2020-01-31 14:05 ` Jan Beulich
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions Wei Liu
2020-01-30 10:06 ` Durrant, Paul
2020-01-30 12:08 ` Roger Pau Monné
2020-01-30 12:28 ` Wei Liu
2020-01-30 12:32 ` Roger Pau Monné
2020-01-30 12:39 ` Wei Liu
2020-01-30 14:22 ` Roger Pau Monné
2020-01-30 14:25 ` Wei Liu
2020-01-30 14:47 ` Roger Pau Monné
2020-01-30 15:03 ` Wei Liu
2020-01-30 15:25 ` Roger Pau Monné
2020-01-30 16:02 ` Wei Liu
2020-01-31 14:12 ` Jan Beulich
2020-01-31 14:20 ` Wei Liu
2020-01-31 14:36 ` Jan Beulich
2020-01-31 14:24 ` Jan Beulich
2020-01-31 14:37 ` Wei Liu
2020-01-31 15:35 ` Jan Beulich
2020-01-31 16:15 ` Wei Liu
2020-01-31 16:18 ` Jan Beulich
2020-01-31 16:49 ` Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 09/12] DO NOT APPLY: x86/hyperv: issue an hypercall Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 10/12] x86/hyperv: provide percpu hypercall input page Wei Liu
2020-01-30 10:14 ` Durrant, Paul
2020-01-30 12:26 ` Roger Pau Monné
2020-01-30 14:09 ` Wei Liu
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 11/12] x86/hyperv: retrieve vp_index from Hyper-V Wei Liu
2020-01-31 14:27 ` Jan Beulich
2020-01-29 20:20 ` [Xen-devel] [PATCH v5 12/12] x86/hyperv: setup VP assist page Wei Liu
2020-01-30 10:34 ` Durrant, Paul
2020-01-30 14:00 ` Wei Liu
2020-01-30 12:42 ` Roger Pau Monné
2020-01-30 14:03 ` Wei Liu
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=20200130101733.GF4679@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=liuwe@microsoft.com \
--cc=mikelley@microsoft.com \
--cc=pdurrant@amazon.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.