Re: [PATCH 5/5] x86/cpu-policy: Introduce some SEV features

2024-04-30 Thread Vaishali Thakkar
On 4/29/24 5:16 PM, Andrew Cooper wrote: For display purposes only right now. Signed-off-by: Andrew Cooper Reviewed-by: Vaishali Thakkar --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Xenia Ragiadakou CC: Sergiy Kibrik CC: George Dunlap CC: Andrei Semenov CC

Re: [PATCH 4/5] x86/svm: Switch SVM features over normal cpu_has_*

2024-04-29 Thread Vaishali Thakkar
which need the header. Clean up all others. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Vaishali Thakkar --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Xenia Ragiadakou CC: Sergiy Kibrik CC: George Dunlap CC: Andrei Semenov CC: Vaishali Thakkar

Re: [PATCH] x86/hvm: Allow supplying a dynamic start ASID

2024-04-16 Thread Vaishali Thakkar
On 4/16/24 4:25 PM, Vaishali Thakkar wrote: On 4/16/24 4:12 PM, Andrew Cooper wrote: On 16/04/2024 9:54 am, Vaishali Thakkar wrote: Currently, Xen always starts the ASID allocation at 1. But for SEV technologies the ASID space is divided. This is because it's a security issue if a guest

Re: [PATCH] x86/hvm: Allow supplying a dynamic start ASID

2024-04-16 Thread Vaishali Thakkar
On 4/16/24 4:12 PM, Andrew Cooper wrote: On 16/04/2024 9:54 am, Vaishali Thakkar wrote: Currently, Xen always starts the ASID allocation at 1. But for SEV technologies the ASID space is divided. This is because it's a security issue if a guest is started as ES/SNP and is migrated to SEV-only

Re: [PATCH] x86/svm: Add flushbyasid in the supported features

2024-04-16 Thread Vaishali Thakkar
On 4/16/24 3:38 PM, Andrew Cooper wrote: On 16/04/2024 10:08 am, Vaishali Thakkar wrote: TLB Flush by ASID is missing in the list of supported features here. So, add it. Signed-off-by: Vaishali Thakkar --- xen/arch/x86/hvm/svm/svm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen

[PATCH] x86/svm: Add flushbyasid in the supported features

2024-04-16 Thread Vaishali Thakkar
TLB Flush by ASID is missing in the list of supported features here. So, add it. Signed-off-by: Vaishali Thakkar --- xen/arch/x86/hvm/svm/svm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index a745acd903..4719fffae5 100644

[PATCH] x86/hvm: Allow supplying a dynamic start ASID

2024-04-16 Thread Vaishali Thakkar
min_asid to allow supplying the dynamic start ASID during the allocation process. Signed-off-by: Vaishali Thakkar --- xen/arch/x86/hvm/asid.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/asid.c b/xen/arch/x86/hvm/asid.c index 8d27b7dba1..e14b64f2c8

Re: [PATCH v1 1/2] Implemented AMD SEV discovery and enabling.

2024-04-12 Thread Vaishali Thakkar
On 4/12/24 5:07 PM, Andrew Cooper wrote: On 12/04/2024 3:38 pm, Vaishali Thakkar wrote: On 4/12/24 4:06 PM, Andrei Semenov wrote: On 4/11/24 20:32, Andrew Cooper wrote: On 10/04/2024 4:36 pm, Andrei Semenov wrote: +    } + +    if (!(cpu_has_sme || cpu_has_sev)) +    return

Re: [PATCH v1 1/2] Implemented AMD SEV discovery and enabling.

2024-04-12 Thread Vaishali Thakkar
On 4/12/24 4:06 PM, Andrei Semenov wrote: On 4/11/24 20:32, Andrew Cooper wrote: On 10/04/2024 4:36 pm, Andrei Semenov wrote: diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index ab92333673..a5903613f0 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -1030,6

Re: [PATCH v3 2/3] x86/svm: Drop the suffix _guest from vmcb bit

2024-03-18 Thread Vaishali Thakkar
On 3/14/24 17:04, Jan Beulich wrote: On 13.03.2024 17:41, Vaishali Thakkar wrote: The suffix _guest is redundant for asid bit. Drop it to avoid adding extra code volume. While we're here, replace 0/1 with false/true and use VMCB accessors instead of open coding. Suggested-by: Andrew Cooper

[PATCH v3 3/3] x86/svmdebug: Print np, sev and sev_es vmcb bits

2024-03-13 Thread Vaishali Thakkar
is in progress. And it'll be useful to have this information as part of svmdebug. Signed-off-by: Vaishali Thakkar --- Changes since v1: - Pretty printing Changes since v2: - Minor changes in pretty printing to make information clear - Improve commit log and subject

[PATCH v3 1/3] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-13 Thread Vaishali Thakkar
Cooper Signed-off-by: Vaishali Thakkar Reviewed-by: Andrew Cooper --- Changes since v1: - Address Andrew and Jan's reviews related to dropping double negation and replacing 0/1 with false/true - Fix the typo around signed-off-by Changes since v2: - Use VMCB

[PATCH v3 2/3] x86/svm: Drop the suffix _guest from vmcb bit

2024-03-13 Thread Vaishali Thakkar
The suffix _guest is redundant for asid bit. Drop it to avoid adding extra code volume. While we're here, replace 0/1 with false/true and use VMCB accessors instead of open coding. Suggested-by: Andrew Cooper Signed-off-by: Vaishali Thakkar --- Changes since v1: - This patch wasn't

[PATCH v3 0/3] Misc changes for few VMCB bits

2024-03-13 Thread Vaishali Thakkar
printing in svm-debug based on Jan's comments - Improve commit logs and the subject of patch 3 to include the changes done in v3 Vaishali Thakkar (3): x86/svm: Drop the _enabled suffix from vmcb bits x86/svm: Drop the suffix _guest from vmcb bit x86/svmdebug: Print np, sev and sev

Re: [PATCH v2 3/3] x86/svmdebug: Print sev and sev_es vmcb bits

2024-03-13 Thread Vaishali Thakkar
On 3/12/24 09:05, Jan Beulich wrote: On 11.03.2024 13:40, Vaishali Thakkar wrote: While sev and sev_es bits are not yet enabled in xen, including their status in the VMCB dump could be informational.Therefore, print it via svmdebug. Yet there are more bits there. I'm okay with leaving off

Re: [PATCH v2 1/3] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-12 Thread Vaishali Thakkar
On 3/12/24 11:49, Jan Beulich wrote: On 12.03.2024 11:00, Vaishali Thakkar wrote: On 3/12/24 08:54, Jan Beulich wrote: On 11.03.2024 13:40, Vaishali Thakkar wrote: --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -571,7 +571,7 @@ static int

Re: [PATCH v2 2/3] x86/svm: Drop the suffix _guest from vmcb bit

2024-03-12 Thread Vaishali Thakkar
On 3/12/24 08:59, Jan Beulich wrote: On 11.03.2024 13:40, Vaishali Thakkar wrote: @@ -698,11 +698,11 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs, /* Convert explicitely to boolean. Deals with l1 guests * that use flush-by-asid w/o checking the cpuid bits

Re: [PATCH v2 1/3] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-12 Thread Vaishali Thakkar
On 3/12/24 08:54, Jan Beulich wrote: On 11.03.2024 13:40, Vaishali Thakkar wrote: --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -571,7 +571,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs

[PATCH v2 1/3] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-11 Thread Vaishali Thakkar
The suffix is redundant for np/sev/sev-es bits. Drop it to avoid adding extra code volume. While we're here, drop the double negations in one of the instances of _np bit and replace 0/1 with false/true in the use cases of _np. Suggested-by: Andrew Cooper Signed-off-by: Vaishali Thakkar Reviewed

[PATCH v2 3/3] x86/svmdebug: Print sev and sev_es vmcb bits

2024-03-11 Thread Vaishali Thakkar
While sev and sev_es bits are not yet enabled in xen, including their status in the VMCB dump could be informational.Therefore, print it via svmdebug. Signed-off-by: Vaishali Thakkar --- Changes since v1: - Pretty printing --- xen/arch/x86/hvm/svm/svmdebug.c | 7 +-- 1 file changed

[PATCH v2 2/3] x86/svm: Drop the suffix _guest from vmcb bit

2024-03-11 Thread Vaishali Thakkar
The suffix _guest is redundant for asid bit. Drop it to avoid adding extra code volume. Suggested-by: Andrew Cooper Signed-off-by: Vaishali Thakkar --- Changes since v1: - This patch wasn't part of v1. It's been added to address Andrew's suggestion. --- xen/arch/x86/hvm/svm

[PATCH v2 0/3] x86/svm : Misc changes for few vmcb bits

2024-03-11 Thread Vaishali Thakkar
per Andrew's suggestion in one of the reviews - Address Andrew's comment with respect to pretty printing Vaishali Thakkar (3): x86/svm: Drop the _enabled suffix from vmcb bits x86/svm: Drop the suffix _guest from vmcb bit x86/svmdebug: Print sev and sev_es vmcb bits xen/arch/x86/hvm

Re: [PATCH 2/2] x86/svmdebug: Print sev and sev_es vmcb bits

2024-03-07 Thread Vaishali Thakkar
On 3/8/24 00:34, Andrew Cooper wrote: On 07/03/2024 9:40 pm, Vaishali Thakkar wrote: diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c index 24358c6eea..f54b426fb3 100644 --- a/xen/arch/x86/hvm/svm/svmdebug.c +++ b/xen/arch/x86/hvm/svm/svmdebug.c @@ -53,6 +53,8

Re: [PATCH 1/2] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-07 Thread Vaishali Thakkar
On 3/8/24 00:22, Andrew Cooper wrote: On 07/03/2024 9:40 pm, Vaishali Thakkar wrote: The suffix is redundant for np/sev/sev-es bits. Drop it to avoid adding extra code volume. Suggested-by: Andrew Cooper Signed-off-by: Vaishali Thakkar i Typo on the end of your email address? Oops, thanks

[PATCH 0/2] x86/svm : Misc changes for few vmcb bits

2024-03-07 Thread Vaishali Thakkar
Hi, In this patchset, first patch removes the unnecessary suffix from a bunch of vmcb bits and the second patch is about printing the status of sev and sev-es bits while dumping VMCB. Vaishali Thakkar (2): x86/svm: Drop the _enabled suffix from vmcb bits x86/svmdebug: Print sev and sev_es

[PATCH 2/2] x86/svmdebug: Print sev and sev_es vmcb bits

2024-03-07 Thread Vaishali Thakkar
While sev and sev_es bits are not yet enabled in xen, including their status in the VMCB dump could be informational.Therefore, print it via svmdebug. Signed-off-by: Vaishali Thakkar --- JFYI, we'll send the follow-up patches with the enablement of sev and ASP driver. --- xen/arch/x86/hvm/svm

[PATCH 1/2] x86/svm: Drop the _enabled suffix from vmcb bits

2024-03-07 Thread Vaishali Thakkar
The suffix is redundant for np/sev/sev-es bits. Drop it to avoid adding extra code volume. Suggested-by: Andrew Cooper Signed-off-by: Vaishali Thakkar i --- xen/arch/x86/hvm/svm/nestedsvm.c| 14 +++--- xen/arch/x86/hvm/svm/svm.c | 2 +- xen/arch/x86/hvm/svm/vmcb.c

AMD SEV Enablement plans in Xen

2023-10-30 Thread Vaishali Thakkar
Hi All, This is an informational post about our plans for the enablement of AMD SEV support in Xen. This work will be done as part of the Hyper OpenX project[1]. Phase Zero: Our primary intention is to gather the necessary information required to commence the upstream work