Re: [XenPPC] One more fix for the forward port

2007-07-05 Thread Hollis Blanchard
On Thu, 2007-07-05 at 13:07 -0500, Hollis Blanchard wrote:

> Hi Christian, as far as I can see the vast majority of this patch is
> not needed; the only part that's required is
> phys_to_machine_mapping_valid(). 

I take it back. Not sure how I wasn't seeing this before...

-- 
Hollis Blanchard
IBM Linux Technology Center


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


Re: [XenPPC] One more fix for the forward port

2007-07-05 Thread Hollis Blanchard
On Thu, 2007-06-21 at 15:53 +0200, Christian Ehrhardt wrote:
> diff -r 1bf85f927393 include/asm-powerpc/io.h
> --- a/include/asm-powerpc/io.h  Thu Jun 21 08:04:49 2007 +0200
> +++ b/include/asm-powerpc/io.h  Thu Jun 21 10:31:39 2007 +0200
> @@ -248,11 +248,13 @@ static inline void * phys_to_virt(unsign
>  {
> return (void *)__va(address);
>  }
> +#define bus_to_virt phys_to_virt
> 
>  /*
>   * Change "struct page" to physical address.
>   */
>  #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
> +#define page_to_bus page_to_phys
> 
>  /* We do NOT want virtual merging, it would put too much pressure on
>   * our iommu allocator. Instead, we want drivers to be smart enough
> diff -r 1bf85f927393 include/asm-powerpc/xen/asm/hypercall.h
> --- a/include/asm-powerpc/xen/asm/hypercall.h   Thu Jun 21 08:04:49 2007 +0200
> +++ b/include/asm-powerpc/xen/asm/hypercall.h   Thu Jun 21 09:56:55 2007 +0200
> @@ -72,6 +72,9 @@ static inline unsigned long HYPERVISOR_h
> return -ENOSYS;
>  }
> 
> +/* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */
> +#define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;})
> +
>  struct privcmd_hypercall;
>  extern int privcmd_hypercall(struct privcmd_hypercall *hypercall);
> 
> diff -r 1bf85f927393 include/asm-powerpc/xen/asm/hypervisor.h
> --- a/include/asm-powerpc/xen/asm/hypervisor.h  Thu Jun 21 08:04:49 2007 +0200
> +++ b/include/asm-powerpc/xen/asm/hypervisor.h  Thu Jun 21 08:26:48 2007 +0200
> @@ -131,6 +131,7 @@ int direct_remap_pfn_range(struct vm_are
>  #definepfn_to_mfn(x)   (x)
>  #definemfn_to_pfn(x)   (x)
>  #define phys_to_machine(phys) ((maddr_t)(phys))
> +#define phys_to_machine_mapping_valid(pfn) (1)
> 
>  /* VIRT <-> MACHINE conversion */
>  #define virt_to_machine(v) (phys_to_machine(__pa(v)))
> @@ -239,6 +240,7 @@ static inline void set_phys_to_machine(u
>  #define pfn_pte_ma(pfn, prot)  __pte(((pfn) << PAGE_SHIFT) | 
> pgprot_val(prot))
> 
>  typedef unsigned long maddr_t;
> +typedef unsigned long paddr_t;
> 
>  #ifdef CONFIG_XEN_SCRUB_PAGES 

Hi Christian, as far as I can see the vast majority of this patch is not
needed; the only part that's required is
phys_to_machine_mapping_valid().

Also, I can't find any changeset with the hash 1bf85f927393 . Maybe that
was a local MQ changeset?

-- 
Hollis Blanchard
IBM Linux Technology Center


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


Re: [XenPPC] One more fix for the forward port

2007-06-21 Thread Christian Ehrhardt
Additionally to my last mail following "updates_to_1bf85f927393" patch 
is needed to be compatible to the source of 
http://xenbits.xensource.com/linux-2.6.18-xen.hg  as it is today (our 
forward port base is now ~3.5 weeks old). I made this patch quickly and 
would be happy if someone would take a short review (I'm not very 
experienced in powerpc dma implementations and that's where the patch 
takes place).


Everyone who wants to play with our patchset before we commit it will 
also need some xen changes. I stripped all the debug code from our 
latest changes and made a patch that will just enable the needed 
functionality - it' called xen_powerpc_2.6.18.diff




Hollis Blanchard wrote:

On Tue, 2007-06-19 at 13:49 +0200, Christian Ehrhardt wrote:
  

The DomU now boots without visible issues, but at least on my system
networking in DomU does not yet work - the DomU tihnk its working, but
I can't get a connection from/to Dom0.
@Hollis - currently you are the only one except me who has an
up-to-date forward port patch queue - could you please verify if this
is only an issue of my local setup by applying all my latest patches
and see what works in your environment. 



Networking seems to be OK here. I'm using a very stripped down disk
image for domU (actually I'm using
http://xm-test.xensource.com/ramdisks/initrd-1.1-powerpc.img), so I
haven't tested it heavily, but I can manually assign an unused IP
address and ping both into and out of the domU. My domain profile
contains "vif = [ '' ]", and so xend automatically creates a vif and
bridges it to the physical network.

I'm attaching the full MQ patch series to this mail. To use it, clone
http://xenbits.xensource.com/linux-2.6.18-xen.hg , extract the tarball
inside that directory (it creates .hg/patches), and hg qpush -a. If
you're not already an MQ user, see
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension or just
patch by hand.

I haven't figured out how to effectively share this queue, but since I
think it's pretty much done at this point, we'll be able to commit and
send upstream soon (but I will be traveling until July, so not too
soon).

  


--

Grüsse / regards, 
Christian Ehrhardt


IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
[EMAIL PROTECTED]
[EMAIL PROTECTED]

IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen 
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen

Registergericht: Amtsgericht Stuttgart, HRB 243294

diff -r 1bf85f927393 include/asm-powerpc/io.h
--- a/include/asm-powerpc/io.h  Thu Jun 21 08:04:49 2007 +0200
+++ b/include/asm-powerpc/io.h  Thu Jun 21 10:31:39 2007 +0200
@@ -248,11 +248,13 @@ static inline void * phys_to_virt(unsign
 {
return (void *)__va(address);
 }
+#define bus_to_virt phys_to_virt
 
 /*
  * Change "struct page" to physical address.
  */
 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
+#define page_to_bus page_to_phys
 
 /* We do NOT want virtual merging, it would put too much pressure on
  * our iommu allocator. Instead, we want drivers to be smart enough
diff -r 1bf85f927393 include/asm-powerpc/xen/asm/hypercall.h
--- a/include/asm-powerpc/xen/asm/hypercall.h   Thu Jun 21 08:04:49 2007 +0200
+++ b/include/asm-powerpc/xen/asm/hypercall.h   Thu Jun 21 09:56:55 2007 +0200
@@ -72,6 +72,9 @@ static inline unsigned long HYPERVISOR_h
return -ENOSYS;
 }
 
+/* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */
+#define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;})
+
 struct privcmd_hypercall;
 extern int privcmd_hypercall(struct privcmd_hypercall *hypercall);
 
diff -r 1bf85f927393 include/asm-powerpc/xen/asm/hypervisor.h
--- a/include/asm-powerpc/xen/asm/hypervisor.h  Thu Jun 21 08:04:49 2007 +0200
+++ b/include/asm-powerpc/xen/asm/hypervisor.h  Thu Jun 21 08:26:48 2007 +0200
@@ -131,6 +131,7 @@ int direct_remap_pfn_range(struct vm_are
 #definepfn_to_mfn(x)   (x)
 #definemfn_to_pfn(x)   (x)
 #define phys_to_machine(phys) ((maddr_t)(phys))
+#define phys_to_machine_mapping_valid(pfn) (1)
 
 /* VIRT <-> MACHINE conversion */
 #define virt_to_machine(v) (phys_to_machine(__pa(v)))
@@ -239,6 +240,7 @@ static inline void set_phys_to_machine(u
 #define pfn_pte_ma(pfn, prot)  __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
 typedef unsigned long maddr_t;
+typedef unsigned long paddr_t;
 
 #ifdef CONFIG_XEN_SCRUB_PAGES
 
diff -r 005dd6b1cf8e xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c	Wed Jun 20 15:33:14 2007 +0100
+++ b/xen/arch/powerpc/domain.c	Thu Jun 21 10:57:02 2007 +0200
@@ -88,7 +88,7 @@ int arch_domain_create(struct domain *d)
 d->arch.large_page_sizes = cpu_large_page_orders(
 d->arch.large_page_order, ARRAY_SIZE(d->arch.large_page_order));
 
-d->arch.foreign_mfn_count = 1024;
+d->arch.foreign_mfn_count = 2048;
 d->arch.foreign_mfns = xmalloc_array(uint, d->arch.foreign_mfn_count);
 BUG_ON(d->arch.foreign

Re: [XenPPC] One more fix for the forward port

2007-06-20 Thread Christian Ehrhardt

Hollis Blanchard wrote:

On Tue, 2007-06-19 at 13:49 +0200, Christian Ehrhardt wrote:
  

The DomU now boots without visible issues, but at least on my system
networking in DomU does not yet work - the DomU tihnk its working, but
I can't get a connection from/to Dom0.
@Hollis - currently you are the only one except me who has an
up-to-date forward port patch queue - could you please verify if this
is only an issue of my local setup by applying all my latest patches
and see what works in your environment. 



Networking seems to be OK here. I'm using a very stripped down disk
image for domU (actually I'm using
http://xm-test.xensource.com/ramdisks/initrd-1.1-powerpc.img), so I
haven't tested it heavily, but I can manually assign an unused IP
address and ping both into and out of the domU. My domain profile
contains "vif = [ '' ]", and so xend automatically creates a vif and
bridges it to the physical network.

I'm attaching the full MQ patch series to this mail. To use it, clone
http://xenbits.xensource.com/linux-2.6.18-xen.hg , extract the tarball
inside that directory (it creates .hg/patches), and hg qpush -a. If
you're not already an MQ user, see
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension or just
patch by hand.

I haven't figured out how to effectively share this queue, but since I
think it's pretty much done at this point, we'll be able to commit and
send upstream soon (but I will be traveling until July, so not too
soon).

  
I was currently applying the latest patch queue to a current 
xen-unstable+make prep-kernels (which hg clones 
http://xenbits.xensource.com/linux-2.6.18-xen.hg).
I saw that the patch autotranslate-mmap.diff does not apply. The patch 
removes a not needed autotranslate check. But in the code coming 
currently from http://xenbits.xensource.com/linux-2.6.18-xen.hg is a 
"idndef __powerpw__" around there which a) would do the job and b) lets 
the patch not match.
Your patchnote says that this does not apply to other architectures and 
I support every approach to reduce ifdefs ;-)
Because of that I updated the autotranslate-mmap.diff and attached it 
here for you inclusion in our patchqueue for 2.6.18.
Additionally this mentioning to that sub-patch gives everyone the chance 
to comment the "does not affect other architectures" statement - 
therefor I add xen-devel here too.


--

Grüsse / regards, 
Christian Ehrhardt


IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
[EMAIL PROTECTED]
[EMAIL PROTECTED]

IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen 
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen

Registergericht: Amtsgericht Stuttgart, HRB 243294

[XEN][LINUX] Remove autotranslate check from privcmd_mmap().
PowerPC dom0 is autotranslated and needs to be able to map domU memory.
x86 doesn't use privileged autotranslated domains, and IA64 has their own
privcmd_mmap(), so this doesn't affect them.
Signed-off-by: Hollis Blanchard <[EMAIL PROTECTED]>

diff -r 50220a1b2aaf drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c	Thu Jun 21 07:49:49 2007 +0200
+++ b/drivers/xen/privcmd/privcmd.c	Thu Jun 21 07:52:35 2007 +0200
@@ -229,12 +229,6 @@ static struct vm_operations_struct privc
 
 static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
 {
-#ifndef __powerpc__ /* PowerPC has a trick to safely do this. */
-	/* Unsupported for auto-translate guests. */
-	if (xen_feature(XENFEAT_auto_translated_physmap))
-		return -ENOSYS;
-#endif
-
 	/* DONTCOPY is essential for Xen as copy_page_range is broken. */
 	vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY;
 	vma->vm_ops = &privcmd_vm_ops;
___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

Re: [XenPPC] One more fix for the forward port

2007-06-19 Thread Hollis Blanchard
On Tue, 2007-06-19 at 13:49 +0200, Christian Ehrhardt wrote:
> 
> The DomU now boots without visible issues, but at least on my system
> networking in DomU does not yet work - the DomU tihnk its working, but
> I can't get a connection from/to Dom0.
> @Hollis - currently you are the only one except me who has an
> up-to-date forward port patch queue - could you please verify if this
> is only an issue of my local setup by applying all my latest patches
> and see what works in your environment. 

Networking seems to be OK here. I'm using a very stripped down disk
image for domU (actually I'm using
http://xm-test.xensource.com/ramdisks/initrd-1.1-powerpc.img), so I
haven't tested it heavily, but I can manually assign an unused IP
address and ping both into and out of the domU. My domain profile
contains "vif = [ '' ]", and so xend automatically creates a vif and
bridges it to the physical network.

I'm attaching the full MQ patch series to this mail. To use it, clone
http://xenbits.xensource.com/linux-2.6.18-xen.hg , extract the tarball
inside that directory (it creates .hg/patches), and hg qpush -a. If
you're not already an MQ user, see
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension or just
patch by hand.

I haven't figured out how to effectively share this queue, but since I
think it's pretty much done at this point, we'll be able to commit and
send upstream soon (but I will be traveling until July, so not too
soon).

-- 
Hollis Blanchard
IBM Linux Technology Center


patches.tgz
Description: application/compressed-tar
___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

[XenPPC] One more fix for the forward port

2007-06-19 Thread Christian Ehrhardt

Hi,
the following is a fix for powerpc page.h to be compliant to a 
i386&x86_64 xen change made in rev. 13546 and before. In our current 
task to port our ppc tree to the current 2.6.18 base this is just one 
more fix we need. It removed issues with "Bad Page State". A similar 
solution for ia64 was already done in 13868.


The DomU now boots without visible issues, but at least on my system 
networking in DomU does not yet work - the DomU tihnk its working, but I 
can't get a connection from/to Dom0.
@Hollis - currently you are the only one except me who has an up-to-date 
forward port patch queue - could you please verify if this is only an 
issue of my local setup by applying all my latest patches and see what 
works in your environment.


Background FYI - the issue looked like that (while booting a DomU with 
network):

[  305.530492] Bad page state in process 'swapper'
[  305.530493] page:c3d13400 flags:0x004000100400 
mapping: mapcount:1 count:0


--

Grüsse / regards, 
Christian Ehrhardt


IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
[EMAIL PROTECTED]
[EMAIL PROTECTED]

IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen 
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen

Registergericht: Amtsgericht Stuttgart, HRB 243294

diff -r 3b79cfce include/asm-powerpc/page.h
--- a/include/asm-powerpc/page.h	Tue Jun 19 06:15:10 2007 +0200
+++ b/include/asm-powerpc/page.h	Tue Jun 19 06:46:39 2007 +0200
@@ -194,6 +194,15 @@ struct vm_area_struct;
 struct vm_area_struct;
 extern const char *arch_vma_name(struct vm_area_struct *vma);
 
+#define arch_free_page(_page, _order)   \
+({  \
+	int foreign = PageForeign(_page);   \
+	if (foreign) \
+		PageForeignDestructor(_page);   \
+	foreign; \
+})
+#define HAVE_ARCH_FREE_PAGE
+
 #include 
 #endif /* __ASSEMBLY__ */
 
___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel