Hello,
I noticed that currently I cannot disable 'allow-smt' in the WebUI.
The default value for allow-smt in qemu-server is '1'.
So setting it to 1 or no value in the WebUI results in allow-smt always being
enabled.
To fix this, you can explicitly set allow-smt to 0 when the checkbox is not
checked.
Also, currently if I uncheck the allow-smt checkbox, save it to config and then
reopen the window, the 'Allow SMT' checkbox is checked again.
See my suggested fixes inline:
On 2025-03-11 16:04, Philipp Giersfeld wrote:
Expand input panel with AMD SEV-SNP selection, and relevant optional
parameters similar to existing options for AMD SEV(-ES).
Further, upon selecting AMD SEV-SNP, issue a warning that EFI disks are
not included when using SEV-SNP.
Signed-off-by: Philipp Giersfeld <philipp.giersf...@canarybit.eu>
Reviewed-by: Daniel Kral <d.k...@proxmox.com>
---
no changes since last version
www/manager6/qemu/Options.js | 1 +
www/manager6/qemu/SevEdit.js | 46 ++++++++++++++++++++++++++++++++----
2 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index cbe9e52b..49a921cd 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -346,6 +346,7 @@ Ext.define('PVE.qemu.Options', {
let amd_sev = PVE.Parser.parsePropertyString(value, "type");
if (amd_sev.type === 'std') return 'AMD SEV (' + value +
')';
if (amd_sev.type === 'es') return 'AMD SEV-ES (' + value +
')';
+ if (amd_sev.type === 'snp') return 'AMD SEV-SNP (' + value
+ ')';
return value;
},
},
diff --git a/www/manager6/qemu/SevEdit.js b/www/manager6/qemu/SevEdit.js
index a2080f2d..3e0d0cbb 100644
--- a/www/manager6/qemu/SevEdit.js
+++ b/www/manager6/qemu/SevEdit.js
@@ -9,7 +9,8 @@ Ext.define('PVE.qemu.SevInputPanel', {
type: '__default__',
},
formulas: {
- sevEnabled: get => get('type') !== '__default__',
+ sevEnabled: get => get('type') === 'std' || get('type') === 'es' ||
get('type') === 'snp',
+ snpEnabled: get => get('type') === 'snp',
},
},
@@ -21,10 +22,14 @@ Ext.define('PVE.qemu.SevInputPanel', {
if (!values.debug) {
values["no-debug"] = 1;
}
- if (!values["key-sharing"]) {
+ if (values.smt) {
+ values["allow-smt"] = 1;
+ }
You could replace the if above with something like this:
if (!values.smt && values.type === 'snp') {
values["allow-smt"] = 0;
}
+ if (!values["key-sharing"] && values.type !== 'snp') {
values["no-key-sharing"] = 1;
}
delete values.debug;
+ delete values.smt;
delete values["key-sharing"];
let ret = {};
ret['amd-sev'] = PVE.Parser.printPropertyString(values, 'type');
@@ -36,13 +41,16 @@ Ext.define('PVE.qemu.SevInputPanel', {
if (PVE.Parser.parseBoolean(values["no-debug"])) {
values.debug = 0;
}
+ if (PVE.Parser.parseBoolean(values["allow-smt"])) {
+ values.smt = 1;
+ }
You could replace the if above with something like this:
values.smt = PVE.Parser.parseBoolean(values["allow-smt"], 1);
if (PVE.Parser.parseBoolean(values["no-key-sharing"])) {
values["key-sharing"] = 0;
}
this.callParent(arguments);
},
- items: {
+ items: [{
xtype: 'proxmoxKVComboBox',
fieldLabel: gettext('AMD SEV Type'),
labelWidth: 150,
@@ -52,11 +60,28 @@ Ext.define('PVE.qemu.SevInputPanel', {
['__default__', Proxmox.Utils.defaultText + ' (' +
Proxmox.Utils.disabledText + ')'],
['std', 'AMD SEV'],
['es', 'AMD SEV-ES (highly experimental)'],
+ ['snp', 'AMD SEV-SNP (highly experimental)'],
],
bind: {
value: '{type}',
},
},
+ {
+ xtype: 'displayfield',
+ userCls: 'pmx-hint',
+ value: gettext('WARNING: When using SEV-SNP no EFI disk is loaded as
pflash.'),
+ bind: {
+ hidden: '{!snpEnabled}',
+ },
+ },
+ {
+ xtype: 'displayfield',
+ userCls: 'pmx-hint',
+ value: gettext('Note: SEV-SNP requires host kernel version 6.11 or
higher.'),
+ bind: {
+ hidden: '{!snpEnabled}',
+ },
+ }],
advancedItems: [
{
@@ -77,8 +102,19 @@ Ext.define('PVE.qemu.SevInputPanel', {
name: 'key-sharing',
value: 1,
bind: {
- hidden: '{!sevEnabled}',
- disabled: '{!sevEnabled}',
+ hidden: '{!sevEnabled || snpEnabled}',
+ disabled: '{!sevEnabled || snpEnabled}',
+ },
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ fieldLabel: gettext('Allow SMT'),
+ labelWidth: 150,
+ name: 'smt',
+ value: 1,
+ bind: {
+ hidden: '{!snpEnabled}',
+ disabled: '{!snpEnabled}',
},
},
{
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel