[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150728123523.GD12681@amd>
Date: Tue, 28 Jul 2015 14:35:23 +0200
From: Pavel Machek <pavel@....cz>
To: "Lee, Chun-Yi" <joeyli.kernel@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
linux-pm@...r.kernel.org, "Rafael J. Wysocki" <rjw@...k.pl>,
Matthew Garrett <matthew.garrett@...ula.com>,
Len Brown <len.brown@...el.com>,
Josh Boyer <jwboyer@...hat.com>,
Vojtech Pavlik <vojtech@...e.cz>,
Matt Fleming <matt.fleming@...el.com>,
Jiri Kosina <jkosina@...e.cz>,
"H. Peter Anvin" <hpa@...or.com>, "Lee, Chun-Yi" <jlee@...e.com>
Subject: Re: [RFC PATCH 09/16] PM / hibernate: Reserve swsusp key and earse
footprints
Typo in patch subject.
> And for earsing footbprints, the codes in this patch remove setup
And two typos here.
> data that carried swsusp key, and clean the memory space that
And don't call it swsusp. Please fix globally.
> +++ b/arch/x86/power/hibernate_keys.c
> @@ -0,0 +1,79 @@
> +/* Swsusp keys handler
> + *
> + * Copyright (C) 2015 SUSE Linux Products GmbH. All rights
Are you sure?
> +static int __init init_hibernate_keys(void)
> +{
> + struct swsusp_keys *keys;
> + int ret = 0;
> +
> + if (!keys_phys_addr)
> + return -ENODEV;
> +
> + keys = early_memremap(keys_phys_addr, sizeof(struct swsusp_keys));
> +
> + /* Copy swsusp keys to a allocated page */
> + swsusp_keys = (struct swsusp_keys *)get_zeroed_page(GFP_KERNEL);
> + if (swsusp_keys) {
> + *swsusp_keys = *keys;
> + } else {
> + pr_err("PM: Allocate swsusp keys page failed\n");
> + ret = -ENOMEM;
> + }
> +
> + /* Earse keys data no matter copy success or failed */
> + memset(keys, 0, sizeof(struct swsusp_keys));
> + early_memunmap(keys, sizeof(struct swsusp_keys));
> + memblock_free(keys_phys_addr, sizeof(struct swsusp_keys));
> + keys_phys_addr = 0;
> +
> + return ret;
> +}
> +
> +late_initcall(init_hibernate_keys);
init_hibernation_keys.
Pavel
--
(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