Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ddb fails to write breakpoint



Le 30/04/12 23:24, David Laight a écrit :
I tried to set a kerneld db breakpoint on amd64 current (6.99.6) but the
system just dumped - couldn't see why since it all scrolled away.

Attempts to write into code space fault in ddb.
The following makes it work - but is clearly ott.

--- arch/amd64/amd64/db_memrw.c 23 Nov 2011 01:15:02 -0000      1.9
+++ arch/amd64/amd64/db_memrw.c 30 Apr 2012 20:49:21 -0000
@@ -146,6 +146,7 @@ db_write_text(vaddr_t addr, size_t size,
                pmap_pte_clearbits(ppte, PG_KR);
                pmap_pte_setbits(ppte, PG_KW);
                pmap_update_pg(pgva);
+               tlbflushg();

                /*
                 * Page is now writable.  Do as much access as we
@@ -160,6 +161,7 @@ db_write_text(vaddr_t addr, size_t size,
                pmap_pte_clearbits(ppte, PG_KW);
                pmap_pte_setbits(ppte, PG_KR);
                pmap_update_pg(pgva);
+               tlbflushg();

        } while (size != 0);
  }

pmap_update_pg(addr) is just the single instruction 'invlpg adddr'
tlbflushg() is a full tlb zap.

Not looked at what invlpg is supposed to do, or whether it is
an adequate synchronising instruction.

cpu is an intel i7.

It should handle the invalidation fine, even if it is a global mapping.

Just tested it with a 6.99.4 kernel and worked fine, will test with a more recent one.

Do you know whether it happens every time or just for specific addresses (like one close to a page boundary or with the PG_PS bit set?)

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index