9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] compiling xen3 with more recent pc kernel
@ 2015-06-21 21:22 Skip Tavakkolian
  2015-06-21 21:32 ` David du Colombier
  0 siblings, 1 reply; 3+ messages in thread
From: Skip Tavakkolian @ 2015-06-21 21:22 UTC (permalink / raw)
  To: 9fans

i had to make the following changes to the kernel for xen3 to match up
to recent labs pc kernel and to compile successfully.  can anyone verify
the changes are correct?  (i could to a smoke test on EC2, but don't
feel adventurous at the moment)

thanks,

% yesterday -D mem.h fns.h trap.c
diff -n /n/dump/2015/0621/sys/src/9/xen3/mem.h /sys/src/9/xen3/mem.h
/n/dump/2015/0621/sys/src/9/xen3/mem.h:15,16 c /sys/src/9/xen3/mem.h:15,16
< #define	ROUND(s, sz)	(((s)+((sz)-1))&~((sz)-1))
< #define	PGROUND(s)	ROUND(s, BY2PG)
---
> /* #define	ROUND(s, sz)	(((s)+((sz)-1))&~((sz)-1))	*/
> /* #define	PGROUND(s)	ROUND(s, BY2PG)		*/
/n/dump/2015/0621/sys/src/9/xen3/mem.h:51 a /sys/src/9/xen3/mem.h:52
> #define	UTROUND(t)	ROUNDUP((t), BY2PG)
diff -n /n/dump/2015/0621/sys/src/9/xen3/fns.h /sys/src/9/xen3/fns.h
/n/dump/2015/0621/sys/src/9/xen3/fns.h:100 a /sys/src/9/xen3/fns.h:101
> void	validalign(uintptr, unsigned);
diff -n /n/dump/2015/0621/sys/src/9/xen3/trap.c /sys/src/9/xen3/trap.c
/n/dump/2015/0621/sys/src/9/xen3/trap.c:949 a /sys/src/9/xen3/trap.c:950,954
> void
> validalign(uintptr addr, unsigned align)
> {
> }
>




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

* Re: [9fans] compiling xen3 with more recent pc kernel
  2015-06-21 21:22 [9fans] compiling xen3 with more recent pc kernel Skip Tavakkolian
@ 2015-06-21 21:32 ` David du Colombier
  2015-06-21 22:02   ` Skip Tavakkolian
  0 siblings, 1 reply; 3+ messages in thread
From: David du Colombier @ 2015-06-21 21:32 UTC (permalink / raw)
  To: 9fans

> i had to make the following changes to the kernel for xen3 to match up
> to recent labs pc kernel and to compile successfully.  can anyone
> verify the changes are correct?  (i could to a smoke test on EC2, but
> don't feel adventurous at the moment)

The evenaddr function in trap.c should be replaced by validalign:

void
validalign(uintptr addr, unsigned align)
{
	/*
	 * Plan 9 is a 32-bit O/S, and the hardware it runs on
	 * does not usually have instructions which move 64-bit
	 * quantities directly, synthesizing the operations
	 * with 32-bit move instructions. Therefore, the compiler
	 * (and hardware) usually only enforce 32-bit alignment,
	 * if at all.
	 *
	 * Take this out if the architecture warrants it.
	 */
	if(align == sizeof(vlong))
		align = sizeof(long);

	/*
	 * Check align is a power of 2, then addr alignment.
	 */
	if((align != 0 && !(align & (align-1))) && !(addr & (align-1)))
		return;
	postnote(up, 1, "sys: odd address", NDebug);
	error(Ebadarg);
	/*NOTREACHED*/
}

This is a change done by Jim McKie on 2014-05-15.

--
David du Colombier



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

* Re: [9fans] compiling xen3 with more recent pc kernel
  2015-06-21 21:32 ` David du Colombier
@ 2015-06-21 22:02   ` Skip Tavakkolian
  0 siblings, 0 replies; 3+ messages in thread
From: Skip Tavakkolian @ 2015-06-21 22:02 UTC (permalink / raw)
  To: 9fans

thanks.

i saw the note and was wondering if for xen3 it could be
stubbed out.

>> i had to make the following changes to the kernel for xen3 to match up
>> to recent labs pc kernel and to compile successfully.  can anyone
>> verify the changes are correct?  (i could to a smoke test on EC2, but
>> don't feel adventurous at the moment)
>
> The evenaddr function in trap.c should be replaced by validalign:
>
> void
> validalign(uintptr addr, unsigned align)
> {
> 	/*
> 	 * Plan 9 is a 32-bit O/S, and the hardware it runs on
> 	 * does not usually have instructions which move 64-bit
> 	 * quantities directly, synthesizing the operations
> 	 * with 32-bit move instructions. Therefore, the compiler
> 	 * (and hardware) usually only enforce 32-bit alignment,
> 	 * if at all.
> 	 *
> 	 * Take this out if the architecture warrants it.
> 	 */
> 	if(align == sizeof(vlong))
> 		align = sizeof(long);
>
> 	/*
> 	 * Check align is a power of 2, then addr alignment.
> 	 */
> 	if((align != 0 && !(align & (align-1))) && !(addr & (align-1)))
> 		return;
> 	postnote(up, 1, "sys: odd address", NDebug);
> 	error(Ebadarg);
> 	/*NOTREACHED*/
> }
>
> This is a change done by Jim McKie on 2014-05-15.
>
> --
> David du Colombier




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

end of thread, other threads:[~2015-06-21 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-21 21:22 [9fans] compiling xen3 with more recent pc kernel Skip Tavakkolian
2015-06-21 21:32 ` David du Colombier
2015-06-21 22:02   ` Skip Tavakkolian

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).