Re: [PATCH 4/6] xen/pvh: bootup and setup related changes.

From: Stefano Stabellini
Date: Mon Oct 22 2012 - 09:35:15 EST


On Sat, 20 Oct 2012, Konrad Rzeszutek Wilk wrote:
> From: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
>
> In enlighten.c for PVH we can trap cpuid via vmexit, so don't
> need to use emulated prefix call. We also check for vector callback
> early on, as it is a required feature. PVH also runs at default kernel
> IOPL.
>
> In setup.c, in xen_add_extra_mem() we can skip updating P2M as it's managed
> by Xen. PVH maps the entire IO space, but only RAM pages need to be repopulated.
>
> Finally, pure PV settings are moved to a separate function that is only called
> for pure PV, ie, pv with pvmmu.
>
> Signed-off-by: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
>
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 8971a26..8cce47b 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -27,6 +27,7 @@
> #include <xen/interface/memory.h>
> #include <xen/interface/physdev.h>
> #include <xen/features.h>
> +#include "mmu.h"
> #include "xen-ops.h"
> #include "vdso.h"
>
> @@ -78,6 +79,9 @@ static void __init xen_add_extra_mem(u64 start, u64 size)
>
> memblock_reserve(start, size);
>
> + if (xen_feature(XENFEAT_auto_translated_physmap))
> + return;
> +
> xen_max_p2m_pfn = PFN_DOWN(start + size);
> for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) {
> unsigned long mfn = pfn_to_mfn(pfn);
> @@ -100,6 +104,7 @@ static unsigned long __init xen_do_chunk(unsigned long start,
> .domid = DOMID_SELF
> };
> unsigned long len = 0;
> + int xlated_phys = xen_feature(XENFEAT_auto_translated_physmap);
> unsigned long pfn;
> int ret;
>
> @@ -113,7 +118,7 @@ static unsigned long __init xen_do_chunk(unsigned long start,
> continue;
> frame = mfn;
> } else {
> - if (mfn != INVALID_P2M_ENTRY)
> + if (!xlated_phys && mfn != INVALID_P2M_ENTRY)
> continue;
> frame = pfn;
> }

Shouldn't we add a "!xlated_phys &&" to the other case as well?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/