|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V3] x86, amd_ucode: Support multiple container files appended together
On 6/27/2014 5:50 AM, Jan Beulich wrote: On 25.06.14 at 21:34, <aravind.gopalakrishnan@xxxxxxx> wrote:This patch adds support for parsing through multiple AMD container binaries concatenated together. It is a feature already present in Linux. Link to linux patch: http://lkml.kernel.org/r/1370463236-2115-3-git-send-email-jacob.shin@xxxxxxx Other changes introduced: - Define HDR_SIZE's explicitly for code clarity. Changes in V3 - Change approach that used AMD_MAX_CONT_APPEND to handle edge case - No need of a 'found' variable - return 0 for success and not AMD_UCODE_APPLY_SUCCESS as someone could just as easily break things by redefining it as bool - No need of 'header' in container_fast_forward - Handle more corner cases in container_fast_forward - Fix code style issuesCan you please get used to put this revision log after the first --- marker? It doesn't belong in ti actual commit message. Okay. @@ -272,14 +293,13 @@ static int get_ucode_from_buffer_amd(static int install_equiv_cpu_table( Yes, I thought I'll handle it as a separate cleanup patch as it was not directly related to the subject of the patch. But it's a small change, so I'll do this and include it in the commit message as well..
Okay. Will just use the bits in V2 with a const qualifier + if ( size_left < size ) + return -EINVAL; + + size_left -= size; + *offset += size;Endless loop if size ends up being zero? (If you do such verifications at all, you should perhaps be as strict as possible, Sorry about that (Again). Will fix. i.e. if size is required to be a multiple of 4 [which I think it is], you should also check that.) I don't think that's a rule per-se. #define F16H_MPB_MAX_SIZE 3458 Which is indivisible by 4.
Ok, Shall use one or the other.. (Probably the goto as I see that's the favored one in this function)
Yes. Wrong word. Will fix.
Maybe the comment needs to be more verbose(?) Yes, we found a match and yes, we applied the patch successfully.But, while ( (error = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,&offset)) == 0 ) is going to, at some point hit if ( mpbuf->type != UCODE_UCODE_TYPE ) and return -EINVAL which is assigned to the variable 'error'(Assuming ofc that there is a second container there which we don't need to parse because we have already succeeded in patch application) This is what I wanted to convey from "astale bogus error val is returned from get_ucode_from_buffer_amd."But, we need to return 0 on success; which is why this change is needed here..
Hmm.. I'm having trouble trying to re-word this comment then.. Given the situation where - we have already applied the patch update after 'microcode_presmp_init' and 'microcode_resume_cpu'; | v Now 'microcode_init' runs and calls into 'cpu_request_microcode'; | v We use 1st while loop to find_equiv_cpu_id() and match it with the container | vFor this particular case, we assume it's a match on the 1st container; so break | vEnter while ( (error = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,&offset)) == 0 ) | vAt some point, it will find the correct patch; but this time there is no need to update | v The behavior is now similar to what I have described above. i.ewhile ( (error = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,&offset)) == 0 ) is going to, at some point hit if ( mpbuf->type != UCODE_UCODE_TYPE ) and return -EINVAL which is assigned to the variable 'error' | v But, now (as stated in the comment..) * Only this time, there is no 'applied_offset' as well. + * So, 'save_error' = 1. But error = -EINVAL. | v And since we need to return 0 for success, this change is needed here. Thanks, -Aravind _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |