Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Richard Weinberger
Am 09.09.2012 14:15, schrieb Peter Hüwe:
 Am Sonntag, 9. September 2012, 13:28:38 schrieb Jean Delvare:
 Thanks for the info. I thought UML was no longer used with all the
 virtualization solutions available, but apparently I was wrong.
 I guess it's mainly used for sandboxing, testing and development ;)

It's mostly used where KVM does not work.
For example low end i586 servers in schools.
Using UML you can still run 10+ instances on a P3 with 512MiB ram.

 
 My bet is that all I2C bus drivers do use I/O or memory mapped
 operations directly or indirectly, except i2c-stub. So it would
 probably make more sense, and be a less intrusive change, to move the
 HAS_IOMEM dependency to drivers/i2c/busses, and move (logically or for
 real) i2c-stub out of it.

 Or are there really other I2C bus drivers which make sense to enable
 under UML?
 The only other available in UML which doesn't rely on HAS_IOMEM is the 
 PARPORT_LIGHT which relies on direct io access - so I guess this one doesn't 
 make sense either.
 
 I created a patch for your proposed solution, I moved the stub driver to the 
 end in order to have only one big if HAS_IOMEM.

UML does not have IO_MEM but some sub-systems have depend HAS_IOMEM which is
often too coarse grained.
To deal with that I've introduced GENERIC_IO some time ago to support MTD (and 
nandsim)
on UML.
Maybe some parts of the I2C sub-system can also just depend on GENERIC_IO 
instead of
HAS_IOMEM.
An arch has GENERIC_IO=y if it supports everything defined in generic-asm/io.h 
which is
more than enough for most stub drivers.

Please look at this patch series:
https://lkml.org/lkml/2012/2/6/489

I'm sure it will help you in bringing I2C to UML.

Thanks,
//richard



signature.asc
Description: OpenPGP digital signature
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Jean Delvare
Hi all,

Thanks for the info. I thought UML was no longer used with all the
virtualization solutions available, but apparently I was wrong.

On Sun, 9 Sep 2012 12:49:03 +0200, Peter Hüwe wrote:
  That's because they rely on the HAS_IOMEM dependency for the whole
  subsystem. In fact, I'm surprised you didn't have to add HAS_IOMEM
  dependencies to more drivers.
 I changed only the ones which are available in UML.
 I now rewrote the patch to remove the global dependency and move it to all 
 the 
 drivers that really rely on HAS_IOMEM - see below.

My bet is that all I2C bus drivers do use I/O or memory mapped
operations directly or indirectly, except i2c-stub. So it would
probably make more sense, and be a less intrusive change, to move the
HAS_IOMEM dependency to drivers/i2c/busses, and move (logically or for
real) i2c-stub out of it.

Or are there really other I2C bus drivers which make sense to enable
under UML?

Are there other subsystems where the HAS_IOMEM dependency is at the
individual driver level?

-- 
Jean Delvare

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Peter Hüwe
Am Sonntag, 9. September 2012, 14:23:06 schrieb Richard Weinberger: 
 UML does not have IO_MEM but some sub-systems have depend HAS_IOMEM which
 is often too coarse grained.
 To deal with that I've introduced GENERIC_IO some time ago to support MTD
 (and nandsim) on UML.
 Maybe some parts of the I2C sub-system can also just depend on GENERIC_IO
 instead of HAS_IOMEM.
 An arch has GENERIC_IO=y if it supports everything defined in
 generic-asm/io.h which is more than enough for most stub drivers.

The only thing which seems to be missing on UML is the ioremap function family 
;/


Peter


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Peter Hüwe
  Maybe some parts of the I2C sub-system can also just depend on
  GENERIC_IO instead of HAS_IOMEM.
  An arch has GENERIC_IO=y if it supports everything defined in
  generic-asm/io.h which is more than enough for most stub drivers.
  
  The only thing which seems to be missing on UML is the ioremap function
  family ;/
 
 Why do you need ioremap() in a stub driver?
 This sounds strange.


This was a misunderstanding - the main part of the I2C subsystem doesn't 
depend at all on HAS_IOMEM, only the main part of the i2c/busses section.
And almost all of those drivers use ioremap.

For my stub driver I don't need any of that, I'd be fine with the move of 
HAS_IOMEM as proposed by Jean.


Peter

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Richard Weinberger
Am 09.09.2012 15:11, schrieb Peter Hüwe:
 Maybe some parts of the I2C sub-system can also just depend on
 GENERIC_IO instead of HAS_IOMEM.
 An arch has GENERIC_IO=y if it supports everything defined in
 generic-asm/io.h which is more than enough for most stub drivers.

 The only thing which seems to be missing on UML is the ioremap function
 family ;/

 Why do you need ioremap() in a stub driver?
 This sounds strange.
 
 
 This was a misunderstanding - the main part of the I2C subsystem doesn't 
 depend at all on HAS_IOMEM, only the main part of the i2c/busses section.
 And almost all of those drivers use ioremap.

Sure. They need real hardware. :-)

 For my stub driver I don't need any of that, I'd be fine with the move of 
 HAS_IOMEM as proposed by Jean.

IMHO you should replace the HAS_IOMEM with GENERIC_IO.
Otherwise you may break the build on s390.

Thanks,
//richard



signature.asc
Description: OpenPGP digital signature
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Geert Uytterhoeven
On Sun, Sep 9, 2012 at 3:27 PM, Richard Weinberger rich...@nod.at wrote:
 For my stub driver I don't need any of that, I'd be fine with the move of
 HAS_IOMEM as proposed by Jean.

 IMHO you should replace the HAS_IOMEM with GENERIC_IO.
 Otherwise you may break the build on s390.

s390 has neither of HAS_IOMEM and GENERIC_IO, so it won't break their
build.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say programmer or something like that.
-- Linus Torvalds

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Richard Weinberger


Geert Uytterhoeven ge...@linux-m68k.org schrieb:

On Sun, Sep 9, 2012 at 3:27 PM, Richard Weinberger rich...@nod.at
wrote:
 For my stub driver I don't need any of that, I'd be fine with the
move of
 HAS_IOMEM as proposed by Jean.

 IMHO you should replace the HAS_IOMEM with GENERIC_IO.
 Otherwise you may break the build on s390.

s390 has neither of HAS_IOMEM and GENERIC_IO, so it won't break their
build.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
ge...@linux-m68k.org

In personal conversations with technical people, I call myself a
hacker. But
when I'm talking to journalists I just say programmer or something
like that.
-- Linus Torvalds

That's why it may break. If you remove the depends on HAS_IOMEM, it will be 
built on s390 and fail if that codes uses io memory functions. Depending on 
GENERIC_IO fixes that.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH/RFC] um: Preinclude include/linux/kern_levels.h

2012-09-09 Thread Joe Perches
On Sun, 2012-09-09 at 10:33 +0200, Geert Uytterhoeven wrote:
 Ping?

Richard?  Are you going to pick up this patch?
It seems sensible.

Geert, I suggest sending it directly to Linus as a fix
if Richard doesn't respond in a few days.

 On Thu, Aug 16, 2012 at 8:15 PM, Geert Uytterhoeven
 ge...@linux-m68k.org wrote:
  The userspace part of UML uses the asm-offsets.h generator mechanism to
  create definitions for UM_KERN_LEVEL that match the in-kernel
  KERN_LEVEL constant definitions.
 
  As of commit 04d2c8c83d0e3ac5f78aeede51babb3236200112 (printk: convert
  the format for KERN_LEVEL to a 2 byte pattern), KERN_LEVEL is no
  longer expanded to the literal 'LEVEL', but to '\001 LEVEL', i.e.
  it contains two parts.
 
  However, the combo of DEFINE_STR() in
  arch/x86/um/shared/sysdep/kernel-offsets.h and sed-y in Kbuild doesn't
  support string literals consisting of multiple parts. Hence for all
  UM_KERN_LEVEL definitions, only the SOH character is retained in the 
  actual
  definition, while the remainder ends up in the comment. E.g. in
  include/generated/asm-offsets.h we get
 
  #define UM_KERN_INFO \001 /* 6 KERN_INFO */
 
  instead of
 
  #define UM_KERN_INFO \001 6 /* KERN_INFO */
 
  This causes spurious '^A' output in some kernel messages:



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Jean Delvare
On Sun, 09 Sep 2012 17:00:54 +0200, Richard Weinberger wrote:
 Geert Uytterhoeven ge...@linux-m68k.org schrieb:
 s390 has neither of HAS_IOMEM and GENERIC_IO, so it won't break their
 build.

 That's why it may break. If you remove the depends on HAS_IOMEM, it will be 
 built on s390 and fail if that codes uses io memory functions. Depending on 
 GENERIC_IO fixes that.

Where that is a problem which may not exist in the first place.

-- 
Jean Delvare

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH/RFC] um: Preinclude include/linux/kern_levels.h

2012-09-09 Thread Richard Weinberger
Am 09.09.2012 17:09, schrieb Joe Perches:
 On Sun, 2012-09-09 at 10:33 +0200, Geert Uytterhoeven wrote:
 Ping?
 
 Richard?  Are you going to pick up this patch?
 It seems sensible.
 
 Geert, I suggest sending it directly to Linus as a fix
 if Richard doesn't respond in a few days.

I'll pick up.
I'm still on vacation and therefore a bit slow. :)

Thanks,
//richard



signature.asc
Description: OpenPGP digital signature
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Emulate I2C subsystem/slaves

2012-09-09 Thread Peter Hüwe
 That's why it may break. If you remove the depends on HAS_IOMEM, it will be
 built on s390 and fail if that codes uses io memory functions. Depending
 on GENERIC_IO fixes that.

Everything I can select in I2C subsystem compiles fine on s390.
(using defconfig + menuconfig).
Just compiled it.

Thanks,
Peter


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel