Skip to contentSkip to conversation

support piix PAM registers in KVM

PATCH Applied Gleb Natapov 5 participants 14 messages Sep 21, 2010 – Jun 19, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support piix PAM registers in KVM

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

hw/piix_pci.c +0 -4
index 933ad86..0bf435d 100644
@@ -99,10 +99,6 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
     int i, r;
     uint32_t smram, addr;
 
-    if (kvm_enabled()) {
-        /* FIXME: Support remappings and protection changes. */
-        return;
-    }
     update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM] >> 4) & 3);
     for(i = 0; i < 12; i++) {
         r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;

--
Gleb.

#1 lore raw
Quoted 21 lines · Gleb Natapov

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

hw/piix_pci.c +0 -5
index 933ad86..0bf435d 100644
@@ -99,10 +99,6 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
     int i, r;
     uint32_t smram, addr;
 
-    if (kvm_enabled()) {
-        /* FIXME: Support remappings and protection changes. */
-        return;
-    }
     update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM] >> 4) & 3);
     for(i = 0; i < 12; i++) {
         r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;
--
Quoted 1 line

Gleb.

Ugh, we should support ro slots to avoid such kind of problems...

Applied, thanks.

#2 lore raw
Quoted 7 lines · Marcelo Tosatti
Quoted 5 lines · Gleb Natapov

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

Applied, thanks.

Thanks. I've committed the seabios relocation patches that depended on this fix.

-Kevin

#3 lore raw
In reply to Gleb Natapov
Quoted 21 lines · Gleb Natapov

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

hw/piix_pci.c +0 -5
index 933ad86..0bf435d 100644
@@ -99,10 +99,6 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
      int i, r;
      uint32_t smram, addr;
 
-    if (kvm_enabled()) {
-        /* FIXME: Support remappings and protection changes. */
-        return;
-    }
      update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM]>>  4)&  3);
      for(i = 0; i<  12; i++) {
          r = (d->dev.config[(i>>  1) + (I440FX_PAM + 1)]>>  ((i&  1) * 4))&  3;
--
Quoted 5 lines

Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi,

While testing migration from old to new kvm ( 0.12.5 to 0.14.x ) and after fixing some other problems mainly version_id probs in some of the VMStateDescriptions everything was working fine until I tried to migrate Windows guests they would crash after running some time. Linux guests are running stable.

So I decided to do a git bisect to identify the according commit. Reverting this commit fixes this problem with Windows guests.

What consequences might it have not updating these memory mappings ?

Does this commit need a specific seabios version, we have seabios 0.6.0 with qemu-kvm 0.12.5 and seabios 0.6.1.2 with qemu-kvm 0.14.1 ?

Maybe instead of reverting this commit one could check the seabios version in this method and only do an update of these piix PAM registers if running with a newer seabios version ?

Regards,
Jason

#4 lore raw
Quoted 38 lines · Jason Krieg
Quoted 22 lines · Gleb Natapov

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

hw/piix_pci.c +0 -4
index 933ad86..0bf435d 100644
@@ -99,10 +99,6 @@ static void 
 i440fx_update_memory_mappings(PCII440FXState *d)
      int i, r;
      uint32_t smram, addr;
 
-    if (kvm_enabled()) {
-        /* FIXME: Support remappings and protection changes. */
-        return;
-    }
      update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM]>>  
 4)&  3);
      for(i = 0; i<  12; i++) {
          r = (d->dev.config[(i>>  1) + (I440FX_PAM + 1)]>>  ((i&  1) 
Quoted 7 lines

* 4))& 3;

Signature · 5 lines
            Gleb.
-- 
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi,

While testing migration from old to new kvm ( 0.12.5 to 0.14.x ) and after fixing some other problems mainly version_id probs in some of the VMStateDescriptions everything was working fine until I tried to migrate Windows guests they would crash after running some time. Linux guests are running stable.

Quoted 5 lines

So I decided to do a git bisect to identify the according commit. Reverting this commit fixes this problem with Windows guests.

What consequences might it have not updating these memory mappings ?

Resets may fail.

Quoted 2 lines

Does this commit need a specific seabios version, we have seabios 0.6.0 with qemu-kvm 0.12.5 and seabios 0.6.1.2 with qemu-kvm 0.14.1 ?

IIUC newer seabios depends on this commit, but this commit does not depend on seabios.

Quoted 3 lines

Maybe instead of reverting this commit one could check the seabios version in this method and only do an update of these piix PAM registers if running with a newer seabios version ?

It would be better to first understand what's going wrong.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw
Quoted 50 lines · Avi Kivity
Quoted 38 lines · Jason Krieg
Quoted 22 lines · Gleb Natapov

Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes to F-segment modify ROM content instead of memory copy. Since QEMU does not reloads ROMs during reset on next boot modified copy of BIOS is used.

hw/piix_pci.c +0 -4
index 933ad86..0bf435d 100644
@@ -99,10 +99,6 @@ static void 
 i440fx_update_memory_mappings(PCII440FXState *d)
      int i, r;
      uint32_t smram, addr;
 
-    if (kvm_enabled()) {
-        /* FIXME: Support remappings and protection changes. */
-        return;
-    }
      update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM]>>  
 4)&  3);
      for(i = 0; i<  12; i++) {
          r = (d->dev.config[(i>>  1) + (I440FX_PAM + 1)]>>  ((i&  
Quoted 7 lines

1) * 4))& 3;

Signature · 5 lines
            Gleb.
-- 
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi,

While testing migration from old to new kvm ( 0.12.5 to 0.14.x ) and after fixing some other problems mainly version_id probs in some of the VMStateDescriptions everything was working fine until I tried to migrate Windows guests they would crash after running some time. Linux guests are running stable.

Quoted 5 lines

So I decided to do a git bisect to identify the according commit. Reverting this commit fixes this problem with Windows guests.

What consequences might it have not updating these memory mappings ?

Resets may fail.

Quoted 2 lines

Does this commit need a specific seabios version, we have seabios 0.6.0 with qemu-kvm 0.12.5 and seabios 0.6.1.2 with qemu-kvm 0.14.1 ?

Quoted 8 lines

IIUC newer seabios depends on this commit, but this commit does not depend on seabios.

Quoted 3 lines

Maybe instead of reverting this commit one could check the seabios version in this method and only do an update of these piix PAM registers if running with a newer seabios version ?

It would be better to first understand what's going wrong.

I presume (just guessing) Windows wrote to F-segment modifying the ROM and now gets confused if these PAM registers are updated.

Any ideas for what I could look for ?

#6 lore raw
Quoted 5 lines · Jason Krieg
Quoted 5 lines
Quoted 4 lines

Maybe instead of reverting this commit one could check the seabios version in this method and only do an update of these piix PAM registers if running with a newer seabios version ?

Quoted 7 lines
Quoted 2 lines

It would be better to first understand what's going wrong.

I presume (just guessing) Windows wrote to F-segment modifying the ROM and now gets confused if these PAM registers are updated.

It shouldn't, really.

Quoted 3 lines

Any ideas for what I could look for ?

Try -no-tpr-opt (on both sides).

Signature · 1 line
error compiling committee.c: too many arguments to function
#7 lore raw
Quoted 7 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

Signature · 1 line
error compiling committee.c: too many arguments to function
#8 lore raw
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

with 0.12.5 there is no device_init in kvm-tpr-opt.c should I still try without the device_init() only with 0.14.1 ?

#9 lore raw
Quoted 7 lines · Jason Krieg
Quoted 6 lines · Avi Kivity
Quoted 5 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

with 0.12.5 there is no device_init in kvm-tpr-opt.c should I still try without the device_init() only with 0.14.1 ?

removing kvm_tpr_opt_setup() in qemu-kvm-x86.c is probably the equivalent to device_init(kvm_tpr_opt_setup)

#10 lore raw
In reply to Avi Kivity
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

I disabled this on both sides but still the same behaviour windows crashes after ~45min

#11 lore raw
Quoted 7 lines · Jason Krieg
Quoted 6 lines · Avi Kivity
Quoted 5 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

I disabled this on both sides but still the same behaviour windows crashes after ~45min

45 minutes!

Anything from the crash to indicate what's wrong?

Signature · 1 line
error compiling committee.c: too many arguments to function
#12 lore raw
Quoted 14 lines · Avi Kivity
Quoted 13 lines · Jason Krieg
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

Quoted 7 lines
Quoted 2 lines

I disabled this on both sides but still the same behaviour windows crashes after ~45min

45 minutes!

Anything from the crash to indicate what's wrong?

debugging Windows is not really easy mostly just saying nothing.

windows runs at first normally but after some time somewhere between a few minutes and 1.5h the windows kernel process goes crazy running with 100% cpu and after running like this for a few more minutes windows is completely frozen.

#13 lore raw
Quoted 20 lines · Jason Krieg
Quoted 19 lines · Avi Kivity
Quoted 7 lines · Jason Krieg
Quoted 6 lines · Avi Kivity
Quoted 5 lines · Avi Kivity
Quoted 4 lines

Any ideas for what I could look for ?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Try -no-tpr-opt (on both sides).

There's no such option. Try commenting out the device_init line of kvm-tpr-opt.c.

I disabled this on both sides but still the same behaviour windows crashes after ~45min

45 minutes!

Quoted 9 lines
Quoted 2 lines

Anything from the crash to indicate what's wrong?

debugging Windows is not really easy mostly just saying nothing.

windows runs at first normally but after some time somewhere between a few minutes and 1.5h the windows kernel process goes crazy running with 100% cpu and after running like this for a few more minutes windows is completely frozen.

Sometimes examining the running code and registers in the qemu monitor, perhaps resolving symbols via WinDbg, helps in getting a clue... it's not easy though.

Signature · 1 line
error compiling committee.c: too many arguments to function