From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: wang xiaofeng <winggundum82@163.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: CapsuleApp behavior for CAPSULE_FLAGS_PERSIST_ACROSS_RESET only capsule
Date: Fri, 10 Feb 2017 11:24:55 +0000 [thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8ECA16@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <28c4c5b8.944a.15a27590e40.Coremail.winggundum82@163.com>
That is an interesting question.
A general rule for Capsule App is:
1) If a capsule has CAPSULE_FLAGS_INITIATE_RESET, the CapsuleService will issue reset. No need to handler in CapsuleApp. (The free memory logic will not run)
2) If a capsule has CAPSULE_FLAGS_PERSIST_ACROSS_RESET, the CapsuleService will not issue reset, because CapsuleService will let caller decide when to reset. So here CapsuleApp does reset. (The free memory logic will not run)
3) If a capsule has no CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag, the CapsuleService processes the image immediately. Then CapsuleApp can free the buffer finally, because it is already processed.
May I know where you think we have logic error?
Thank you
Yao Jiewen
From: wang xiaofeng [mailto:winggundum82@163.com]
Sent: Friday, February 10, 2017 1:27 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org
Subject: CapsuleApp behavior for CAPSULE_FLAGS_PERSIST_ACROSS_RESET only capsule
Hi Jiewen,
I think it might be a logic error for CapsuleApp with CAPSULE_FLAGS_PERSIST_ACROSS_RESET only capsule. If a capsule only have CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag, my understanding it will not trigger reset automatially. User will trigger reset(S3) in OS or application like CapsuleApp.
CapsuleApp will not trigger reset if CAPSULE_FLAGS_INITIATE_RESET is not set, the problem is it will free the capsule buffer also!
Done:
for (Index = 0; Index < CapsuleNum; Index++) {
if (CapsuleBuffer[Index] != NULL) {
FreePool (CapsuleBuffer[Index]);
}
}
CleanGatherList(BlockDescriptors, CapsuleNum);
I trited to remove the above free buffer logic and capsuleApp can work with CAPSULE_FLAGS_INITIATE_RESET only attribute. The capsule data should be kept in this case
next prev parent reply other threads:[~2017-02-10 11:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 6:33 [PATCH] SignedCapsulePkg/EdkiiSystemCapsuleLib: Fix logic error Jiewen Yao
2017-02-07 8:58 ` wang xiaofeng
2017-02-10 9:27 ` CapsuleApp behavior for CAPSULE_FLAGS_PERSIST_ACROSS_RESET only capsule wang xiaofeng
2017-02-10 11:24 ` Yao, Jiewen [this message]
2017-02-13 2:09 ` wang xiaofeng
2017-02-13 3:52 ` Yao, Jiewen
2017-02-13 4:46 ` wang xiaofeng
2017-02-17 1:23 ` Yao, Jiewen
2017-02-17 1:38 ` wang xiaofeng
2017-02-20 1:27 ` wang xiaofeng
2017-02-23 11:21 ` Tcg2Pei.efi assert after sync to latest trunk wang xiaofeng
2017-02-23 13:01 ` Gao, Liming
2017-02-24 5:08 ` wang xiaofeng
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-list 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=74D8A39837DF1E4DA445A8C0B3885C503A8ECA16@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/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