From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934207AbcI2Pyh (ORCPT ); Thu, 29 Sep 2016 11:54:37 -0400 Received: from mga05.intel.com ([192.55.52.43]:10582 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932366AbcI2Py3 (ORCPT ); Thu, 29 Sep 2016 11:54:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,415,1470726000"; d="scan'208";a="14592352" From: "Chen, Yu C" To: "Rafael J. Wysocki" , Stephen Rothwell CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , "linux-next@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Denys Vlasenko Subject: RE: linux-next: build failure after merge of the tip tree Thread-Topic: linux-next: build failure after merge of the tip tree Thread-Index: AQHSGkumshNtmKTHTE+i41DpuBiobaCQnCew Date: Thu, 29 Sep 2016 15:54:24 +0000 Message-ID: <36DF59CE26D8EE47B0655C516E9CE6405E617A77@shsmsx102.ccr.corp.intel.com> References: <20160929132007.4fa85f3a@canb.auug.org.au> <4057532.rZT5v6PsDv@vostro.rjw.lan> In-Reply-To: <4057532.rZT5v6PsDv@vostro.rjw.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODFkOTg2ZjEtMjhjNC00OWFlLWFiNTktN2MyYTJlNDYzNGI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IllhZEo0eENaSndqUFJ4NzJcL2ZZbDVhSzVEQmV5TW15a1wvcWUwaFNRNnI5TT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u8TFsggC022539 Hi, > -----Original Message----- > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Sent: Thursday, September 29, 2016 8:25 PM > To: Stephen Rothwell > Cc: Thomas Gleixner; Ingo Molnar; H. Peter Anvin; Peter Zijlstra; linux- > next@vger.kernel.org; linux-kernel@vger.kernel.org; Denys Vlasenko; Chen, Yu > C > Subject: Re: linux-next: build failure after merge of the tip tree > > On Thursday, September 29, 2016 01:20:07 PM Stephen Rothwell wrote: > > Hi all, > > > > After merging the tip tree, today's linux-next build (x86_64 > > allmodconfig) failed like this: > > > > arch/x86/power/hibernate_64.c: In function 'hibernation_e820_save': > > arch/x86/power/hibernate_64.c:236:15: error: passing argument 1 of > 'get_e820_md5' from incompatible pointer type [-Werror=incompatible- > pointer-types] > > get_e820_md5(&e820_saved, buf); > > ^ > > arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' > but argument is of type 'struct e820map **' > > static int get_e820_md5(struct e820map *map, void *buf) > > ^ > > arch/x86/power/hibernate_64.c: In function 'hibernation_e820_mismatch': > > arch/x86/power/hibernate_64.c:249:21: error: passing argument 1 of > 'get_e820_md5' from incompatible pointer type [-Werror=incompatible- > pointer-types] > > ret = get_e820_md5(&e820_saved, result); > > ^ > > arch/x86/power/hibernate_64.c:203:12: note: expected 'struct e820map *' > but argument is of type 'struct e820map **' > > static int get_e820_md5(struct e820map *map, void *buf) > > ^ > > > > Caused by commit > > > > 475339684ef1 ("x86/e820: Prepare e280 code for switch to dynamic > > storage") > > > > interacting with commit > > > > 6f95ad2b6162 ("PM / hibernate: Verify e820 memory map by MD5 > > digest") > > > > from the pm tree. > > > > I have applied the following merge fix patch: > > > > From: Stephen Rothwell > > Date: Thu, 29 Sep 2016 13:13:45 +1000 > > Subject: [PATCH] pm/hibernate: merge fix for type of e820_saved > > changing > > > > Signed-off-by: Stephen Rothwell > > --- > > arch/x86/power/hibernate_64.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/power/hibernate_64.c > > b/arch/x86/power/hibernate_64.c index 72f2c9531b03..904048f7a9c9 > > 100644 > > --- a/arch/x86/power/hibernate_64.c > > +++ b/arch/x86/power/hibernate_64.c > > @@ -233,7 +233,7 @@ static int get_e820_md5(struct e820map *map, void > > *buf) > > > > static void hibernation_e820_save(void *buf) { > > - get_e820_md5(&e820_saved, buf); > > + get_e820_md5(e820_saved, buf); > > } > > > > static bool hibernation_e820_mismatch(void *buf) @@ -246,7 +246,7 @@ > > static bool hibernation_e820_mismatch(void *buf) > > if (!memcmp(result, buf, MD5_DIGEST_SIZE)) > > return false; > > > > - ret = get_e820_md5(&e820_saved, result); > > + ret = get_e820_md5(e820_saved, result); > > if (ret) > > return true; > > > > > > Looks good to me, thanks Stephen! > > Rafael Thanks for the fix! I made a double check of the patch : "x86/e820: Prepare e280 code for switch to dynamic storage" It looks like this patch has reallocate the e820 & e820_save to their actual size: + size = offsetof(struct e820map, map) + sizeof(struct e820entry) * e820->nr_map; + n = kmalloc(size, GFP_KERNEL); however the previous patch to verify the md5 hash during hibernation will use the original e820_map structure by sizeof(struct e820map), which might read invalid value after the latest patch applied. I think I need to modify the hibernation e820 checking patch to only generate md5 digest based on the actual e820_save size by sizeof(struct e820entry) * e820->nr_map. I don't have a machine in hand now, will test later and give feedback later. Thanks again! Yu