|
From: | Xiaoyao Li |
Subject: | Re: [RFC PATCH v4 22/36] i386/tdx: Track RAM entries for TDX VM |
Date: | Tue, 31 May 2022 10:09:49 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.9.0 |
On 5/30/2022 7:59 PM, Gerd Hoffmann wrote:
Hi,tdx_add_ram_entry() increments tdx_guest->nr_ram_entries. I think it's worth for comments why this is safe regarding to this for-loop.The for-loop is to find the valid existing RAM entry (from E820 table). It will update the RAM entry and increment tdx_guest->nr_ram_entries when the initial RAM entry needs to be split. However, once find, the for-loop is certainly stopped since it returns unconditionally.Add a comment saying so would be good. Or move the code block doing the update out of the loop. That will likewise make clear that finding the entry which must be updated is the only purpose of the loop.
Good idea. I'll go this way.
take care, Gerd
[Prev in Thread] | Current Thread | [Next in Thread] |