]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/VMCPUFlagSelector.js
1 Ext
.define('PVE.form.VMCPUFlagSelector', {
2 extend
: 'Ext.grid.Panel',
3 alias
: 'widget.vmcpuflagselector',
6 field
: 'Ext.form.field.Field',
9 disableSelection
: true,
21 fields
: ['flag', { name
: 'state', defaultValue
: '=' }, 'desc'],
23 // FIXME: let qemu-server host this and autogenerate or get from API call??
24 { flag
: 'md-clear', desc
: 'Required to let the guest OS know if MDS is mitigated correctly' },
25 { flag
: 'pcid', desc
: 'Meltdown fix cost reduction on Westmere, Sandy-, and IvyBridge Intel CPUs' },
26 { flag
: 'spec-ctrl', desc
: 'Allows improved Spectre mitigation with Intel CPUs' },
27 { flag
: 'ssbd', desc
: 'Protection for "Speculative Store Bypass" for Intel models' },
28 { flag
: 'ibpb', desc
: 'Allows improved Spectre mitigation with AMD CPUs' },
29 { flag
: 'virt-ssbd', desc
: 'Basis for "Speculative Store Bypass" protection for AMD models' },
30 { flag
: 'amd-ssbd', desc
: 'Improves Spectre mitigation performance with AMD CPUs, best used with "virt-ssbd"' },
31 { flag
: 'amd-no-ssb', desc
: 'Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs' },
32 { flag
: 'pdpe1gb', desc
: 'Allow guest OS to use 1GB size pages, if host HW supports it' },
33 { flag
: 'hv-tlbflush', desc
: 'Improve performance in overcommitted Windows guests. May lead to guest bluescreens on old CPUs.' },
34 { flag
: 'hv-evmcs', desc
: 'Improve performance for nested virtualization. Only supported on Intel CPUs.' },
35 { flag
: 'aes', desc
: 'Activate AES instruction set for HW acceleration.' },
44 getValue: function() {
46 var store
= me
.getStore();
49 // ExtJS does not has a nice getAllRecords interface for stores :/
50 store
.queryBy(Ext
.returnTrue
).each(function(rec
) {
51 var s
= rec
.get('state');
53 var f
= rec
.get('flag');
62 flags
+= me
.unkownFlags
.join(';');
67 setValue: function(value
) {
69 var store
= me
.getStore();
71 me
.value
= value
|| '';
75 me
.getStore().queryBy(Ext
.returnTrue
).each(function(rec
) {
76 rec
.set('state', '=');
79 var flags
= value
? value
.split(';') : [];
80 flags
.forEach(function(flag
) {
81 var sign
= flag
.substr(0, 1);
82 flag
= flag
.substr(1);
84 var rec
= store
.findRecord('flag', flag
, 0, false, true, true);
86 rec
.set('state', sign
);
88 me
.unkownFlags
.push(flag
);
93 var res
= me
.mixins
.field
.setValue
.call(me
, value
);
100 renderer: function(v
) {
102 case '=': return 'Default';
103 case '-': return 'Off';
104 case '+': return 'On';
105 default: return 'Unknown';
111 xtype
: 'widgetcolumn',
114 onWidgetAttach: function(column
, widget
, record
) {
115 var val
= record
.get('state') || '=';
116 widget
.down('[inputValue=' + val
+ ']').setValue(true);
117 // TODO: disable if selected CPU model and flag are incompatible
123 validateOnChange
: false,
126 change: function(f
, value
) {
127 var v
= Object
.values(value
)[0];
128 f
.getWidgetRecord().set('state', v
);
130 var view
= this.up('grid');
131 view
.dirty
= view
.getValue() !== view
.originalValue
;
133 //view.checkChange();
139 boxLabelAlign
: 'before',
164 initComponent: function() {
167 // static class store, thus gets not recreated, so ensure defaults are set!
168 me
.getStore().data
.forEach(function(v
) {
172 me
.value
= me
.originalValue
= '';
174 me
.callParent(arguments
);