qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v4 08/36] i386/tdx: Adjust get_supported_cpuid() for TDX


From: Xiaoyao Li
Subject: Re: [RFC PATCH v4 08/36] i386/tdx: Adjust get_supported_cpuid() for TDX VM
Date: Mon, 23 May 2022 23:37:18 +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/23/2022 5:01 PM, Gerd Hoffmann wrote:
   Hi,

- The supported XCR0 and XSS bits needs to be cap'ed by tdx_caps, because
   KVM uses them to setup XFAM of TD.

+    case 0xd:
+        if (index == 0) {
+            if (reg == R_EAX) {
+                *ret &= (uint32_t)tdx_caps->xfam_fixed0 & XCR0_MASK;
+                *ret |= (uint32_t)tdx_caps->xfam_fixed1 & XCR0_MASK;
+            } else if (reg == R_EDX) {
+                *ret &= (tdx_caps->xfam_fixed0 & XCR0_MASK) >> 32;
+                *ret |= (tdx_caps->xfam_fixed1 & XCR0_MASK) >> 32;
+            }
+        } else if (index == 1) {
+            /* TODO: Adjust XSS when it's supported. */
+        }
+        break;

+    default:
+        /* TODO: Use tdx_caps to adjust CPUID leafs. */
+        break;

Hmm, that looks all a bit messy and incomplete, also the commit
message doesn't match the patch (describes XSS which isn't actually
implemented).

For XSS, QEMU recently got XSS MASK defined, I will use it in this patch.

For other CPUID leaves, we have following patches (a series) to enable fine-grained feature control for TDX guest and CPU model for it. So the plan is to make it functional with no error in this basic series. Anyway I will update the commit message to describe clearly.

take care,
   Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]