Skip to contentSkip to conversation

sparc solaris guest, hsfs_putpage: dirty HSFS page

Qemu-devel Artyom Tarasenko 2 participants 6 messages Jan 24, 2010 – Jan 27, 2010

lore
Share & tools
lore
#0 lore raw

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */

if (pvn_getdirty(pp, flags) == 1) {
		cmn_err(CE_NOTE,
			    "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Signature · 4 lines
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/
#1 lore raw
Quoted 26 lines · Artyom Tarasenko

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */
if (pvn_getdirty(pp, flags) == 1) { cmn_err(CE_NOTE,
                           "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Quoted 5 lines

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Maybe the stores via MMU bypass ASIs should use st[bwlq]_phys_notdirty. It can break display handling, though.

#2 lore raw

2010/1/24 Blue Swirl <[email protected]>:

Quoted 28 lines
Quoted 26 lines · Artyom Tarasenko

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */
if (pvn_getdirty(pp, flags) == 1) { cmn_err(CE_NOTE,
                           "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Quoted 7 lines
Quoted 5 lines

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Maybe the stores via MMU bypass ASIs

why bypass stores? What about the non-bypass ones?

Quoted 2 lines

should use
st[bwlq]_phys_notdirty.

Seems that st[bw]_phys_notdirty are not implemeted yet?

I've changed [lq] for asi 0x20 and 21-2f and see no difference. Also I put some debug printfs and see that none of these ASIs is called after the Solaris kernel is loaded.

Quoted 1 line

It can break display handling, though.

Signature · 4 lines
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/
#3 lore raw
Quoted 32 lines · Artyom Tarasenko

2010/1/24 Blue Swirl <[email protected]>:

Quoted 31 lines
Quoted 29 lines · Artyom Tarasenko

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */
if (pvn_getdirty(pp, flags) == 1) { cmn_err(CE_NOTE,
                           "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Maybe the stores via MMU bypass ASIs

why bypass stores? What about the non-bypass ones?

Because their use should update the PTE dirty bits.

Quoted 18 lines
Quoted 2 lines

should use
st[bwlq]_phys_notdirty.

Seems that st[bw]_phys_notdirty are not implemeted yet?

I've changed [lq] for asi 0x20 and 21-2f and see no difference. Also I put some debug printfs and see that none of these ASIs is called after the Solaris kernel is loaded.

Quoted 1 line

It can break display handling, though.

--
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/

#4 lore raw

2010/1/26 Blue Swirl <[email protected]>:

Quoted 34 lines
Quoted 32 lines · Artyom Tarasenko

2010/1/24 Blue Swirl <[email protected]>:

Quoted 31 lines
Quoted 29 lines · Artyom Tarasenko

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */
if (pvn_getdirty(pp, flags) == 1) { cmn_err(CE_NOTE,
                           "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Maybe the stores via MMU bypass ASIs

why bypass stores? What about the non-bypass ones?

Because their use should update the PTE dirty bits.

update !=always set. Where is it implemented? I guess the code is shared between multiple architectures.
Is there a way to trace at what point certain page is getting dirty?

Since it's not the bypass ASIs it must be something else.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

should use
st[bwlq]_phys_notdirty.

Seems that st[bw]_phys_notdirty are not implemeted yet?

I've changed [lq] for asi 0x20 and 21-2f and see no difference. Also I put some debug printfs and see that none of these ASIs is called after the Solaris kernel is loaded.

Signature · 4 lines
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/
#5 lore raw
Quoted 42 lines · Artyom Tarasenko

2010/1/26 Blue Swirl <[email protected]>:

Quoted 41 lines
Quoted 38 lines · Artyom Tarasenko

2010/1/24 Blue Swirl <[email protected]>:

Quoted 28 lines
Quoted 26 lines · Artyom Tarasenko

All solaris versions which currently boot (from cd) regularly produce buckets of "hsfs_putpage: dirty HSFS page" messages.

High Sierra is a pretty old and stable stuff, so it is possible that the code is similar to OpenSolaris.
I looked in debugger, and the function calls hierarchy looks pretty similar.

Now in the OpenSolaris source code there is a nice comment:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/hsfs/hsfs_vnops.c#1758
/*
* Normally pvn_getdirty() should return 0, which
* impies that it has done the job for us.
* The shouldn't-happen scenario is when it returns 1.
* This means that the page has been modified and
* needs to be put back.
* Since we can't write on a CD, we fake a failed
* I/O and force pvn_write_done() to destroy the page. */
if (pvn_getdirty(pp, flags) == 1) { cmn_err(CE_NOTE,
                           "hsfs_putpage: dirty HSFS page");

Now the question: does the problem have to do with qemu caches (non-)emulation? Can it be that we mark non-dirty pages dirty? Or does qemu always mark pages dirty exactly to avoid cache emulation?

Quoted 7 lines
Quoted 5 lines

Otherwise it means something else goes astray and Solaris guest really modifies the pages it shouldn't.

Just wonder what to dig first, MMU or IRQ emulation (the two most obvious suspects).

Maybe the stores via MMU bypass ASIs

why bypass stores? What about the non-bypass ones?

Quoted 7 lines
Quoted 1 line

Because their use should update the PTE dirty bits.

update !=always set. Where is it implemented? I guess the code is shared between multiple architectures.
Is there a way to trace at what point certain page is getting dirty?

Since it's not the bypass ASIs it must be something else.

target-sparc/helper.c:193 for the page table dirtiness (this is probably what Solaris can detect).

There is other kind of dirtiness in exec.c, grep for phys_ram_dirty uses. But this should not be visible to guest.