From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 35BF11FF191 for ; Tue, 7 Oct 2025 17:24:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2C3981C6AE; Tue, 7 Oct 2025 17:24:59 +0200 (CEST) Message-ID: Date: Tue, 7 Oct 2025 17:24:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Anton Iacobaeus References: <20251001151237.50385-1-anton.iacobaeus@canarybit.eu> <20251001151237.50385-6-anton.iacobaeus@canarybit.eu> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20251001151237.50385-6-anton.iacobaeus@canarybit.eu> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759850665139 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server v2 1/3] Adapt AMD SEV code for compatibility with other platforms X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Philipp Giersfeld Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" I plan to continue with the review tomorrow, looking good so far :)! Am 04.10.25 um 3:24 PM schrieb Anton Iacobaeus: > From: Philipp Giersfeld > > Change variable and function names that are specific to AMD SEV to > reflect this. Also, change name of general CC functions and variable > names to be used in conjunction with other platforms. > > Signed-off-by: Philipp Giersfeld > Signed-off-by: Anton Iacobaeus Reviewed-by: Fiona Ebner > --- Note for applying: needs a depends and build-depends on new pve-edk2-firmware-ovmf > @@ -49,19 +49,19 @@ my $OVMF = { > }; > > my sub get_ovmf_files($$$$) { > - my ($arch, $efidisk, $smm, $amd_sev_type) = @_; > + my ($arch, $efidisk, $smm, $cvm_type) = @_; > > my $types = $OVMF->{$arch} > or die "no OVMF images known for architecture '$arch'\n"; > > my $type = 'default'; > if ($arch eq 'x86_64') { > - if ($amd_sev_type && $amd_sev_type eq 'snp') { > + if ($cvm_type && $cvm_type eq 'snp') { > $type = "4m-snp"; > my ($ovmf) = $types->{$type}->@*; > die "EFI base image '$ovmf' not found\n" if !-f $ovmf; > return ($ovmf); > - } elsif ($amd_sev_type) { > + } elsif ($cvm_type && ($cvm_type eq 'std' || $cvm_type eq 'es')) { > $type = "4m-sev"; Nit and this is pre-existing, but it would be nice to detect an unknown type here for future-proofing/robustness (Perl's lack of type system makes this hard to enforce up-front). Something like } elsif ($cmv_type) { die "unknown CMV type $cmv_type\n"; But this should be a separate patch and can also be done as a follow-up after adding the branch for the Intel one. > } elsif (defined($efidisk->{efitype}) && $efidisk->{efitype} eq '4m') { > $type = $smm ? "4m" : "4m-no-smm"; > @@ -203,16 +203,16 @@ my sub generate_ovmf_blockdev { > sub print_ovmf_commandline { > my ($conf, $storecfg, $vmid, $hw_info, $version_guard, $readonly) = @_; > > - my $amd_sev_type = $hw_info->{'amd-sev-type'}; > + my $cvm_type = $hw_info->{'cvm-type'}; > > my $cmd = []; > my $machine_flags = []; > > - if ($amd_sev_type && $amd_sev_type eq 'snp') { > + if ($cvm_type && $cvm_type eq 'snp') { > if (defined($conf->{efidisk0})) { > - log_warn("EFI disks are not supported with SEV-SNP and will be ignored"); > + log_warn("EFI disks are not supported with Confidential Virtual Machines and will be ignored"); Style nit: line longer than 100 characters > } > - push $cmd->@*, '-bios', get_ovmf_files($hw_info->{arch}, undef, undef, $amd_sev_type); > + push $cmd->@*, '-bios', get_ovmf_files($hw_info->{arch}, undef, undef, $cvm_type); > } else { > if ($version_guard->(10, 0, 0)) { # for the switch to -blockdev > my ($code_blockdev, $vars_blockdev, $throttle_group) = _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel