Bug 610063

Summary: Need to test that i6300ESB virtual watchdog device works in qemu on Windows guests
Product: Red Hat Enterprise Linux 6 Reporter: Richard W.M. Jones <rjones>
Component: qemu-kvmAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: dallan, dyuan, jskeoch, juzhang, khong, lihuang, llim, mkenneth, mzhan, ndai, rjones, rwu, shu, syeghiay, tburke, virt-maint, xuehuihui, ydu
Target Milestone: rc   
Target Release: 6.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 604466 Environment:
Last Closed: 2012-08-10 13:19:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 604466    
Bug Blocks: 580953, 583562    
Attachments:
Description Flags
WDT demo on winxp-32 none

Comment 1 Keqin Hong 2010-07-02 01:16:13 UTC
Richard, could you help confirm that Intel's driver can't be installed inside Windows guest?

Comment 2 Richard W.M. Jones 2010-07-02 07:33:34 UTC
Yes, I'll be checking this.  It may be a bug in the emulation of the watchdog
device.

Comment 5 Richard W.M. Jones 2010-07-26 18:49:00 UTC
This isn't working, *and* it's not something that can be solved
right away.  I'm bumping this to 6.1.

Comment 6 Richard W.M. Jones 2010-07-26 19:38:43 UTC
Ignore comment 6.

This does work.  However:

(1) Ignore Window's "default" driver.  This is nothing more than
displaying the PCI information about the device.

(2) You must have a 32 bit guest.  This is because Intel does not
supply 64 bit drivers for this hardware.

(3) You must install the Intel driver manually using the *.inf file.
Intel's documentation tells you how to do this.

After doing the above with a 32 bit Windows guest, I was
able to run Intel's WDT demo program, showing that the
device was working / counting.

Really we need some Windows software which can actually
use a watchdog.  I don't know of any.  There is documentation
with the Intel driver which describes their API, should anyone
want to write some control software.

Keqin, can you check this now works for you if you follow
the steps in the Intel documentation?

Comment 7 Keqin Hong 2010-07-27 01:48:35 UTC
I will check it asap.

Comment 8 Keqin Hong 2010-07-27 06:38:39 UTC
Created attachment 434607 [details]
WDT demo on winxp-32

Comment 9 Keqin Hong 2010-07-27 06:55:05 UTC
Richard,
Yes, Intel's WDT driver can be installed on XP following its documentation. However, WDT_LOCK BIT is always 1, no matter I click enable or disable button on the right hand side, as can be seen from attachment of Comment 8.

"Clicking the Enable button starts the WDT counting down. Clicking the Disable button stops the WDT from counting down." That's what Intel's Watchdog Demo Application Specification says. I couldn't see it work. Did I miss/misunderstand something?

Also, it is true there is doc describing the APIs of this driver, but no .h (iwdtlib.h) is given within the package that Intel provides, which also prevents writing some control software.

Comment 10 Richard W.M. Jones 2010-07-27 07:26:54 UTC
We emulated every feature of the WDT, so it should work, but
I'll have to take a closer look.

This is pretty low priority since watchdog software doesn't exist
for Windows as far as I can find.  So the aim of this exercise is to
make Intel's demo program work :-)

Bumping to 6.1 is the right choice ...

Comment 12 Richard W.M. Jones 2011-01-14 12:25:48 UTC
Here's the situation:

The 32 bit Windows driver supplied by Intel does not work
with the emulated watchdog device.

For reasons unknown the driver ignores the PCI BAR mapping
and sends all memory mapped I/O to 0x1_0000_0000 - 0x1_0000_000f
and one write to 0x3001ffff.

For example here is a sequence captured in qemu-system-x86_64
where it is setting the timer.  Note that the Windows driver is
writing the correct values, but to completely the wrong locations:

Unassigned mem write 000000010000000e = 0x0
Unassigned mem write 000000010000000d = 0x0
Unassigned mem write 000000010000000c = 0x0
Unassigned mem write 000000010000000b = 0x80
Unassigned mem write 000000010000000e = 0x0
Unassigned mem write 000000010000000d = 0x0
Unassigned mem write 000000010000000c = 0x0
Unassigned mem write 000000010000000b = 0x86
Unassigned mem write 0000000100000002 = 0x0
Unassigned mem write 0000000100000001 = 0x0
Unassigned mem write 0000000100000000 = 0x75
Unassigned mem write 000000003001ffff = 0x30
Unassigned mem write 000000010000000e = 0x0
Unassigned mem write 000000010000000d = 0x0
Unassigned mem write 000000010000000c = 0x0
Unassigned mem write 000000010000000b = 0x80
Unassigned mem write 000000010000000e = 0x0
Unassigned mem write 000000010000000d = 0x0
Unassigned mem write 000000010000000c = 0x0
Unassigned mem write 000000010000000b = 0x86
Unassigned mem write 0000000100000006 = 0x0
Unassigned mem write 0000000100000005 = 0x0
Unassigned mem write 0000000100000004 = 0x4e
Unassigned mem write 0000000100000003 = 0x20

It's not anything obvious in the PCI config.

The driver is binary only.  I disassembled it but it's
hard to tell exactly what it's doing.

So I suggest we write a Windows driver for this device.
This is a good idea anyway because the Intel driver is
binary only, only supports 32 bit Windows and doesn't
support recent versions of Windows.  A new open source
driver is required to fix this.  The device is very simple
and so this shouldn't be a lot of work.

Comment 16 Suzanne Logcher 2011-03-28 19:53:44 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains 
unresolved, it has been rejected as it is not proposed as an 
exception or blocker.

Red Hat invites you to ask your support representative to 
propose this request, if appropriate and relevant, in the 
next release of Red Hat Enterprise Linux.

Comment 17 Richard W.M. Jones 2011-06-02 09:55:54 UTC
I spent some time looking into writing a Windows driver
(for ib700 since that's a simpler device).  I haven't
got very far at the moment -- driver compiles but Windows
refuses to load it for unknown reasons.

Comment 18 Richard W.M. Jones 2011-06-10 10:05:46 UTC
It's possible we can get something working for 6.2.
Still under investigation, but I'll give it a tentative
dev-ack+

Comment 19 Richard W.M. Jones 2011-07-12 08:13:55 UTC
Update:

Vadim R found out why this doesn't work.  The Windows driver
assumes that the i6300esb is fitted in a particular PCI slot(!)

Vadim also wrote a framework modern driver for this.  Unfortunately
because it requires some Windows driver SDK that's not available
on mingw-w64, I can't compile it.

This is *not* something that customers have asked us about (to
my knowledge) so I'm happy to push this issue off into the
future.  Setting flags accordingly.

Comment 21 Richard W.M. Jones 2012-02-06 13:25:26 UTC
I am deferring this to 6.4 / far future based on
us not having the tools still to write a Windows
device driver (waiting for mingw-w64 in Fedora).

Comment 22 Richard W.M. Jones 2012-08-10 13:19:36 UTC
Closing as "WONTFIX":

(1) It requires someone to take Vadim's partial driver and
    make it work.  I don't have the development environment
    to do this.

(2) No one cares about watchdogs on Windows.

(3) There is no generic framework for watchdogs on Windows
    as there is under Linux, so even if (1) and (2) were solved
    the driver wouldn't really be much use outside very narrow
    use cases.

Comment 23 xuehh 2020-03-03 08:42:53 UTC
(In reply to Richard W.M. Jones from comment #6)
> Ignore comment 6.
> 
> This does work.  However:
> 
> (1) Ignore Window's "default" driver.  This is nothing more than
> displaying the PCI information about the device.
> 
> (2) You must have a 32 bit guest.  This is because Intel does not
> supply 64 bit drivers for this hardware.
> 
> (3) You must install the Intel driver manually using the *.inf file.
> Intel's documentation tells you how to do this.
> 
> After doing the above with a 32 bit Windows guest, I was
> able to run Intel's WDT demo program, showing that the
> device was working / counting.
> 
> Really we need some Windows software which can actually
> use a watchdog.  I don't know of any.  There is documentation
> with the Intel driver which describes their API, should anyone
> want to write some control software.
> 
> Keqin, can you check this now works for you if you follow
> the steps in the Intel documentation?
Where can I find drivers and Intel's WDT demo program? Can you provide it to me?

Comment 24 Richard W.M. Jones 2020-03-03 09:12:52 UTC
Please don't add comments to random old bugs.  Intel's WDT driver is
obsolete and broken, and shouldn't be used.  There are no WDT drivers
for Windows that I know of.