9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] Kernel panic when setting screen resolution on machine with i810 chipset
Date: Tue, 1 Oct 2019 17:45:20 +0200	[thread overview]
Message-ID: <94879C18B19A72D7FF92E1D13AF96559@felloff.net> (raw)
In-Reply-To: 4917D3F7013C68C4954F2DDCF94874DE@gmail.com

the i81x driver appears to not take big pages into account (probably
the driver predates the page size extension implementation). the
offending code is here in i81xenable() in /sys/src/9/pc/vgai81x.c:

	/*
	 * allocate space for the cursor data in system memory.
	 * must be uncached.
	 */
	cursor = (ulong)xspanalloc(BY2PG, BY2PG, 0);
	mach0 = MACHP(0);
	pte = mmuwalk(mach0->pdb, cursor, 2, 0);
	if(pte == nil)
		panic("i81x cursor mmuwalk");
	*pte |= PTEUNCACHED;
	scr->storage = cursor;

xspanalloc() allocates memory in the kernel address space, which gets
mapped with 4MB pages, not 4K pages.

so the later attempt to manipulate the 4K pte to set the uncached bit
fails (mmuwalk panics as theres no 4K pte).

the proper way would be to write a function to uncache a kernel memory
span that splits the 4MB mapping.

for now, try to just comment out the 4 lines in i81xenable():

//	pte = mmuwalk(mach0->pdb, cursor, 2, 0);
//	if(pte == nil)
//		panic("i81x cursor mmuwalk");
//	*pte |= PTEUNCACHED;

--
cinap


             reply	other threads:[~2019-10-01 15:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 15:45 cinap_lenrek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-05  5:56 covertusername967
2019-12-03 18:44 cinap_lenrek
2019-11-30  7:47 covertusername967
2019-12-03  6:35 ` k0ga
2019-10-02  4:18 kokamoto
2019-10-02  7:17 ` Steve Simon
2019-10-02  2:57 covertusername967
2019-10-02  0:17 kokamoto
2019-10-02  0:08 cinap_lenrek
2019-10-01 23:31 covertusername967
2019-10-01 23:02 cinap_lenrek
2019-10-01 12:21 covertusername967
2019-10-01  2:09 kokamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94879C18B19A72D7FF92E1D13AF96559@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).