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
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
On 5/27/2022 2:48 AM, Isaku Yamahata wrote:
On Thu, May 26, 2022 at 03:33:10PM +0800,
Xiaoyao Li wrote:
On 5/24/2022 3:37 PM, Gerd Hoffmann wrote:
I think all this can be simplified, by
(1) Change the existing entry to cover the accepted ram range.
(2) If there is room before the
On 5/26/2022 3:33 PM, Xiaoyao Li wrote:
On 5/24/2022 3:37 PM, Gerd Hoffmann wrote:
+ if (e->address == address && e->length == length) {
+ e->type = TDX_RAM_ADDED;
+ } else if (e->address == address) {
+ e->address += length;
+ e->length -=
On Thu, May 26, 2022 at 03:33:10PM +0800,
Xiaoyao Li wrote:
> On 5/24/2022 3:37 PM, Gerd Hoffmann wrote:
> > I think all this can be simplified, by
> >(1) Change the existing entry to cover the accepted ram range.
> >(2) If there is room before the accepted ram range add a
> >
On 5/24/2022 3:37 PM, Gerd Hoffmann wrote:
+static int tdx_accept_ram_range(uint64_t address, uint64_t length)
+{
+TdxRamEntry *e;
+int i;
+
+for (i = 0; i < tdx_guest->nr_ram_entries; i++) {
+e = _guest->ram_entries[i];
+
+if (address + length < e->address ||
+
> +static int tdx_accept_ram_range(uint64_t address, uint64_t length)
> +{
> +TdxRamEntry *e;
> +int i;
> +
> +for (i = 0; i < tdx_guest->nr_ram_entries; i++) {
> +e = _guest->ram_entries[i];
> +
> +if (address + length < e->address ||
> +e->address +
The RAM of TDX VM can be classified into two types:
- TDX_RAM_UNACCEPTED: default type of TDX memory, which needs to be
accepted by TDX guest before it can be used and will be all-zeros
after being accepted.
- TDX_RAM_ADDED: the RAM that is ADD'ed to TD guest before running, and
can