Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-08 Thread Romer, Benjamin M
On Tue, 2014-04-08 at 10:53 +0800, Fengguang Wu wrote:
> Hi Benjamin,
> 
> > Fengguang,
> > 
> > I ran your script against freshly-checked-out source from staging-next, and 
> > was not able to reproduce the error with it. My boot log is attached. I 
> > noticed that your log did not have "Hypervisor detected: KVM" in the trace. 
> > The KVM options in your script also differ substantially from the ones 
> > shown at the end of your trace...
>  
> > When I reran your script with the "-cpu Haswell,+smep,+smap" option I was 
> > able to get the same result as you. IMHO KVM should not be setting this bit 
> > if it's emulating bare metal.
> 
> Sorry.. We tried to provide a simplified reproduce script and in your
> case, it has a significant mismatch with the real KVM options. We'll
> fix it, thanks for pointing it out!
> 
> Thanks,
> Fengguang

That will be helpful, and as I mentioned, I can reproduce your results,
but I'm still not sure why a virtualized processor is giving an invalid
opcode fault on a vmcall. The Intel documentation is pretty specific
about this - IF not in VMX operation THEN #UD; ELSIF in VMX non-root
operation THEN VM exit.

Either KVM should be saying "I'm a real processor and not a virtual CPU,
really!" - in which case, the hypervisor bit should be off and vmcalls
should cause an invalid opcode fault, or, KVM should be saying "I'm a
vritualized processor!" and setting the hypervisor bit, and doing a
vmexit on vmcall instead. This seems like a KVM bug to me.

-- Ben
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Fengguang Wu
Hi Benjamin,

> Fengguang,
> 
> I ran your script against freshly-checked-out source from staging-next, and 
> was not able to reproduce the error with it. My boot log is attached. I 
> noticed that your log did not have "Hypervisor detected: KVM" in the trace. 
> The KVM options in your script also differ substantially from the ones shown 
> at the end of your trace...
 
> When I reran your script with the "-cpu Haswell,+smep,+smap" option I was 
> able to get the same result as you. IMHO KVM should not be setting this bit 
> if it's emulating bare metal.

Sorry.. We tried to provide a simplified reproduce script and in your
case, it has a significant mismatch with the real KVM options. We'll
fix it, thanks for pointing it out!

Thanks,
Fengguang
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Greg Kroah-Hartman
On Mon, Apr 07, 2014 at 12:23:47PM -0700, Greg Kroah-Hartman wrote:
> On Mon, Apr 07, 2014 at 09:24:37AM -0500, Ken Cox wrote:
> > 
> > On 04/07/2014 09:09 AM, Greg Kroah-Hartman wrote:
> > >On Mon, Apr 07, 2014 at 07:17:25PM +0800, Fengguang Wu wrote:
> > >>Hi Ken,
> > >>
> > >>I got the below dmesg and the first bad commit is
> > >>
> > >>git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > >>
> > >>commit 12e364b9f08aa335dc7716ce74113e834c993765
> > >>Author: Ken Cox 
> > >>AuthorDate: Tue Mar 4 07:58:07 2014 -0600
> > >>Commit: Greg Kroah-Hartman 
> > >>CommitDate: Tue Mar 4 16:58:21 2014 -0800
> > >>
> > >> staging: visorchipset driver to provide registration and other 
> > >> services
> > >I think Sasha has already sent a fix to resolve this issue that I'll be
> > >sending to Linus in a day or so.
> > >
> > >Ken, is Sasha's patch going to resolve this issue as well?  It looks
> > >like people haven't tested what happens when the module is loaded
> > >without the hardware present in the system :(
> > You are exactly right.  The driver needs to check for hardware early on
> > before trying to use it.  Unfortunately, Sasha's patch will not resolve this
> > one.  I'll work with Ben Romer to get a patch out ASAP.
> 
> Wait, in looking at this closer, I don't see any of the "normal"
> hardware checks to determine that this really is a valid piece of
> hardware present, before it starts to just go and initialize a whole
> bunch of things (sysfs busses, proc files and directories, and other
> things.)
> 
> That's not ok, and it's obvious it's starting to affect people's work
> systems.
> 
> How about I just mark the whole thing BROKEN for now, disabling the
> build, until "correct" hardware probing can be added to the driver, so
> no one else gets hurt by this?

In looking at it further, that seems like the best thing to do for now,
we can slowly enable the driver back after things like proper device
probing is fixed up so as to not break people's boxes.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Greg Kroah-Hartman
On Mon, Apr 07, 2014 at 09:24:37AM -0500, Ken Cox wrote:
> 
> On 04/07/2014 09:09 AM, Greg Kroah-Hartman wrote:
> >On Mon, Apr 07, 2014 at 07:17:25PM +0800, Fengguang Wu wrote:
> >>Hi Ken,
> >>
> >>I got the below dmesg and the first bad commit is
> >>
> >>git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >>
> >>commit 12e364b9f08aa335dc7716ce74113e834c993765
> >>Author: Ken Cox 
> >>AuthorDate: Tue Mar 4 07:58:07 2014 -0600
> >>Commit: Greg Kroah-Hartman 
> >>CommitDate: Tue Mar 4 16:58:21 2014 -0800
> >>
> >> staging: visorchipset driver to provide registration and other services
> >I think Sasha has already sent a fix to resolve this issue that I'll be
> >sending to Linus in a day or so.
> >
> >Ken, is Sasha's patch going to resolve this issue as well?  It looks
> >like people haven't tested what happens when the module is loaded
> >without the hardware present in the system :(
> You are exactly right.  The driver needs to check for hardware early on
> before trying to use it.  Unfortunately, Sasha's patch will not resolve this
> one.  I'll work with Ben Romer to get a patch out ASAP.

Wait, in looking at this closer, I don't see any of the "normal"
hardware checks to determine that this really is a valid piece of
hardware present, before it starts to just go and initialize a whole
bunch of things (sysfs busses, proc files and directories, and other
things.)

That's not ok, and it's obvious it's starting to affect people's work
systems.

How about I just mark the whole thing BROKEN for now, disabling the
build, until "correct" hardware probing can be added to the driver, so
no one else gets hurt by this?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Ken Cox


On 04/07/2014 09:09 AM, Greg Kroah-Hartman wrote:

On Mon, Apr 07, 2014 at 07:17:25PM +0800, Fengguang Wu wrote:

Hi Ken,

I got the below dmesg and the first bad commit is

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

commit 12e364b9f08aa335dc7716ce74113e834c993765
Author: Ken Cox 
AuthorDate: Tue Mar 4 07:58:07 2014 -0600
Commit: Greg Kroah-Hartman 
CommitDate: Tue Mar 4 16:58:21 2014 -0800

 staging: visorchipset driver to provide registration and other services

I think Sasha has already sent a fix to resolve this issue that I'll be
sending to Linus in a day or so.

Ken, is Sasha's patch going to resolve this issue as well?  It looks
like people haven't tested what happens when the module is loaded
without the hardware present in the system :(
You are exactly right.  The driver needs to check for hardware early on 
before trying to use it.  Unfortunately, Sasha's patch will not resolve 
this one.  I'll work with Ben Romer to get a patch out ASAP.


Thanks,
Ken Cox
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Greg Kroah-Hartman
On Mon, Apr 07, 2014 at 07:17:25PM +0800, Fengguang Wu wrote:
> Hi Ken,
> 
> I got the below dmesg and the first bad commit is
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> 
> commit 12e364b9f08aa335dc7716ce74113e834c993765
> Author: Ken Cox 
> AuthorDate: Tue Mar 4 07:58:07 2014 -0600
> Commit: Greg Kroah-Hartman 
> CommitDate: Tue Mar 4 16:58:21 2014 -0800
> 
> staging: visorchipset driver to provide registration and other services

I think Sasha has already sent a fix to resolve this issue that I'll be
sending to Linus in a day or so.

Ken, is Sasha's patch going to resolve this issue as well?  It looks
like people haven't tested what happens when the module is loaded
without the hardware present in the system :(

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

2014-04-07 Thread Ken Cox


On 04/07/2014 06:17 AM, Fengguang Wu wrote:

Hi Ken,

I got the below dmesg and the first bad commit is

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

commit 12e364b9f08aa335dc7716ce74113e834c993765
Author: Ken Cox 
AuthorDate: Tue Mar 4 07:58:07 2014 -0600
Commit: Greg Kroah-Hartman 
CommitDate: Tue Mar 4 16:58:21 2014 -0800


--snip--

[   24.135101] FPGA image file name: xlinx_fpga_firmware.bit
[   24.137595] GPIO INIT FAIL!!
[   24.141283] driver version 1.0.0.0 loaded
[   24.142539] chipset driver version 1.0.0.0 loadedinvalid opcode:  [#1] 
PREEMPT SMP
[   24.144793] Modules linked in:
[   24.145303] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
3.14.0-rc5-00621-g12e364b #1
[   24.145303] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   24.145303] task: 88001157a010 ti: 88001157c000 task.ti: 
88001157c000
[   24.145303] RIP: 0010:[]  [] 
visorchipset_init+0x7b/0x8c5
The problem is that the driver is trying to call firmware code that only 
exists on Unisys s-Par hardware.  I will add a check to make sure the 
driver is running on the correct platform before trying to call into the 
firmware.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel