[pve-devel] [PATCH pve-kernel] update sources to Ubuntu-5.15.0-82.91

2023-08-17 Thread Stoiko Ivanov
(generated with debian/scripts/import-upstream-tag)

Signed-off-by: Stoiko Ivanov 
---
* This jammy release was just pushed today.
* as opposed to the fixes I sent for kernel 6.2/PVE 8.0 Ubuntu disabled
  the forced mitigation for GDS_FORCE_MITIGATION - judging from internal
  feedback (about quite a lot of programs not running without AVX) we might
  consider switching it to off there too)
* minimally tested in a PVE 7.4 VM on a host with affected CPU

 submodules/ubuntu-kernel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/submodules/ubuntu-kernel b/submodules/ubuntu-kernel
index ee33ef60c069..922997e0e0f1 16
--- a/submodules/ubuntu-kernel
+++ b/submodules/ubuntu-kernel
@@ -1 +1 @@
-Subproject commit ee33ef60c06953b1aab7d5fcd7369e7a9d80afef
+Subproject commit 922997e0e0f11ccb283099ce694b9e80e7996af1
-- 
2.39.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH manager v5 5/5] ui: MachineEdit with viommu checkbox

2023-08-17 Thread Fiona Ebner
Am 18.01.23 um 14:58 schrieb Markus Frank:
> @@ -38,14 +54,27 @@ Ext.define('PVE.qemu.MachineInputPanel', {
>   if (values.version && values.version !== 'latest') {
>   values.machine = values.version;
>   delete values.delete;
> + } else if (values.machine === undefined && values.viommu) {
> + // set machine to pc to raise the viommu + i440fx error
> + // from qemu-server instead of a regex error
> + values.machine = "pc";
> + delete values.delete;
>   }
>   delete values.version;
> + if (values.viommu) {
> + values.machine += ",viommu=1";
> + }

Nit: could use PVE.Parser.printPropertyString but no big deal

> + delete values.viommu;
> + delete values.kvm;
>   return values;
>  },
>  
>  setValues: function(values) {
>   let me = this;
>  
> + let machineConf = PVE.Parser.parsePropertyString(values.machine, 
> "type");
> + values.machine = machineConf.type;
> +
>   me.isWindows = values.isWindows;
>   if (values.machine === 'pc') {
>   values.machine = '__default__';
> @@ -58,6 +87,11 @@ Ext.define('PVE.qemu.MachineInputPanel', {
>   values.version = 'pc-q35-5.1';
>   }
>   }
> +
> + me.lookup('kvm').setValue(values.kvm);
> + values.viommu = machineConf.viommu === '1';

Should be PVE.Parser.parseBoolean to cover all cases (i.e. also 'on',
'yes' and 'true' can be in the config)

> + me.lookup('viommu').setValue(values.viommu);
> +
>   if (values.machine !== '__default__' && values.machine !== 'q35') {
>   values.version = values.machine;
>   values.machine = values.version.match(/q35/) ? 'q35' : 
> '__default__';
> @@ -113,6 +147,26 @@ Ext.define('PVE.qemu.MachineInputPanel', {
>   fieldLabel: gettext('Note'),
>   value: gettext('Machine version change may affect hardware layout 
> and settings in the guest OS.'),
>   },
> + {
> + xtype: 'proxmoxcheckbox',
> + fieldLabel: gettext('vIOMMU'),
> + name: 'viommu',
> + reference: 'viommu',
> + },
> + {
> + xtype: 'proxmoxcheckbox',
> + name: 'kvm',
> + reference: 'kvm',
> + hidden: true,
> + },

Why handle 'kvm' as an UI element? I guess a view model property would
be the natural place for this.

> + {
> + xtype: 'displayfield',
> + name: 'kvmQ35Hint',
> + reference: 'kvmQ35Hint',
> + userCls: 'pmx-hint',
> + value: gettext('vIOMMU needs kvm enabled and q35 firmware'),

s/firmware/machine type/

> + hidden: true,
> + },
>  ],
>  });
>  
> @@ -135,8 +189,12 @@ Ext.define('PVE.qemu.MachineEdit', {
>   me.load({
>   success: function(response) {
>   let conf = response.result.data;
> + if (conf.kvm === undefined || conf.kvm === null) {
> + conf.kvm = 1;
> + }

Style nit: could be one line with conf.kvm ??= 1;

>   let values = {
>   machine: conf.machine || '__default__',
> + kvm: conf.kvm,
>   };
>   values.isWindows = PVE.Utils.is_windows(conf.ostype);
>   me.setValues(values);


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH docs v5 4/5] added vIOMMU documentation

2023-08-17 Thread Fiona Ebner
Am 18.01.23 um 14:57 schrieb Markus Frank:
> Signed-off-by: Markus Frank 
> ---
>  qm-pci-passthrough.adoc | 25 +
>  1 file changed, 25 insertions(+)
> 
> diff --git a/qm-pci-passthrough.adoc b/qm-pci-passthrough.adoc
> index df6cf21..0db9b06 100644
> --- a/qm-pci-passthrough.adoc
> +++ b/qm-pci-passthrough.adoc
> @@ -400,6 +400,31 @@ Example configuration with an `Intel GVT-g vGPU` (`Intel 
> Skylake 6700k`):
>  With this set, {pve} automatically creates such a device on VM start, and
>  cleans it up again when the VM stops.
>  
> +[[qm_pci_viommu]]
> +vIOMMU
> +~~
> +
> +vIOMMU enables the option to passthrough pci devices to Level-2 VMs
> +in Level-1 VMs via Nested Virtualisation.

Nit: "PCI" should be capitalized, "level" and "nested virtualization" not.

Instead of "vIOMMU enables the option to" maybe "Using a vIOMMU allows
you to" or "With a vIOMMU you can" are slightly better IMHO.

> +> +Host Requirement: Add `intel_iommu=on` or `amd_iommu=on`
> +depending on your CPU to your kernel command line.

Nit: capitalization of "Requirement" here. You could argue it's a title,
but not sure.

> +
> +VM Requirement: For both Intel and AMD CPUs, set `intel_iommu=on`
> +as the kernel parameter in the vIOMMU enabled VM, since qemu-server currently
> +uses the Intel variant. The guest vIOMMU only works with the *q35* machine
> +type and with *kvm* enabled.

A quick sentence why we use the Intel variant might be good

> +
> +To enable vIOMMU, add `viommu=1` to the machine-parameter in the
> +configuration of the VM that should be able to passthrough pci devices.

Nit: "PCI"

> +
> +
> +# qm set VMID -machine q35,viommu=1
> +
> +
> +
> +https://wiki.qemu.org/Features/VT-d
> +
>  ifdef::wiki[]
>  
>  See Also


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH qemu-server v5 2/5] feature #3784: Parameter for guest vIOMMU & machine as property-string

2023-08-17 Thread Fiona Ebner
Am 18.01.23 um 14:57 schrieb Markus Frank:
> vIOMMU enables the option to passthrough pci devices to L2 VMs
> in L1 VMs via Nested Virtualisation.
> 
> QEMU-Parameters:
> https://www.qemu.org/docs/master/system/qemu-manpage.html
> https://wiki.qemu.org/Features/VT-d
> 
> -machine ...,kernel-irqchip=split:
> 
> "split" because of intremap see below.
> 
> -device intel-iommu:
> 
> * caching-mode=on:
> 
> "It is required for -device vfio-pci to work with the VT-d device, because 
> host
> assigned devices requires to setup the DMA mapping on the host before guest 
> DMA
> starts."
> 
> * intremap=on:
> 
> "This enables interrupt remapping feature. It's required to enable complete
> x2apic. Currently it only supports kvm kernel-irqchip modes off or split, 
> while
> full kernel-irqchip is not yet supported."
> 
> Signed-off-by: Markus Frank 
> ---

This one needs a rebase

(...)

> + my $q35 = $machine_conf->{type} && ($machine_conf->{type} 
> =~ m/q35/) ? 1 : 0;
> + my $kvm = $conf->{kvm};
> + $kvm //= 1 if PVE::QemuServer::is_native($arch);
> + if ($machine_conf->{viommu} && (!$kvm || !$q35)) {
> + die "to use vIOMMU please enable kvm and set the 
> machine type to q35\n";
> + }
>  
>   PVE::QemuConfig->write_config($vmid, $conf);
>  
> @@ -1770,7 +1778,16 @@ my $update_vm_api  = sub {
>   } elsif ($opt eq 'tags') {
>   assert_tag_permissions($vmid, $conf->{$opt}, 
> $param->{$opt}, $rpcenv, $authuser);
>   $conf->{pending}->{$opt} = 
> PVE::GuestHelpers::get_unique_tags($param->{$opt});
> - } else {
> + } elsif ($opt eq 'machine') {
> + my $machine_conf = 
> PVE::QemuServer::parse_machine($param->{$opt});
> + my $q35 = $machine_conf->{type} && ($machine_conf->{type} 
> =~ m/q35/) ? 1 : 0;
> + my $kvm = $conf->{kvm};
> + $kvm //= 1 if PVE::QemuServer::is_native($arch);
> + if ($machine_conf->{viommu} && (!$kvm || !$q35)) {
> + die "to use vIOMMU please enable kvm and set the 
> machine type to q35\n";
> + }

Maybe worth adding a helper function taking in the config and the
machine option. It's the very same check as above.

> + $conf->{pending}->{$opt} = $param->{$opt};
> + }else {

Style nit: missing space before else

>   $conf->{pending}->{$opt} = $param->{$opt};
>  
>   if ($opt eq 'boot') {
> diff --git a/PVE/QemuConfig.pm b/PVE/QemuConfig.pm
> index 051382c..7c998ef 100644
> --- a/PVE/QemuConfig.pm
> +++ b/PVE/QemuConfig.pm
> @@ -433,7 +433,8 @@ sub __snapshot_rollback_hook {
>   } else {
>   # Note: old code did not store 'machine', so we try to be smart
>   # and guess the snapshot was generated with kvm 1.4 (pc-i440fx-1.4).
> - $data->{forcemachine} = $conf->{machine} || 'pc-i440fx-1.4';
> + my $machine_conf = PVE::QemuServer::parse_machine($conf->{machine});
> + $data->{forcemachine} = $machine_conf->{type} || 'pc-i440fx-1.4';
>  
>   # we remove the 'machine' configuration if not explicitly specified
>   # in the original config.
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 987908d..55c11d5 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -124,6 +124,19 @@ 
> PVE::JSONSchema::register_standard_option('pve-qemu-machine', {
>   optional => 1,
>  });
>  
> +my $machine_fmt = {
> +type => get_standard_option('pve-qemu-machine', {

Any reason against changing the standard option itself to be the whole
property string rather than keep the option just being the type? I
noticed that 'runningmachine' still uses only
"get_standard_option('pve-qemu-machine'", but that is wrong after this
patch. Changing the standard option itself would avoid that.

> + default_key => 1,
> + format_description => "pve-qemu-machine-type",

That format description is not very telling at all. Usually, this is
used to clarify what exact format the string is, e.g. base64. I don't
think it's needed here and there's already a description of the property
itself.

> +}),
> +viommu => {
> + type => 'boolean',
> + description => "enable guest vIOMMU (needs kvm to be enabled and q35 to 
> be set as machine)",

Nit: "as machine type" sounds slightly better now that machine is more
than just the type

> + default => 0,
> + optional => 1,
> +},
> +};
> +
>  # FIXME: remove in favor of just using the INotify one, it's cached there 
> exactly the same way
>  my $nodename_cache;
>  sub nodename {
> @@ -626,7 +639,12 @@ EODESCR
>   pattern => $PVE::QemuServer::CPUConfig::qemu_cmdline_cpu_re,
>   format_description => 'QEMU -cpu parameter'
>  },
> -machine => get_standard_option('pve-qemu-machine'),
> +machine => {
> + description => 

[pve-devel] applied: [PATCH pve-kernel 0/2] cherry-picks and config-options for downfall

2023-08-17 Thread Wolfgang Bumiller
applied, thanks


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: [PATCH kernel] add patch for igc tx timeout issue

2023-08-17 Thread Wolfgang Bumiller
applied yesterday, forgot to reply


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] applied: [PATCH qemu-server v5 1/5] tests: replaced somemachine with q35

2023-08-17 Thread Fiona Ebner
Am 18.01.23 um 14:57 schrieb Markus Frank:
> needed for new machine parameter
> 
> parse_property_string checks for the regex, therefore the test-cases
> with somemachine & someothermachine always fail.
> 
> So I changed somemachine & someothermachine to q35 & pc with sed
> 
> sed -i 's/somemachine/q35/g'
> sed -i 's/someothermachine/pc/g'
> 
> Signed-off-by: Markus Frank 

applied, thanks! Changed the commit message and title a bit, to
(hopefully) make it slightly more readable.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel