qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
@ 2009-07-15 12:18 Naphtali Sprei
  2009-07-15 18:51 ` Hollis Blanchard
  2009-07-16 13:31 ` Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Naphtali Sprei @ 2009-07-15 12:18 UTC (permalink / raw)
  To: qemu-devel

After comments from quintela@trasno.org and mst@redhat.com, here's the 
2nd try:


The sequence of reading from eeprom is "offset by one" moved because of 
a false detection
of a clock cycle after an eeprom reset. Keeping the last clock value 
after a reset keeps it in sync.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 hw/e1000.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 4ac8918..15598ab 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -262,6 +262,8 @@ set_eecd(E1000State *s, int index, uint32_t val)
     }
     if (!(val & E1000_EECD_CS)) {              // rising, no CS (EEPROM 
reset)
         memset(&s->eecd_state, 0, sizeof s->eecd_state);
+        // restore old_eecd's E1000_EECD_SK to avoid false detection of 
a clock edge
+        s->eecd_state.old_eecd = E1000_EECD_SK;
         return;
     }
     s->eecd_state.val_in <<= 1;
--
1.5.5.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
  2009-07-15 12:18 [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver Naphtali Sprei
@ 2009-07-15 18:51 ` Hollis Blanchard
  2009-07-15 21:10   ` Jamie Lokier
  2009-07-16 13:31 ` Anthony Liguori
  1 sibling, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2009-07-15 18:51 UTC (permalink / raw)
  To: Naphtali Sprei; +Cc: qemu-devel

On Wed, 2009-07-15 at 15:18 +0300, Naphtali Sprei wrote:
> After comments from quintela@trasno.org and mst@redhat.com, here's the 
> 2nd try:
> 
> 
> The sequence of reading from eeprom is "offset by one" moved because of 
> a false detection
> of a clock cycle after an eeprom reset. Keeping the last clock value 
> after a reset keeps it in sync.
> 
> Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
> ---
>  hw/e1000.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 4ac8918..15598ab 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -262,6 +262,8 @@ set_eecd(E1000State *s, int index, uint32_t val)
>      }
>      if (!(val & E1000_EECD_CS)) {              // rising, no CS (EEPROM 
> reset)
>          memset(&s->eecd_state, 0, sizeof s->eecd_state);
> +        // restore old_eecd's E1000_EECD_SK to avoid false detection of 
> a clock edge
> +        s->eecd_state.old_eecd = E1000_EECD_SK;
>          return;
>      }
>      s->eecd_state.val_in <<= 1;
> --
> 1.5.5.6

This fixes the problem for me.

-- 
Hollis Blanchard
IBM Linux Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
  2009-07-15 18:51 ` Hollis Blanchard
@ 2009-07-15 21:10   ` Jamie Lokier
  2009-07-16 10:30     ` Naphtali Sprei
  0 siblings, 1 reply; 6+ messages in thread
From: Jamie Lokier @ 2009-07-15 21:10 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Naphtali Sprei, qemu-devel

On Wed, 2009-07-15 at 15:18 +0300, Naphtali Sprei wrote:
> After comments from quintela@trasno.org and mst@redhat.com, here's the 
> 2nd try:
> 
> The sequence of reading from eeprom is "offset by one" moved because
> of a false detection of a clock cycle after an eeprom reset. Keeping
> the last clock value after a reset keeps it in sync.

Isn't it more likely that the real hardware resets the clock value to
a fixed level - the polarity being the opposite of what QEMU currently
does, so that there's no edge caused by the first write?

-- Jamie

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
  2009-07-15 21:10   ` Jamie Lokier
@ 2009-07-16 10:30     ` Naphtali Sprei
  0 siblings, 0 replies; 6+ messages in thread
From: Naphtali Sprei @ 2009-07-16 10:30 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: qemu-devel, Hollis Blanchard

Jamie Lokier wrote:
> On Wed, 2009-07-15 at 15:18 +0300, Naphtali Sprei wrote:
>> After comments from quintela@trasno.org and mst@redhat.com, here's the 
>> 2nd try:
>>
>> The sequence of reading from eeprom is "offset by one" moved because
>> of a false detection of a clock cycle after an eeprom reset. Keeping
>> the last clock value after a reset keeps it in sync.
> 
> Isn't it more likely that the real hardware resets the clock value to
> a fixed level - the polarity being the opposite of what QEMU currently
> does, so that there's no edge caused by the first write?
The eeprom reset I referred to is actually a reset of the internal state of (part of) the device emulation in qemu.
The software drives the clock bit (SK) and the reset shouldn't change it. 
> 
> -- Jamie
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
  2009-07-15 12:18 [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver Naphtali Sprei
  2009-07-15 18:51 ` Hollis Blanchard
@ 2009-07-16 13:31 ` Anthony Liguori
  2009-07-16 15:17   ` Naphtali Sprei
  1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2009-07-16 13:31 UTC (permalink / raw)
  To: Naphtali Sprei; +Cc: qemu-devel

Naphtali Sprei wrote:
> After comments from quintela@trasno.org and mst@redhat.com, here's the 
> 2nd try:
>
>
> The sequence of reading from eeprom is "offset by one" moved because 
> of a false detection
> of a clock cycle after an eeprom reset. Keeping the last clock value 
> after a reset keeps it in sync.
>
> Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
> ---
> hw/e1000.c |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 4ac8918..15598ab 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -262,6 +262,8 @@ set_eecd(E1000State *s, int index, uint32_t val)
>     }
>     if (!(val & E1000_EECD_CS)) {              // rising, no CS 
> (EEPROM reset)
>         memset(&s->eecd_state, 0, sizeof s->eecd_state);
> +        // restore old_eecd's E1000_EECD_SK to avoid false detection 
> of a clock edge

Your mailer is wrapping these lines.  We also prefer C89 comments in QEMU.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
  2009-07-16 13:31 ` Anthony Liguori
@ 2009-07-16 15:17   ` Naphtali Sprei
  0 siblings, 0 replies; 6+ messages in thread
From: Naphtali Sprei @ 2009-07-16 15:17 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

comment format changed, (hopefully) fixed mailer wrapping.


Subject: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver

The sequence of reading from eeprom is "offset by one" moved because of a false detection
of a clock cycle after an eeprom reset. Keeping the last clock value after a reset keeps it in sync.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 4ac8918..b819501 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -262,6 +262,11 @@ set_eecd(E1000State *s, int index, uint32_t val)
     }
     if (!(val & E1000_EECD_CS)) {		// rising, no CS (EEPROM reset)
         memset(&s->eecd_state, 0, sizeof s->eecd_state);
+        /*
+         * restore old_eecd's E1000_EECD_SK (known to be on)
+         * to avoid false detection of a clock edge
+         */
+        s->eecd_state.old_eecd = E1000_EECD_SK;
         return;
     }
     s->eecd_state.val_in <<= 1;
-- 
1.5.5.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-16 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 12:18 [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver Naphtali Sprei
2009-07-15 18:51 ` Hollis Blanchard
2009-07-15 21:10   ` Jamie Lokier
2009-07-16 10:30     ` Naphtali Sprei
2009-07-16 13:31 ` Anthony Liguori
2009-07-16 15:17   ` Naphtali Sprei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).