All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: konrad@darnok.org, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] Boot PV guests with more than 128GB (v2) for 3.7
Date: Tue, 27 Aug 2013 16:34:30 -0400	[thread overview]
Message-ID: <20130827203430.GA16578@phenom.dumpdata.com> (raw)
In-Reply-To: <5028CEE70200007800094623@nat28.tlf.novell.com>

[-- Attachment #1: Type: text/plain, Size: 3766 bytes --]

On Mon, Aug 13, 2012 at 08:54:47AM +0100, Jan Beulich wrote:
> >>> On 03.08.12 at 16:46, Konrad Rzeszutek Wilk <konrad@darnok.org> wrote:
> > Didn't get to it yet. Sorry for top posting. If you have a patch ready I
> > can test it on Monday - travelling now.
> 
> So here's what I was thinking of (compile tested only).

Wow. It took me a whole year to get back to this.

Anyhow I did test it and it worked rather nicely for 64-bit guests. I didn't
even try to boot 32-bit guests as the pvops changes I did were only for 64-bit
guests. But if you have a specific kernel for a 32-bit guest I still have
the 1TB machine for a week and can boot it up there.


> 
> Jan
> 
> --- a/tools/libxc/xc_dom_x86.c
> +++ b/tools/libxc/xc_dom_x86.c
> @@ -241,7 +241,7 @@ static int setup_pgtables_x86_32_pae(str
>      l3_pgentry_64_t *l3tab;
>      l2_pgentry_64_t *l2tab = NULL;
>      l1_pgentry_64_t *l1tab = NULL;
> -    unsigned long l3off, l2off, l1off;
> +    unsigned long l3off, l2off = 0, l1off;
>      xen_vaddr_t addr;
>      xen_pfn_t pgpfn;
>      xen_pfn_t l3mfn = xc_dom_p2m_guest(dom, l3pfn);
> @@ -283,8 +283,6 @@ static int setup_pgtables_x86_32_pae(str
>              l2off = l2_table_offset_pae(addr);
>              l2tab[l2off] =
>                  pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
> -            if ( l2off == (L2_PAGETABLE_ENTRIES_PAE - 1) )
> -                l2tab = NULL;
>              l1pfn++;
>          }
>  
> @@ -296,8 +294,13 @@ static int setup_pgtables_x86_32_pae(str
>          if ( (addr >= dom->pgtables_seg.vstart) &&
>               (addr < dom->pgtables_seg.vend) )
>              l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
> +
>          if ( l1off == (L1_PAGETABLE_ENTRIES_PAE - 1) )
> +        {
>              l1tab = NULL;
> +            if ( l2off == (L2_PAGETABLE_ENTRIES_PAE - 1) )
> +                l2tab = NULL;
> +        }
>      }
>  
>      if ( dom->virt_pgtab_end <= 0xc0000000 )
> @@ -340,7 +343,7 @@ static int setup_pgtables_x86_64(struct 
>      l3_pgentry_64_t *l3tab = NULL;
>      l2_pgentry_64_t *l2tab = NULL;
>      l1_pgentry_64_t *l1tab = NULL;
> -    uint64_t l4off, l3off, l2off, l1off;
> +    uint64_t l4off, l3off = 0, l2off = 0, l1off;
>      uint64_t addr;
>      xen_pfn_t pgpfn;
>  
> @@ -364,8 +367,6 @@ static int setup_pgtables_x86_64(struct 
>              l3off = l3_table_offset_x86_64(addr);
>              l3tab[l3off] =
>                  pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
> -            if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
> -                l3tab = NULL;
>              l2pfn++;
>          }
>  
> @@ -376,8 +377,6 @@ static int setup_pgtables_x86_64(struct 
>              l2off = l2_table_offset_x86_64(addr);
>              l2tab[l2off] =
>                  pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
> -            if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
> -                l2tab = NULL;
>              l1pfn++;
>          }
>  
> @@ -389,8 +388,17 @@ static int setup_pgtables_x86_64(struct 
>          if ( (addr >= dom->pgtables_seg.vstart) && 
>               (addr < dom->pgtables_seg.vend) )
>              l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
> +
>          if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
> +        {
>              l1tab = NULL;
> +            if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
> +            {
> +                l2tab = NULL;
> +                if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
> +                    l3tab = NULL;
> +            }
> +        }
>      }
>      return 0;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

[-- Attachment #2: debug.patch --]
[-- Type: text/plain, Size: 4502 bytes --]

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 86e23ee..ebc77ac 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -136,6 +136,7 @@ struct xc_dom_image {
     int8_t vhpt_size_log2; /* for IA64 */
     int8_t superpages;
     int claim_enabled; /* 0 by default, 1 enables it */
+    int fix;
     int shadow_enabled;
 
     int xen_version;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 126c0f8..57291ab 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -360,13 +360,14 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
     l3_pgentry_64_t *l3tab = NULL;
     l2_pgentry_64_t *l2tab = NULL;
     l1_pgentry_64_t *l1tab = NULL;
-    uint64_t l4off, l3off, l2off, l1off;
+    uint64_t l4off = 0, l3off = 0, l2off = 0, l1off = 0;
     uint64_t addr;
     xen_pfn_t pgpfn;
 
     if ( l4tab == NULL )
         goto pfn_error;
-
+    
+    DOMPRINTF("%s: fix %s", __FUNCTION__, dom->fix ? "enabled" : "disabled");
     for ( addr = dom->parms.virt_base; addr < dom->virt_pgtab_end;
           addr += PAGE_SIZE_X86 )
     {
@@ -391,8 +392,10 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
             l3off = l3_table_offset_x86_64(addr);
             l3tab[l3off] =
                 pfn_to_paddr(xc_dom_p2m_guest(dom, l2pfn)) | L3_PROT;
-            if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
-                l3tab = NULL;
+	    if (!dom->fix) {
+                if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
+                	l3tab = NULL;
+	    }
             l2pfn++;
         }
 
@@ -405,8 +408,10 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
             l2off = l2_table_offset_x86_64(addr);
             l2tab[l2off] =
                 pfn_to_paddr(xc_dom_p2m_guest(dom, l1pfn)) | L2_PROT;
-            if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
-                l2tab = NULL;
+            if (!dom->fix) {
+            	if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
+                	l2tab = NULL;
+	    }
             l1pfn++;
         }
 
@@ -418,8 +423,17 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
         if ( (addr >= dom->pgtables_seg.vstart) && 
              (addr < dom->pgtables_seg.vend) )
             l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
-        if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
-            l1tab = NULL;
+
+	if (dom->fix) {
+		if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) ) {
+		    l1tab = NULL;
+		    if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) ) {
+			l2tab = NULL;
+			if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
+				l3tab = NULL;
+		    }
+		}
+	}
     }
     return 0;
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6e2252a..8ec8bab 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -375,6 +375,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
     dom->claim_enabled = libxl_defbool_val(info->claim_mode);
+    dom->fix = libxl_defbool_val(info->u.pv.fix);
 
     if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
         LOGE(ERROR, "xc_dom_boot_xen_init failed");
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 85341a0..fdda8a9 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -347,6 +347,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),
+                                      ("fix", libxl_defbool),
                                       ])),
                  ("invalid", Struct(None, [])),
                  ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 884f050..834ff74 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1279,7 +1279,8 @@ skip_vfb:
 
     if (!xlu_cfg_get_long (config, "pci_permissive", &l, 0))
         pci_permissive = l;
-
+ 
+    xlu_cfg_get_defbool(config, "fix", &b_info->u.pv.fix, 0);
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV) {

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-08-27 20:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 14:43 [PATCH] Boot PV guests with more than 128GB (v2) for 3.7 Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 1/6] xen/mmu: use copy_page instead of memcpy Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 2/6] xen/mmu: For 64-bit do not call xen_map_identity_early Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 3/6] xen/mmu: Recycle the Xen provided L4, L3, and L2 pages Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 4/6] xen/p2m: Add logic to revector a P2M tree to use __va leafs Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 5/6] xen/mmu: Copy and revector the P2M tree Konrad Rzeszutek Wilk
2012-07-31 14:43 ` [PATCH 6/6] xen/mmu: Remove from __ka space PMD entries for pagetables Konrad Rzeszutek Wilk
2012-08-01 15:50 ` [PATCH] Boot PV guests with more than 128GB (v2) for 3.7 Konrad Rzeszutek Wilk
2012-08-02  9:05   ` Jan Beulich
2012-08-02 14:17     ` Konrad Rzeszutek Wilk
2012-08-02 23:04       ` Mukesh Rathor
2012-08-03 13:30         ` Konrad Rzeszutek Wilk
2012-08-03 13:54           ` Jan Beulich
     [not found]             ` <CAPbh3rsXaqQS9WQQmJ2uQ46LZdyFzkbSodUabGDAyFS+qTEwUg@mail.gmail.com>
2012-08-13  7:54               ` Jan Beulich
2012-09-03  6:33                 ` Ping: " Jan Beulich
2012-09-06 21:03                   ` Konrad Rzeszutek Wilk
2012-09-07  9:01                     ` Jan Beulich
2012-09-07 13:39                       ` Konrad Rzeszutek Wilk
2012-09-07 14:09                         ` Jan Beulich
2012-09-07 14:11                           ` Konrad Rzeszutek Wilk
2013-08-27 20:34                 ` Konrad Rzeszutek Wilk [this message]
2013-08-28  7:55                   ` Jan Beulich
2013-08-28 14:44                     ` Konrad Rzeszutek Wilk
2013-08-28 14:58                       ` [PATCH] libxc/x86: fix page table creation for huge guests Jan Beulich
2013-09-09  8:37                         ` Ping: " Jan Beulich
2013-09-12 15:38                           ` Ian Jackson
2012-08-03 18:37           ` [PATCH] Boot PV guests with more than 128GB (v2) for 3.7 Mukesh Rathor

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=20130827203430.GA16578@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=konrad@darnok.org \
    --cc=xen-devel@lists.xen.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.