lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080208215644.GM12923@elf.ucw.cz>
Date:	Fri, 8 Feb 2008 22:56:49 +0100
From:	Pavel Machek <pavel@....cz>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	"Rafael J. Wysocki" <rjw@...k.pl>,
	kernel list <linux-kernel@...r.kernel.org>,
	Linux-pm mailing list <linux-pm@...ts.osdl.org>
Subject: Re: [rft] s2ram wakeup moves to .c, could fix few machines

Hi!

>> +	.section ".header", "a"
>> +
>> +/* This should match the structure in wakeup.h */
>> +		.globl	wakeup_header
>> +wakeup_header:
>> +video_mode:	.short	0	/* Video mode number */
>> +pmode_return:	.byte	0x66, 0xea	/* ljmpl */
>> +		.long	0	/* offset goes here */
>> +		.short	__KERNEL_CS
>
> Missing a .short pad here... Pavel fixed that at some point, I thought.

No pad needed, AFAICT.

>>  	}
>> -	memcpy((void *)acpi_wakeup_address, &wakeup_start,
>> -	       &wakeup_end - &wakeup_start);
>> -	acpi_copy_wakeup_routine(acpi_wakeup_address);
>> +	memcpy((void *)acpi_realmode, &wakeup_code_start, 4*PAGE_SIZE);
>
> Using a PAGE_SIZE multiplier here isn't a good thing...

Fixed.

>> +	header = (struct wakeup_header *)(acpi_realmode + 0x3f00);
>
> ... especially not with magic constants like this.

Fixed.

> If you're putting the "header" at the end, then you should also replace the 
> end_signature stuff since that's, then, redundant.  Furthermore, by doing 
> so, you're also padding the binary out to its maximum length, so you might 
> as well just remove the .bss-clearing stuff.

Good, lets remove bss clearing.

>> +	header->pmode_efer_low = nx_enabled;
>> +	if (header->pmode_efer_low & 1) {
>> +		/* This is strange, why not save efer, always? */
>> +		rdmsr(MSR_EFER, header->pmode_efer_low,
>> +			header->pmode_efer_high);
>> +	}
>
> Yes, why not save EFER every time?

Dunno, I copied it from other code, and as it depends on nx setting,
I'd prefer not to touch it for now. Do old CPUs have EFER?

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ