From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087172; cv=none; d=zohomail.com; s=zohoarc; b=EnvF/TBTaK70PMYc49HWaD95eyataUnNfsGS5GeGR7VgIeIJYbo47+kQvXYQuw3lnpbhaRsNjAWzRFFl30EDloQplDkWdCFyRncMUYpzk0Go5g7IcjQTpFLBfg5FMKryOsKzGMuH9dLQojowyX8lpIOSUA1voSu6pUteMZdjhfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087172; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=EYG7z0+92zsKHX2B0kS2w6WkiJ9TG5QWULKkYSPwyBU=; b=OnU9Js6B15IT3SUM6xqZkrQX2mLww1WeGKJ/LeMqONcR8MD2lKI2yT3vBc4lSrj5QYiBroSSL1ghtrvImoChIw6yadQl1/0CRBNvP3yFgCE8MrBBCqci3qSZwQAiA4cfDBTX1QEfhivnzKL/v3NnDW27mMnc2u7squaU+uZs4Rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087172197169.15760810993106; Thu, 4 Jul 2024 02:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEI-0006RC-1V; Thu, 04 Jul 2024 05:58:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEG-0006Qj-8C for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEE-000854-JJ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:15 -0400 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-o-fV7CN6NCCRB8Jj-ZFBkQ-1; Thu, 04 Jul 2024 05:58:11 -0400 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-52ea249d1c9so187217e87.0 for ; Thu, 04 Jul 2024 02:58:11 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d50b0sm17612535e9.7.2024.07.04.02.58.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EYG7z0+92zsKHX2B0kS2w6WkiJ9TG5QWULKkYSPwyBU=; b=GorGj7byopdBn3WFbRVhRUI2tLdJOVj9jMPFdjpHW0XefOmlgT1l8E4veCMXb/XfITj09M meyeqSPhCq5rv1dFN3wZmEg7dJ2OERrH4NS+mt4xGikAXbCiygF8iQu3qWDKmEdHKj2h6N RKd6hrqGx/+SjRFRpPnAAZE/sArAxdk= X-MC-Unique: o-fV7CN6NCCRB8Jj-ZFBkQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087090; x=1720691890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EYG7z0+92zsKHX2B0kS2w6WkiJ9TG5QWULKkYSPwyBU=; b=ZM8s2VOZTJPTcD8JJ7qWlirZvsh7hh0pH9qmk4yqczTYG+sNZCux2VxkvyygK6Ktgh 9N3KP1FYr9pOELB/jcGJQEjcFfKl8J4sJb5lI1hnG/SRdg5UruQYhfj5RHVGlKB4hI8g pPPzI/ZcZ7iG2axjLUreCbaFyTnd2hi1S7ghgJuKvH75MoBOeGv54iW8dYOYKY1gNLR4 DztOXoKxUzc/2wPOpupV+/pu2eax3XtxZsoeOe0+zRmhjPv0KEsxQf46NDo6PgXko4an 34v65DAQIje33vBc0X2Ad76nFlg3YYL70fcPkZ+f0OHU/cxwcWN1VrR8X9R8j92DtXc7 7tAQ== X-Gm-Message-State: AOJu0Yw2J7yYhsu9qiklnwObjYRoFpZ2RxXlKjD8hrv+K2v7CG7nbKFP kv7kfyDUb9OrWx6ksgqlR5LS5WIhzkG5/a4XTOuojyi2Rr/Z+5q+J62ZsQlGaGumQyBZoq7CYV+ Fy16h/1ZkxEJ2k0uxmy6jerpk+gp1ap8Jz77R2NQEizUd5nx0X+6g4yh0g/d/FKPmShUMJjnZE7 cC9s7O9CvAGReJqPxaOq6I8SdFtR2rbVbhkz7N X-Received: by 2002:ac2:57c1:0:b0:52e:7125:c70a with SMTP id 2adb3069b0e04-52ea06bc9f4mr801000e87.47.1720087089905; Thu, 04 Jul 2024 02:58:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrtf+9BoxgTq+hDNCHdQVz0sxkcrpAjCxOl0rZNolNELJQnztPXtQuW3I5ogVA8NUniAvdVw== X-Received: by 2002:ac2:57c1:0:b0:52e:7125:c70a with SMTP id 2adb3069b0e04-52ea06bc9f4mr800991e87.47.1720087089448; Thu, 04 Jul 2024 02:58:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/16] meson: move shared_module() calls where modules are already walked Date: Thu, 4 Jul 2024 11:57:51 +0200 Message-ID: <20240704095806.1780273-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087173867100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- meson.build | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 54e6b09f4fb..8909f8c87d9 100644 --- a/meson.build +++ b/meson.build @@ -3602,6 +3602,7 @@ modinfo_files =3D [] =20 block_mods =3D [] system_mods =3D [] +emulator_modules =3D [] foreach d, list : modules if not (d =3D=3D 'block' ? have_block : have_system) continue @@ -3609,14 +3610,20 @@ foreach d, list : modules =20 foreach m, module_ss : list if enable_modules + module_ss.add(modulecommon) module_ss =3D module_ss.apply(config_all_devices, strict: false) sl =3D static_library(d + '-' + m, [genh, module_ss.sources()], - dependencies: [modulecommon, module_ss.dependenc= ies()], pic: true) + dependencies: module_ss.dependencies(), pic: tru= e) if d =3D=3D 'block' block_mods +=3D sl else system_mods +=3D sl endif + emulator_modules +=3D shared_module(sl.name(), + name_prefix: '', + link_whole: sl, + install: true, + install_dir: qemu_moddir) if module_ss.sources() !=3D [] # FIXME: Should use sl.extract_all_objects(recursive: true) as # input. Sources can be used multiple times but objects are @@ -3642,6 +3649,7 @@ endforeach foreach d, list : target_modules foreach m, module_ss : list if enable_modules + module_ss.add(modulecommon) foreach target : target_dirs if target.endswith('-softmmu') config_target =3D config_target_mak[target] @@ -3654,11 +3662,16 @@ foreach d, list : target_modules module_name =3D d + '-' + m + '-' + config_target['TARGET_NAME= '] sl =3D static_library(module_name, [genh, target_module_ss.sources()], - dependencies: [modulecommon, target_module= _ss.dependencies()], + dependencies: target_module_ss.dependencie= s(), include_directories: target_inc, c_args: c_args, pic: true) system_mods +=3D sl + emulator_modules +=3D shared_module(sl.name(), + name_prefix: '', + link_whole: sl, + install: true, + install_dir: qemu_moddir) # FIXME: Should use sl.extract_all_objects(recursive: true) to= o. modinfo_files +=3D custom_target(module_name + '.modinfo', output: module_name + '.modinfo= ', @@ -3692,6 +3705,10 @@ if enable_modules hw_arch[arch].add(modinfo_dep) endif endforeach + + if emulator_modules.length() > 0 + alias_target('modules', emulator_modules) + endif endif =20 nm =3D find_program('nm') @@ -3785,19 +3802,6 @@ common_ss.add(hwcore) # Targets # ########### =20 -emulator_modules =3D [] -foreach m : block_mods + system_mods - emulator_modules +=3D shared_module(m.name(), - build_by_default: true, - name_prefix: '', - link_whole: m, - install: true, - install_dir: qemu_moddir) -endforeach -if emulator_modules.length() > 0 - alias_target('modules', emulator_modules) -endif - system_ss.add(authz, blockdev, chardev, crypto, io, qmp) common_ss.add(qom, qemuutil) =20 --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087213; cv=none; d=zohomail.com; s=zohoarc; b=Bc7t3ZJl6UXVBzrF2eOp0qS+WchaGvJIqXkjRFk6CZn/BcuwQmPrqR+95CNySwp8CIQYS9IohYj0GtY6Q0sqm0X27DBAB5li2rSpjkdteCk1y6yzkSHF6Q+1fotBhtJh/Ccy5LVupJuZPggTPiLRuFGz+nmW+zlw/54Sr53AKxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087213; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=kId3BsrX4Ck23yi00sPWp4rXEyQ/RKL0+nMr7yxJA3E=; b=BypOYoXROclh5KbhjzGndz0rLM3/q2XFv3cfCfh5QbPbobKBGLdPid1+jihZM/fH51x3Phq+4usCbR+XwpH6xbywE01Bgt6CuCzuYeicrSzEGRl2cH99nY9qdTxqeb2v6kACx7NScWkzB9F2lhsEFxTGBgWuePzznsGnmIQ5vMM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087213039630.4914739349156; Thu, 4 Jul 2024 03:00:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEK-0006Rj-MB; Thu, 04 Jul 2024 05:58:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEJ-0006RX-L8 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEH-00085j-R2 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:19 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-3HPYNIgbNuGeESIIJ7SiPw-1; Thu, 04 Jul 2024 05:58:13 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-36789dfcc8bso315917f8f.3 for ; Thu, 04 Jul 2024 02:58:13 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367956ca37asm3443591f8f.75.2024.07.04.02.58.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kId3BsrX4Ck23yi00sPWp4rXEyQ/RKL0+nMr7yxJA3E=; b=BdYSh3ps764deqnFQRdEMV6yoEzAG5ys3zDK2cdRxuq8yYHA0J8gpF+oyt16igR/zAmPwM 5LuzMrZ2m9vO1gcQTkpDJ7iNC846f0OVr4tFelVbGTiedhvtvDY2+GXikcZkOx4t+mK+fW XG7qNPEedRbQUg8KK5x93x1KWp12zrw= X-MC-Unique: 3HPYNIgbNuGeESIIJ7SiPw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087091; x=1720691891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kId3BsrX4Ck23yi00sPWp4rXEyQ/RKL0+nMr7yxJA3E=; b=qsjZu+jJ7NaXq4IUwPm2PBaGqmoK0xBvCfN+Hre621B5bwPJvrus/a0fqGeQS34X6H wO+8SAO6FBPHqb/Me6ppSdFxOWbqwcHH5bIW+qb3uf4L5vLo3V4T/XjHuQl1oZ0UNNee eTwdMwX9wF4WLmsE1Y2nOK5GA4JucZ/H0Z7pdBTSTNwpsTeRjnhILMLci1eP1XM0jXw3 uPQRXozBpObmjqNnlwxdFecLs/tHQZg1ePdIo+npb4lsv/WZH2ADhAmMwD3ygI9bPP+h 1Ky+QcZSa+eS26d3i6UmTckHnA2AfB1Nkn9JdQjTSJfSRYsMo+R+Z7bMmQFn826ceEXu LnIw== X-Gm-Message-State: AOJu0YyCrA0EngQNghEcHqXmN+lPQ9m2g4D3iqEaxzm70V9R7PEDNSl6 beZbtapO4cPIJ0az8du0XIF6XBhExiZ6VGhF3yrR5n21TvnOvRURbUixvp9A9quMGuJsjX/fAh1 J0mIs4lO/IE2LTC+kOV7SBkL66GMtl706Fc91tRg8ue3xnL6A/Q27V+rk2oUmyRvd+5SYDTbFE5 lLrYZTjzzNhHAiK9pJ2iYb99FHPtTZW+i3A+AT X-Received: by 2002:a5d:5265:0:b0:367:9ce3:1667 with SMTP id ffacd0b85a97d-3679dd3c4eemr790905f8f.15.1720087091646; Thu, 04 Jul 2024 02:58:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeIBN4e10hTzkoF1vYyI+5msU11MqQiDjJ4Cx/B+73man6fZLx1eAV1rhWa2HBeFQ5Zo3YoA== X-Received: by 2002:a5d:5265:0:b0:367:9ce3:1667 with SMTP id ffacd0b85a97d-3679dd3c4eemr790891f8f.15.1720087091198; Thu, 04 Jul 2024 02:58:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/16] meson: move block.syms dependency out of libblock Date: Thu, 4 Jul 2024 11:57:52 +0200 Message-ID: <20240704095806.1780273-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087214095100001 Content-Type: text/plain; charset="utf-8" In order to define libqemuutil symbols that are requested by block modules, QEMU currently uses a combination of the "link_depends" argument of libraries (which is propagated into dependencies, but not available in dependencies) and the "link_args" argument of declare_dependency() (which _is_ available in static_library, but probably not used for historical reasons only). Unfortunately the link_depends will not be propagated into the "block" dependency if it is defined using declare_dependency(objects: ...); and it is not possible to add it directly to the dependency because the keyword argument simply is not available. The only solution, in order to switch to defining the dependency without using "link_whole" (which has problems of its own, see https://github.com/mesonbuild/meson/pull/8151#issuecomment-754796420), is unfortunately to add the link_args and link_depends to the executables directly; fortunately there is just four of them. It is possible (and I will look into it) to add "link_depends" to declare_dependency(), but it probably will be a while before QEMU can use it. Signed-off-by: Paolo Bonzini --- meson.build | 5 +++-- storage-daemon/meson.build | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8909f8c87d9..df9a64302f0 100644 --- a/meson.build +++ b/meson.build @@ -3759,12 +3759,10 @@ system_ss.add(migration) block_ss =3D block_ss.apply({}) libblock =3D static_library('block', block_ss.sources() + genh, dependencies: block_ss.dependencies(), - link_depends: block_syms, name_suffix: 'fa', build_by_default: false) =20 block =3D declare_dependency(link_whole: [libblock], - link_args: '@block.syms', dependencies: [crypto, io]) =20 blockdev_ss =3D blockdev_ss.apply({}) @@ -4033,10 +4031,13 @@ endif =20 if have_tools qemu_img =3D executable('qemu-img', [files('qemu-img.c'), hxdep], + link_args: '@block.syms', link_depends: block_syms, dependencies: [authz, block, crypto, io, qom, qemuutil], inst= all: true) qemu_io =3D executable('qemu-io', files('qemu-io.c'), + link_args: '@block.syms', link_depends: block_syms, dependencies: [block, qemuutil], install: true) qemu_nbd =3D executable('qemu-nbd', files('qemu-nbd.c'), + link_args: '@block.syms', link_depends: block_syms, dependencies: [blockdev, qemuutil, gnutls, selinux], install: true) =20 diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build index 46267b63e72..fd5e32f4b28 100644 --- a/storage-daemon/meson.build +++ b/storage-daemon/meson.build @@ -8,6 +8,7 @@ if have_tools qsd_ss =3D qsd_ss.apply({}) qsd =3D executable('qemu-storage-daemon', qsd_ss.sources(), + link_args: '@block.syms', link_depends: block_syms, dependencies: qsd_ss.dependencies(), install: true) endif --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087195; cv=none; d=zohomail.com; s=zohoarc; b=G51ZiC9gH+VsJjZu5RP0IVwVabpJnVQo0hh/RfBKkA0UrpeYz7E6r2+mUPSZiYcBdvW2IWweOKWF4OTHaJ18rNrgm9h2nMa7JyifUoB5gjZ4KManjhDfHnyJwGnCfmFr8RCTFEzAc/sF74D1aVo4LFb9E4XEctpOV7894gjJzho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087195; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=9uBM6zOrx7yDYGJWdOhsTzSy8zkX7WCI0/bOpt/gBDI=; b=Cz2hRld5bGXtm8LRtnaHFDkpjZYMlIDgpBSq7c5Vyd2ef2tpm9RUbCbbbe9TR8BGu0tUivMxAgXrNxw96++Yo6pT4gvgSFmm+Og/8taVFt+njASXOLtmKzk9gLa9u4vtclxK07jUBB8SUahn3lBvchwlOBhmiUewqPnPNAlBF+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087195424817.1200163052443; Thu, 4 Jul 2024 02:59:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEN-0006Ss-Cj; Thu, 04 Jul 2024 05:58:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEL-0006Rv-Hp for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEK-000862-2Y for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:21 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-487-d-X-BlUhN4OxwCKPJ9ZdYQ-1; Thu, 04 Jul 2024 05:58:15 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4264dc624a5so4755e9.1 for ; Thu, 04 Jul 2024 02:58:15 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a2ca618sm17245125e9.29.2024.07.04.02.58.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uBM6zOrx7yDYGJWdOhsTzSy8zkX7WCI0/bOpt/gBDI=; b=N54DaLRo8GwTie4r06K/V6fSoxbfBW50Y55Aq5dsQvbemoIReLIcl1GZzT01FJczQ2vBvQ y3lzVbmW6Ptf2uw6ArgQ7RfMFsFlvCdKNbsaHxJETk65cRBn3iDyW1kaPETACk70yD9G6o U3Cm8V+LYmy+WIeuh3imXo8uHGVNUPY= X-MC-Unique: d-X-BlUhN4OxwCKPJ9ZdYQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087094; x=1720691894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9uBM6zOrx7yDYGJWdOhsTzSy8zkX7WCI0/bOpt/gBDI=; b=UpGHjrZoEueH8WW3npTAGcwr8xp+p/G4B4QdBq8vJVrRi/MJIzZHcCbQEHGlGmhLU6 5sQwAPMAC77RaWblWzmXrvWkKzlHQ9GMR8YSBHI8jc7pYNLkAY6/wmIkQa5fqtWP9YbT Ccjry6HnZhRHL4+I36WRb0P9ZzaTM4o2MgpqmyvkYBG0/Kj8cnz1bCvJfPlBPh9099ml 8u9kNwtXpkgBC3Q+jZlXTG/RdQfhtSOF5QtE/45OH5gpPZK4jtwDOTvzDdaW8s3E/efc Bb18jwMBbiZ8YVK9kgacZsksW5VmC5UN8oizVrSHgDDBSQqR/ITBGRxXRWY3aZ9pzj/m zpgA== X-Gm-Message-State: AOJu0YwkNfzY84YaTNwD4sGcZf/xmLEoppCszOQV4cIf9JiRkp/+kV9X lOz9DFBdRtIztKh3gpH9w4xi7SN3xh6/G1hukGhf//7PFfXiTt2Imlr+gNtbPNyjwUOoh3LMz6D gU/tsexyY1sAHjRPUl/mlywIMpsl0g9OOGKXDecbH7pEFRqqVvhMZ2EVj6PycPTnvZVjy67Qz2M 7mKpVPzXmj6RFBGH+dYoVhbDBDGlJi5QwPghS8 X-Received: by 2002:a05:600c:158b:b0:424:9516:bfcf with SMTP id 5b1f17b1804b1-4264a3d9797mr10500105e9.3.1720087093913; Thu, 04 Jul 2024 02:58:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwKwidJzwFP7lDG5Ogpeeg14lsONhrthR+MaZ6GLfCWJuMS0kC/msSL5PxG7TpcGoIE7E/8w== X-Received: by 2002:a05:600c:158b:b0:424:9516:bfcf with SMTP id 5b1f17b1804b1-4264a3d9797mr10500005e9.3.1720087093561; Thu, 04 Jul 2024 02:58:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/16] meson: merge plugin_ldflags into emulator_link_args Date: Thu, 4 Jul 2024 11:57:53 +0200 Message-ID: <20240704095806.1780273-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087195957100005 Content-Type: text/plain; charset="utf-8" These serve the same purpose, except plugin_ldflags ends up in the linker command line in a more roundabout way (through specific_ss). Simplify. Signed-off-by: Paolo Bonzini --- plugins/meson.build | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/meson.build b/plugins/meson.build index 51b4350c2a0..18a0303bff9 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -1,4 +1,3 @@ -plugin_ldflags =3D [] # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if host_os =3D=3D 'darwin' @@ -7,9 +6,9 @@ if not enable_modules output: 'qemu-plugins-ld64.symbols', capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@IN= PUT@']) - plugin_ldflags =3D ['-Wl,-exported_symbols_list,plugins/qemu-plugins-l= d64.symbols'] + emulator_link_args +=3D ['-Wl,-exported_symbols_list,plugins/qemu-plug= ins-ld64.symbols'] else - plugin_ldflags =3D ['-Xlinker', '--dynamic-list=3D' + (meson.project_s= ource_root() / 'plugins/qemu-plugins.symbols')] + emulator_link_args +=3D ['-Xlinker', '--dynamic-list=3D' + (meson.proj= ect_source_root() / 'plugins/qemu-plugins.symbols')] endif endif =20 @@ -37,5 +36,5 @@ if get_option('plugins') 'loader.c', 'core.c', 'api.c', - ), declare_dependency(link_args: plugin_ldflags)) + )) endif --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087276; cv=none; d=zohomail.com; s=zohoarc; b=ah+994ITvw8U9Fqpm5Vs/6aKFmwfqK/SbyOR60CBI/7Ty3swn9kwCuHjD87gfSVOOEUWBsK5zwRbmD7iC4/SsKK16ptYaEzFUNbIQDr1ZcGGyVmEPSNw7D3wUheiZXTKLj1ptKWiNnURkc37N623006M6x/TVySSsPWK+bY+r0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087276; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YnnCivhT0ap8CZRVGgoMYFRLkUzpfV9z/OQ32askbY4=; b=QPVMLNNLTR67qKqLfPjHZqUEt9/OOr4GfXi5ADilPLr8nuXEdk+N7/PeIGrp7FuZE+zsMnTdq9cEsl208Q4/y44FfgUwuoj8A8+TKKWEPScq57rrF/re0xVsmuHayccrvjyAQ7kA4gTpNPbiNdxh9wA1XjPMtev5AhavY2CJLTg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087276980913.032948726966; Thu, 4 Jul 2024 03:01:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJER-0006TK-94; Thu, 04 Jul 2024 05:58:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEQ-0006TA-IB for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEO-00086U-Ep for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:26 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-620-ic78V3bTND2dOGGH9_UDXQ-1; Thu, 04 Jul 2024 05:58:18 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4255f94080bso3263125e9.2 for ; Thu, 04 Jul 2024 02:58:18 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d0bd6sm17541425e9.8.2024.07.04.02.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YnnCivhT0ap8CZRVGgoMYFRLkUzpfV9z/OQ32askbY4=; b=XfIuYtMb1lbnDw/yTt6g+/njEyZpubXIqjvsR+DshyTeo3TQif+uYFzRISwvZwoYLATFMa MT/yEKoH3WSaDc9a73+rmreiPeWkF5pNOM+e11Q30Mh7PZmDgcnMwvgFTVQekVwVsVrM5j 1sqG3araNClqykGgbRuDhHbDaci/FKI= X-MC-Unique: ic78V3bTND2dOGGH9_UDXQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087096; x=1720691896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YnnCivhT0ap8CZRVGgoMYFRLkUzpfV9z/OQ32askbY4=; b=e0fn0VMRQvQQ1iPPOPdVlU+AiDgU1/JGIORqs+7MQhud34xzf/g3WFHrcWCD8LCwPg oaBVwiJkOWJW+trG46zzjFoWD1EUOeODRb8rQoMUtDkHtTWlzi65cCTBWM9gdWfcIhJJ HiT2CqZ3Q4Gup5rU0Sv2jFsYujCPE4exoYL1AHE5hm2gPfnEHAtL6wc4ewXxp/6nEIUP gvrnatKGV+B6ites/Kw2pvmVajJIabdr6yv2E7gvhn+EIferFOWzbsyQPcKEzJpDLRGo yJ5NsOIXEBEOJZ3me/IsBrHqEzJzMVPRjPxA3jekX8DedRZwBliOvFl5NpBip3VdsI23 ivQQ== X-Gm-Message-State: AOJu0Yw7M8d2mPKxZDRg31cW4Hs893WxYVr/P1ZWBu489oco5h9tz22f aE5M1wWNRypcJslyRHMULHE1fK3zk2BRxjIYdb/GrYygJO7coVAv696qdgkuJcfc4fvH8FGbGcF VmW3iW9KN5KOm6x6nD+6/WIq7L9QqrdsYiwW5L1OZy0lR+oqWK7VhWZ3CvM1Na5ZW1Vgg7SRtDW sjOJq72LgngCc5HTyiRY0KVY7srnIvQbmkdO+l X-Received: by 2002:a05:600c:3b9d:b0:425:692d:c728 with SMTP id 5b1f17b1804b1-4264a44d288mr7666325e9.28.1720087096248; Thu, 04 Jul 2024 02:58:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbDRMZzyyIEGrqlxSvsovBAHzv8F98LziwRAEZ0je/R+LYF6z4SmfPvobgeaecBPilUgp40A== X-Received: by 2002:a05:600c:3b9d:b0:425:692d:c728 with SMTP id 5b1f17b1804b1-4264a44d288mr7666075e9.28.1720087094932; Thu, 04 Jul 2024 02:58:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Akihiko Odaki Subject: [PULL 04/16] meson: Pass objects and dependencies to declare_dependency() Date: Thu, 4 Jul 2024 11:57:54 +0200 Message-ID: <20240704095806.1780273-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087278555100007 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki We used to request declare_dependency() to link_whole static libraries. If a static library is a thin archive, GNU ld keeps all object files referenced by the archive open, and sometimes exceeds the open file limit. Another problem with link_whole is that suboptimal handling of nested dependencies. link_whole by itself does not propagate dependencies. In particular, gnutls, a dependency of crypto, is not propagated to its users, and we currently workaround the issue by declaring gnutls as a dependency for each crypto user. On the other hand, if you write something like libfoo =3D static_library('foo', 'foo.c', dependencies: gnutls) foo =3D declare_dependency(link_whole: libfoo) libbar =3D static_library('bar', 'bar.c', dependencies: foo) bar =3D declare_dependency(link_whole: libbar, dependencies: foo) executable('prog', sources: files('prog.c'), dependencies: [foo, bar]) hoping to propagate the gnutls dependency into bar.c, you'll see a linking failure for "prog", because the foo.c.o object file is included in libbar.a and therefore it is linked twice into "prog": once from libfoo.a and once from libbar.a. Here Meson does not see the duplication, it just asks the linker to link all of libfoo.a and libbar.a into "prog". Instead of using link_whole, extract objects included in static libraries and pass them to declare_dependency(); and then the dependencies can be added as well so that they are propagated, because object files on the linker command line are always deduplicated. This requires Meson 1.1.0 or later. Signed-off-by: Akihiko Odaki Message-ID: <20240524-objects-v1-1-07cbbe96166b@daynix.com> Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 3 ++- meson.build | 44 +++++++++++++++++++--------------- gdbstub/meson.build | 4 ++-- pythondeps.toml | 2 +- tcg/meson.build | 6 +++-- tests/qtest/libqos/meson.build | 2 +- 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index f4fd76117df..39a1934c63f 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -238,7 +238,8 @@ Subsystem sourcesets: name_suffix: 'fa', build_by_default: false) =20 - chardev =3D declare_dependency(link_whole: libchardev) + chardev =3D declare_dependency(objects: libchardev.extract_all_objects= (recursive: false), + dependencies: chardev_ss.dependencies()) =20 As of Meson 0.55.1, the special ``.fa`` suffix should be used for everyt= hing that is used with ``link_whole``, to ensure that the link flags are plac= ed diff --git a/meson.build b/meson.build index df9a64302f0..0c314ae5701 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('qemu', ['c'], meson_version: '>=3D0.63.0', +project('qemu', ['c'], meson_version: '>=3D1.1.0', default_options: ['warning_level=3D1', 'c_std=3Dgnu11', 'cpp_std= =3Dgnu++11', 'b_colorout=3Dauto', 'b_staticpic=3Dfalse', 'stdsplit=3Dfalse', 'opti= mization=3D2', 'b_pie=3Dtrue'], version: files('VERSION')) @@ -3461,7 +3461,7 @@ endif =20 if enable_modules libmodulecommon =3D static_library('module-common', files('module-common= .c') + genh, pic: true, c_args: '-DBUILD_DSO') - modulecommon =3D declare_dependency(link_whole: libmodulecommon, compile= _args: '-DBUILD_DSO') + modulecommon =3D declare_dependency(objects: libmodulecommon.extract_all= _objects(recursive: false), compile_args: '-DBUILD_DSO') endif =20 qom_ss =3D qom_ss.apply({}) @@ -3469,14 +3469,15 @@ libqom =3D static_library('qom', qom_ss.sources() += genh, dependencies: [qom_ss.dependencies()], name_suffix: 'fa', build_by_default: false) -qom =3D declare_dependency(link_whole: libqom) +qom =3D declare_dependency(objects: libqom.extract_all_objects(recursive: = false), + dependencies: qom_ss.dependencies()) =20 event_loop_base =3D files('event-loop-base.c') event_loop_base =3D static_library('event-loop-base', sources: event_loop_base + genh, name_suffix: 'fa', build_by_default: false) -event_loop_base =3D declare_dependency(link_whole: event_loop_base, +event_loop_base =3D declare_dependency(objects: event_loop_base.extract_al= l_objects(recursive: false), dependencies: [qom]) =20 stub_ss =3D stub_ss.apply({}) @@ -3621,7 +3622,8 @@ foreach d, list : modules endif emulator_modules +=3D shared_module(sl.name(), name_prefix: '', - link_whole: sl, + objects: sl.extract_all_objects(recursive: false), + dependencies: module_ss.dependencies(), install: true, install_dir: qemu_moddir) if module_ss.sources() !=3D [] @@ -3669,7 +3671,8 @@ foreach d, list : target_modules system_mods +=3D sl emulator_modules +=3D shared_module(sl.name(), name_prefix: '', - link_whole: sl, + objects: sl.extract_all_objects(recursive: false), + dependencies: target_module_ss.dependencies(), install: true, install_dir: qemu_moddir) # FIXME: Should use sl.extract_all_objects(recursive: true) to= o. @@ -3728,8 +3731,8 @@ libauthz =3D static_library('authz', authz_ss.sources= () + genh, name_suffix: 'fa', build_by_default: false) =20 -authz =3D declare_dependency(link_whole: libauthz, - dependencies: qom) +authz =3D declare_dependency(objects: libauthz.extract_all_objects(recursi= ve: false), + dependencies: [authz_ss.dependencies(), qom]) =20 crypto_ss =3D crypto_ss.apply({}) libcrypto =3D static_library('crypto', crypto_ss.sources() + genh, @@ -3737,8 +3740,8 @@ libcrypto =3D static_library('crypto', crypto_ss.sour= ces() + genh, name_suffix: 'fa', build_by_default: false) =20 -crypto =3D declare_dependency(link_whole: libcrypto, - dependencies: [authz, qom]) +crypto =3D declare_dependency(objects: libcrypto.extract_all_objects(recur= sive: false), + dependencies: [crypto_ss.dependencies(), authz= , qom]) =20 io_ss =3D io_ss.apply({}) libio =3D static_library('io', io_ss.sources() + genh, @@ -3747,12 +3750,13 @@ libio =3D static_library('io', io_ss.sources() + ge= nh, name_suffix: 'fa', build_by_default: false) =20 -io =3D declare_dependency(link_whole: libio, dependencies: [crypto, qom]) +io =3D declare_dependency(objects: libio.extract_all_objects(recursive: fa= lse), + dependencies: [io_ss.dependencies(), crypto, qom]) =20 libmigration =3D static_library('migration', sources: migration_files + ge= nh, name_suffix: 'fa', build_by_default: false) -migration =3D declare_dependency(link_with: libmigration, +migration =3D declare_dependency(objects: libmigration.extract_all_objects= (recursive: false), dependencies: [qom, io]) system_ss.add(migration) =20 @@ -3762,8 +3766,8 @@ libblock =3D static_library('block', block_ss.sources= () + genh, name_suffix: 'fa', build_by_default: false) =20 -block =3D declare_dependency(link_whole: [libblock], - dependencies: [crypto, io]) +block =3D declare_dependency(objects: libblock.extract_all_objects(recursi= ve: false), + dependencies: [block_ss.dependencies(), crypto,= io]) =20 blockdev_ss =3D blockdev_ss.apply({}) libblockdev =3D static_library('blockdev', blockdev_ss.sources() + genh, @@ -3771,8 +3775,8 @@ libblockdev =3D static_library('blockdev', blockdev_s= s.sources() + genh, name_suffix: 'fa', build_by_default: false) =20 -blockdev =3D declare_dependency(link_whole: [libblockdev], - dependencies: [block, event_loop_base]) +blockdev =3D declare_dependency(objects: libblockdev.extract_all_objects(r= ecursive: false), + dependencies: [blockdev_ss.dependencies(), b= lock, event_loop_base]) =20 qmp_ss =3D qmp_ss.apply({}) libqmp =3D static_library('qmp', qmp_ss.sources() + genh, @@ -3780,20 +3784,22 @@ libqmp =3D static_library('qmp', qmp_ss.sources() += genh, name_suffix: 'fa', build_by_default: false) =20 -qmp =3D declare_dependency(link_whole: [libqmp]) +qmp =3D declare_dependency(objects: libqmp.extract_all_objects(recursive: = false), + dependencies: qmp_ss.dependencies()) =20 libchardev =3D static_library('chardev', chardev_ss.sources() + genh, name_suffix: 'fa', dependencies: chardev_ss.dependencies(), build_by_default: false) =20 -chardev =3D declare_dependency(link_whole: libchardev) +chardev =3D declare_dependency(objects: libchardev.extract_all_objects(rec= ursive: false), + dependencies: chardev_ss.dependencies()) =20 hwcore_ss =3D hwcore_ss.apply({}) libhwcore =3D static_library('hwcore', sources: hwcore_ss.sources() + genh, name_suffix: 'fa', build_by_default: false) -hwcore =3D declare_dependency(link_whole: libhwcore) +hwcore =3D declare_dependency(objects: libhwcore.extract_all_objects(recur= sive: false)) common_ss.add(hwcore) =20 ########### diff --git a/gdbstub/meson.build b/gdbstub/meson.build index da5721d8452..c56b54eae7e 100644 --- a/gdbstub/meson.build +++ b/gdbstub/meson.build @@ -28,9 +28,9 @@ libgdb_system =3D static_library('gdb_system', name_suffix: 'fa', build_by_default: false) =20 -gdb_user =3D declare_dependency(link_whole: libgdb_user) +gdb_user =3D declare_dependency(objects: libgdb_user.extract_all_objects(r= ecursive: false)) user_ss.add(gdb_user) -gdb_system =3D declare_dependency(link_whole: libgdb_system) +gdb_system =3D declare_dependency(objects: libgdb_system.extract_all_objec= ts(recursive: false)) system_ss.add(gdb_system) =20 common_ss.add(files('syscalls.c')) diff --git a/pythondeps.toml b/pythondeps.toml index 9c16602d303..6aba0c9daaa 100644 --- a/pythondeps.toml +++ b/pythondeps.toml @@ -19,7 +19,7 @@ =20 [meson] # The install key should match the version in python/wheels/ -meson =3D { accepted =3D ">=3D0.63.0", installed =3D "1.2.3", canary =3D "= meson" } +meson =3D { accepted =3D ">=3D1.1.0", installed =3D "1.2.3", canary =3D "m= eson" } =20 [docs] # Please keep the installed versions in sync with docs/requirements.txt diff --git a/tcg/meson.build b/tcg/meson.build index ffbe754d8b3..165e773abbe 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -36,7 +36,8 @@ libtcg_user =3D static_library('tcg_user', c_args: '-DCONFIG_USER_ONLY', build_by_default: false) =20 -tcg_user =3D declare_dependency(link_with: libtcg_user) +tcg_user =3D declare_dependency(objects: libtcg_user.extract_all_objects(r= ecursive: false), + dependencies: tcg_ss.dependencies()) user_ss.add(tcg_user) =20 libtcg_system =3D static_library('tcg_system', @@ -46,5 +47,6 @@ libtcg_system =3D static_library('tcg_system', c_args: '-DCONFIG_SOFTMMU', build_by_default: false) =20 -tcg_system =3D declare_dependency(link_with: libtcg_system) +tcg_system =3D declare_dependency(objects: libtcg_system.extract_all_objec= ts(recursive: false), + dependencies: tcg_ss.dependencies()) system_ss.add(tcg_system) diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build index 558eb4c24be..05fe57a4b97 100644 --- a/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build @@ -72,4 +72,4 @@ libqos =3D static_library('qos', libqos_srcs + genh, name_suffix: 'fa', build_by_default: false) =20 -qos =3D declare_dependency(link_whole: libqos) +qos =3D declare_dependency(objects: libqos.extract_all_objects(recursive: = false)) --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087128; cv=none; d=zohomail.com; s=zohoarc; b=gVVvZyNCi1nzqQI3IaOjnhRBC8g3l1vzab7zeJwvJg0u0YqEfAO6fC/+c2qmvExwFb4e9JPvF+xbzb0hyVVsF/o2VJdPcyUN5Vo87vOnA47OAy9mJ6s+Ubdwd20rPEFSchKtxzC9jYcN65l1vLqg/YiJD/VlzMJgamdbSU8qVe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087128; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ftuQ4unRB23Fci4M9jLES3wu11vR3TI62r9geNdaT0Q=; b=fB38fosQp911E/CmVl1Mwhv60SyPfWJ+rBt2iBJGTofjd4b4ratsJf5IWukDRVzlGSgrlMeUIKTqz3w7WlYN3cbyQMDzOBRyHTd0te8htrdyUyvg35X4WxfO1qKa7QVH8RywQJDJmnm+3hTObCpILafvwWGN7N42JJ2p+4CF8MY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087128291174.05256821795274; Thu, 4 Jul 2024 02:58:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJET-0006U8-UF; Thu, 04 Jul 2024 05:58:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJER-0006TZ-TQ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEO-00086Q-Fz for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:27 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-376-Q2HOxy_cMq64Dz4KrlPQFA-1; Thu, 04 Jul 2024 05:58:21 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42648daf064so2825065e9.1 for ; Thu, 04 Jul 2024 02:58:21 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a21cbb7sm17814915e9.26.2024.07.04.02.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ftuQ4unRB23Fci4M9jLES3wu11vR3TI62r9geNdaT0Q=; b=ODpy22afaifsnuRK+cSw4VT/5DjoBpZFVOeWLn8rO0nJr5Unk84Z5nQ4nuseHrtzJL0p1o 88dxZakWa98p006J8blGqt7/beuLP10BnjhRkezWcsftpfBKUAbCniBDrGNveskGx5S8zf 3KU8UAVf0smFwtUzkoVo+eq4BbNIxbg= X-MC-Unique: Q2HOxy_cMq64Dz4KrlPQFA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087099; x=1720691899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ftuQ4unRB23Fci4M9jLES3wu11vR3TI62r9geNdaT0Q=; b=ioyX3VT2xr/xj52W3c7HkMW6NvsKrnETSyo3tnm1Gxny7DayfsxeN7VNElHo28mAIb tqqK5VB22OIyhONUQlEC4GW7MVcuCF6qSiZ5UIS7C63+afQjEjY/6kXm9pw5Ik2b7U4j USs+XSEY6ObYRN5X5PfFD/9c99WnXwf+AuMQc2orWdILAQ+p1sVemLnPvRgv9hmvQ2LM AMxN/Us1D6DVDO6TLGTdXLeVc9cxmYqZDNBP1FLDvWpzgz2xnaqA9fFGSQByo+9sZXPk mvtXnm+WjVUVd4A7WX4AwEDMbs3eCYaICoPb3VBP+bL7mgBrtV1ZPorIIJ99zWzXWGaT cOeA== X-Gm-Message-State: AOJu0YydFb4LWFyxdb+75O56XVxyi7o/z1xNfXKnxkb7jEuVCdDFqEHu /EaxjjcI0yF44P5Djxms2wEUhi5CyF6zZqcrN3o1sRlqvgBQX5UPde7+x8g11+GBNzCEdPka5tI 3Lq0668MnhRWCdc/t8cSYzyhPScMX0zVzKDeTd0Ilv2YcjXR3kY8ocF7FoLujaYcvAA+4U8UedV 8nqLnxHZQebz2nRUDaTFs0zvn089Uu65qTiUEE X-Received: by 2002:a05:600c:5247:b0:424:8836:310c with SMTP id 5b1f17b1804b1-4264b120ba7mr10008105e9.5.1720087099417; Thu, 04 Jul 2024 02:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9qfNF44ZlrM3VfYBFZarx8FgymTNGZ6IsRHabL3NC7htXnb/mhYKDgA0JId0K25faBGPldg== X-Received: by 2002:a05:600c:5247:b0:424:8836:310c with SMTP id 5b1f17b1804b1-4264b120ba7mr10007965e9.5.1720087099081; Thu, 04 Jul 2024 02:58:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Akihiko Odaki Subject: [PULL 05/16] Revert "meson: Propagate gnutls dependency" Date: Thu, 4 Jul 2024 11:57:55 +0200 Message-ID: <20240704095806.1780273-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087129684100003 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki This reverts commit 3eacf70bb5a83e4775ad8003cbca63a40f70c8c2. It was only needed because of duplicate objects caused by declare_dependency(link_whole: ...), and can be dropped now that meson.build specifies objects and dependencies separately for the internal dependencies. Signed-off-by: Akihiko Odaki Message-ID: <20240524-objects-v1-2-07cbbe96166b@daynix.com> Signed-off-by: Paolo Bonzini --- meson.build | 4 ++-- block/meson.build | 2 +- io/meson.build | 2 +- storage-daemon/meson.build | 2 +- ui/meson.build | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 0c314ae5701..429899d8603 100644 --- a/meson.build +++ b/meson.build @@ -3526,7 +3526,7 @@ if have_block 'blockdev-nbd.c', 'iothread.c', 'job-qmp.c', - ), gnutls) + )) =20 # os-posix.c contains POSIX-specific functions used by qemu-storage-daem= on, # os-win32.c does not @@ -4044,7 +4044,7 @@ if have_tools dependencies: [block, qemuutil], install: true) qemu_nbd =3D executable('qemu-nbd', files('qemu-nbd.c'), link_args: '@block.syms', link_depends: block_syms, - dependencies: [blockdev, qemuutil, gnutls, selinux], + dependencies: [blockdev, qemuutil, selinux], install: true) =20 subdir('storage-daemon') diff --git a/block/meson.build b/block/meson.build index 158dc3b89db..f1262ec2ba8 100644 --- a/block/meson.build +++ b/block/meson.build @@ -39,7 +39,7 @@ block_ss.add(files( 'throttle.c', 'throttle-groups.c', 'write-threshold.c', -), zstd, zlib, gnutls) +), zstd, zlib) =20 system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c')) system_ss.add(files('block-ram-registrar.c')) diff --git a/io/meson.build b/io/meson.build index 283b9b2bdbd..1164812f912 100644 --- a/io/meson.build +++ b/io/meson.build @@ -13,4 +13,4 @@ io_ss.add(files( 'dns-resolver.c', 'net-listener.c', 'task.c', -), gnutls) +)) diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build index fd5e32f4b28..5e61a9d1bdf 100644 --- a/storage-daemon/meson.build +++ b/storage-daemon/meson.build @@ -1,6 +1,6 @@ qsd_ss =3D ss.source_set() qsd_ss.add(files('qemu-storage-daemon.c')) -qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil, gnutls) +qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil) =20 subdir('qapi') =20 diff --git a/ui/meson.build b/ui/meson.build index cfbf29428df..28c7381dd10 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -44,7 +44,7 @@ vnc_ss.add(files( 'vnc-jobs.c', 'vnc-clipboard.c', )) -vnc_ss.add(zlib, jpeg, gnutls) +vnc_ss.add(zlib, jpeg) vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) system_ss.add_all(when: [vnc, pixman], if_true: vnc_ss) system_ss.add(when: vnc, if_false: files('vnc-stubs.c')) --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087146; cv=none; d=zohomail.com; s=zohoarc; b=lzW6nknWYJDIyNHnw2e4kGu16X0/wA02/Z9e6o3wlVxlJiPz/A+aWN6KE8uHlZQ176WaPGsFoQO4a4ANPSxDVdaR/oH5tDXinTZxbAWW1PDJirFkl7fFO7ylrABEzPFAdv6sIDRKFdIeGU7KJTXXgy7rrd+BrLd7nRPtucR2S0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087146; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1N0DGMBLdUJU6MGQY9/L+nCIIpSUEpfUpuzcsMB0WKM=; b=mhAFocy7Nt6JkvAldIRkVTbrV0mdOvyJpbFDwFTXQIepr+Dr0VSnwafLVfWbqtGF8wSVrGT1G14ReVBSZJEK12eA+P2w/CoWN/VidcxyH7lxVb+syMmFYPN1ExZazyGk/nC15a2tX4gTFEG2Lm0aJ+I48dBsUShBH1kkCnwWvxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087146798988.9935668957035; Thu, 4 Jul 2024 02:59:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEU-0006VW-Am; Thu, 04 Jul 2024 05:58:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJET-0006Ts-K6 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJER-00086j-L0 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:29 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-h-WfUvmIMZW3PklneYv-9w-1; Thu, 04 Jul 2024 05:58:24 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-367988464ceso459301f8f.2 for ; Thu, 04 Jul 2024 02:58:23 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367a112b3f0sm582326f8f.19.2024.07.04.02.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1N0DGMBLdUJU6MGQY9/L+nCIIpSUEpfUpuzcsMB0WKM=; b=Dp5r/FZEdmnvEtbp2qzH+Xfyykh7V41OkAAYjTOyOfQUM0hI5/kRO0fSSL4Kh+qyAmh13M nPHWCacujaaT/XvfdVPGfh+yQYNW8+FyTMm4MXAlXthG/rsB39qq8vfuFFstiZBuXf0tmC 47Zxoj3X/hqZiY2iqM5pMyD+OPl4DMQ= X-MC-Unique: h-WfUvmIMZW3PklneYv-9w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087102; x=1720691902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1N0DGMBLdUJU6MGQY9/L+nCIIpSUEpfUpuzcsMB0WKM=; b=Eobs/WQ/D8MLblwMRDm5ZQl0ZQ7HpJYnjaY/OWsE5DQaM0xaulWYIDlIsbtZSUxBWI zH7zuNmGBM8xKYFThrD3arxOtuXOFQkCXQqLnb4Q3ag8YJh6XZ5mpQH0Jso04gRYU7QB iewh54d+i5d/ECj5wRaqUjwXg0f+PO/1KtDo6AKQvH1DH8C8YBGvCWVqHcGrV3f1uK1C wLqT+dlZO6XZ8YGxJ45tHl/+6PHCoip+h0EaUgFfXCaAEvU45VhxaugJOYgZCBixrAii XGHoPCdcrCSqC7OEUYXAWevgbJuZBDKwO1H9QvBHM5MqfWzHVA+NzuQBmqoPVhlQJCNO wDGw== X-Gm-Message-State: AOJu0YwEagxkMmsDhckR7vKniqMsBoUic9q1d8WVecj6dEuHcCmB6an2 fzFVDJ1ICmp1/El4ecD7DORADlsBKo7foNbMUUyzqSgBer+o5jSgviVfzU11FC4TpUeC/f0i62T kbVYVNxXr8L5e2P5/YKZsrUJnyAaDvD4IcN5OxX0RXM2a8M52Fi8rCl0jiqr8sxoQMpVb/WzV9Z zxaASEb2gSaT344vWA7B2Axm1j10iegiKiCSyP X-Received: by 2002:a5d:4a0f:0:b0:362:4f55:6c43 with SMTP id ffacd0b85a97d-3679db85d0fmr1208928f8f.0.1720087102338; Thu, 04 Jul 2024 02:58:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6qY4ODdap4c8e5LMVSMHHUmgBnUr+8QIKFzKeYVMLXzCYK22f/OXAxkiE4Xges97ML8okVw== X-Received: by 2002:a5d:4a0f:0:b0:362:4f55:6c43 with SMTP id ffacd0b85a97d-3679db85d0fmr1208913f8f.0.1720087101926; Thu, 04 Jul 2024 02:58:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Akihiko Odaki Subject: [PULL 06/16] meson: Drop the .fa library suffix Date: Thu, 4 Jul 2024 11:57:56 +0200 Message-ID: <20240704095806.1780273-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087147950100001 Content-Type: text/plain; charset="utf-8" The non-standard .fa library suffix breaks the link source de-duplication done by Meson so drop it. The lack of link source de-duplication causes AddressSanitizer to complain ODR violations, and makes GNU ld abort when combined with clang's LTO. Fortunately, the non-standard suffix is not necessary anymore for two reasons. First, the non-standard suffix was necessary for fork-fuzzing. Meson wraps all standard-suffixed libraries with --start-group and --end-group. This made a fork-fuzz.ld linker script wrapped as well and broke builds. Commit d2e6f9272d33 ("fuzz: remove fork-fuzzing scaffolding") dropped fork-fuzzing so we can now restore the standard suffix. Second, the libraries are not even built anymore, because it is possible to just use the object files directly via extract_all_objects(). The occurences of the suffix were detected and removed by performing a tree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki Message-ID: <20240524-xkb-v4-4-2de564e5c859@daynix.com> Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 5 ----- meson.build | 17 ++--------------- stubs/blk-exp-close-all.c | 2 +- .gitlab-ci.d/buildtest-template.yml | 2 -- .gitlab-ci.d/buildtest.yml | 2 -- gdbstub/meson.build | 2 -- tcg/meson.build | 2 -- tests/Makefile.include | 2 +- tests/qtest/libqos/meson.build | 1 - 9 files changed, 4 insertions(+), 31 deletions(-) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 39a1934c63f..79eceb179de 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -235,16 +235,11 @@ Subsystem sourcesets: are then turned into static libraries as follows:: =20 libchardev =3D static_library('chardev', chardev_ss.sources(), - name_suffix: 'fa', build_by_default: false) =20 chardev =3D declare_dependency(objects: libchardev.extract_all_objects= (recursive: false), dependencies: chardev_ss.dependencies()) =20 - As of Meson 0.55.1, the special ``.fa`` suffix should be used for everyt= hing - that is used with ``link_whole``, to ensure that the link flags are plac= ed - correctly in the command line. - Target-independent emulator sourcesets: Various general purpose helper code is compiled only once and the .o files are linked into all output binaries that need it. diff --git a/meson.build b/meson.build index 429899d8603..3a1ad4ddeb4 100644 --- a/meson.build +++ b/meson.build @@ -3467,7 +3467,6 @@ endif qom_ss =3D qom_ss.apply({}) libqom =3D static_library('qom', qom_ss.sources() + genh, dependencies: [qom_ss.dependencies()], - name_suffix: 'fa', build_by_default: false) qom =3D declare_dependency(objects: libqom.extract_all_objects(recursive: = false), dependencies: qom_ss.dependencies()) @@ -3475,7 +3474,6 @@ qom =3D declare_dependency(objects: libqom.extract_al= l_objects(recursive: false), event_loop_base =3D files('event-loop-base.c') event_loop_base =3D static_library('event-loop-base', sources: event_loop_base + genh, - name_suffix: 'fa', build_by_default: false) event_loop_base =3D declare_dependency(objects: event_loop_base.extract_al= l_objects(recursive: false), dependencies: [qom]) @@ -3728,7 +3726,6 @@ qemu_syms =3D custom_target('qemu.syms', output: 'qem= u.syms', authz_ss =3D authz_ss.apply({}) libauthz =3D static_library('authz', authz_ss.sources() + genh, dependencies: [authz_ss.dependencies()], - name_suffix: 'fa', build_by_default: false) =20 authz =3D declare_dependency(objects: libauthz.extract_all_objects(recursi= ve: false), @@ -3737,7 +3734,6 @@ authz =3D declare_dependency(objects: libauthz.extrac= t_all_objects(recursive: fals crypto_ss =3D crypto_ss.apply({}) libcrypto =3D static_library('crypto', crypto_ss.sources() + genh, dependencies: [crypto_ss.dependencies()], - name_suffix: 'fa', build_by_default: false) =20 crypto =3D declare_dependency(objects: libcrypto.extract_all_objects(recur= sive: false), @@ -3747,14 +3743,12 @@ io_ss =3D io_ss.apply({}) libio =3D static_library('io', io_ss.sources() + genh, dependencies: [io_ss.dependencies()], link_with: libqemuutil, - name_suffix: 'fa', build_by_default: false) =20 io =3D declare_dependency(objects: libio.extract_all_objects(recursive: fa= lse), dependencies: [io_ss.dependencies(), crypto, qom]) =20 libmigration =3D static_library('migration', sources: migration_files + ge= nh, - name_suffix: 'fa', build_by_default: false) migration =3D declare_dependency(objects: libmigration.extract_all_objects= (recursive: false), dependencies: [qom, io]) @@ -3763,7 +3757,6 @@ system_ss.add(migration) block_ss =3D block_ss.apply({}) libblock =3D static_library('block', block_ss.sources() + genh, dependencies: block_ss.dependencies(), - name_suffix: 'fa', build_by_default: false) =20 block =3D declare_dependency(objects: libblock.extract_all_objects(recursi= ve: false), @@ -3772,7 +3765,6 @@ block =3D declare_dependency(objects: libblock.extrac= t_all_objects(recursive: fals blockdev_ss =3D blockdev_ss.apply({}) libblockdev =3D static_library('blockdev', blockdev_ss.sources() + genh, dependencies: blockdev_ss.dependencies(), - name_suffix: 'fa', build_by_default: false) =20 blockdev =3D declare_dependency(objects: libblockdev.extract_all_objects(r= ecursive: false), @@ -3781,14 +3773,12 @@ blockdev =3D declare_dependency(objects: libblockde= v.extract_all_objects(recursive qmp_ss =3D qmp_ss.apply({}) libqmp =3D static_library('qmp', qmp_ss.sources() + genh, dependencies: qmp_ss.dependencies(), - name_suffix: 'fa', build_by_default: false) =20 qmp =3D declare_dependency(objects: libqmp.extract_all_objects(recursive: = false), dependencies: qmp_ss.dependencies()) =20 libchardev =3D static_library('chardev', chardev_ss.sources() + genh, - name_suffix: 'fa', dependencies: chardev_ss.dependencies(), build_by_default: false) =20 @@ -3797,7 +3787,6 @@ chardev =3D declare_dependency(objects: libchardev.ex= tract_all_objects(recursive: =20 hwcore_ss =3D hwcore_ss.apply({}) libhwcore =3D static_library('hwcore', sources: hwcore_ss.sources() + genh, - name_suffix: 'fa', build_by_default: false) hwcore =3D declare_dependency(objects: libhwcore.extract_all_objects(recur= sive: false)) common_ss.add(hwcore) @@ -3820,8 +3809,7 @@ common_all =3D static_library('common', sources: common_ss.all_sources() + genh, include_directories: common_user_inc, implicit_include_directories: false, - dependencies: common_ss.all_dependencies(), - name_suffix: 'fa') + dependencies: common_ss.all_dependencies()) =20 feature_to_c =3D find_program('scripts/feature_to_c.py') =20 @@ -3930,8 +3918,7 @@ foreach target : target_dirs objects: objects, include_directories: target_inc, c_args: c_args, - build_by_default: false, - name_suffix: 'fa') + build_by_default: false) =20 if target.endswith('-softmmu') execs =3D [{ diff --git a/stubs/blk-exp-close-all.c b/stubs/blk-exp-close-all.c index 1c713167639..2f68e06d7d0 100644 --- a/stubs/blk-exp-close-all.c +++ b/stubs/blk-exp-close-all.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" #include "block/export.h" =20 -/* Only used in programs that support block exports (libblockdev.fa) */ +/* Only used in programs that support block exports (libblockdev.a) */ void blk_exp_close_all(void) { } diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-t= emplate.yml index 278a5ea966d..8f7ebfaed8b 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -45,10 +45,8 @@ exclude: - build/**/*.p - build/**/*.a.p - - build/**/*.fa.p - build/**/*.c.o - build/**/*.c.o.d - - build/**/*.fa =20 .common_test_job_template: extends: .base_job_template diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 0eec5703109..425fc6479ba 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -178,10 +178,8 @@ build-previous-qemu: exclude: - build-previous/**/*.p - build-previous/**/*.a.p - - build-previous/**/*.fa.p - build-previous/**/*.c.o - build-previous/**/*.c.o.d - - build-previous/**/*.fa needs: job: amd64-opensuse-leap-container variables: diff --git a/gdbstub/meson.build b/gdbstub/meson.build index c56b54eae7e..dff741ddd4d 100644 --- a/gdbstub/meson.build +++ b/gdbstub/meson.build @@ -19,13 +19,11 @@ gdb_system_ss =3D gdb_system_ss.apply({}) =20 libgdb_user =3D static_library('gdb_user', gdb_user_ss.sources() + genh, - name_suffix: 'fa', c_args: '-DCONFIG_USER_ONLY', build_by_default: false) =20 libgdb_system =3D static_library('gdb_system', gdb_system_ss.sources() + genh, - name_suffix: 'fa', build_by_default: false) =20 gdb_user =3D declare_dependency(objects: libgdb_user.extract_all_objects(r= ecursive: false)) diff --git a/tcg/meson.build b/tcg/meson.build index 165e773abbe..69ebb4908a6 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -31,7 +31,6 @@ tcg_ss =3D tcg_ss.apply({}) =20 libtcg_user =3D static_library('tcg_user', tcg_ss.sources() + genh, - name_suffix: 'fa', dependencies: tcg_ss.dependencies(), c_args: '-DCONFIG_USER_ONLY', build_by_default: false) @@ -42,7 +41,6 @@ user_ss.add(tcg_user) =20 libtcg_system =3D static_library('tcg_system', tcg_ss.sources() + genh, - name_suffix: 'fa', dependencies: tcg_ss.dependencies(), c_args: '-DCONFIG_SOFTMMU', build_by_default: false) diff --git a/tests/Makefile.include b/tests/Makefile.include index c9d1674bd07..d39d5dd6a43 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -87,7 +87,7 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES) .PHONY: check-venv check-avocado check-acceptance check-acceptance-depreca= ted-warning =20 # Build up our target list from the filtered list of ninja targets -TARGETS=3D$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targe= ts))) +TARGETS=3D$(patsubst libqemu-%.a, %, $(filter libqemu-%.a, $(ninja-targets= ))) =20 TESTS_VENV_TOKEN=3D$(BUILD_DIR)/pyvenv/tests.group TESTS_RESULTS_DIR=3D$(BUILD_DIR)/tests/results diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build index 05fe57a4b97..1b2b2dbb22e 100644 --- a/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build @@ -69,7 +69,6 @@ if have_virtfs endif =20 libqos =3D static_library('qos', libqos_srcs + genh, - name_suffix: 'fa', build_by_default: false) =20 qos =3D declare_dependency(objects: libqos.extract_all_objects(recursive: = false)) --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087220; cv=none; d=zohomail.com; s=zohoarc; b=O2XIl3kBqBRYqZ45ZDS9oDATr+NFHXEtZQGtFf/yWA+5IbYdDB1740kGweHg+Si+k+TWS9t6Vg48F4gqJa/3vycx8DMB46SHHfMIw6wFEtwPDezKyCHLPz6JTSeYX1XVJgM8DdmVWtiboLbZMt8hS6GceIibV8Qd7mI1lefvFoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087220; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VfZ2gFIZh1S09Ups+9rXVB9WcHJZ9HitC1LvQrZFclA=; b=dMQ3bxr8xerS34hIiqop9l+acoo5mfEMDzimiAZjsTwuPrGvjg2O+M0QeU83ijerceG4Nb2svwbTgMlg8VHIG+vc/4quj/LSQlE5QHX5HojpW83HZq3xz4XVNboE+LHAlD6tphBEbht4C8ImGq7gpRCIh6jnV9x/VIGZWl08/4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087219909995.9305841871893; Thu, 4 Jul 2024 03:00:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEd-0006dL-Cy; Thu, 04 Jul 2024 05:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEa-0006Yy-1C for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEX-00087O-CJ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:35 -0400 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-675-u2LzLw-5PGWxaQqbLdBdww-1; Thu, 04 Jul 2024 05:58:27 -0400 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52e9d91ec1bso487769e87.0 for ; Thu, 04 Jul 2024 02:58:27 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d0b24sm17477465e9.3.2024.07.04.02.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VfZ2gFIZh1S09Ups+9rXVB9WcHJZ9HitC1LvQrZFclA=; b=i/+4LkISHEj+opPmudgwEI47PBpeBNgw9qhTh3iGVSBcGC9P3xJApM1Xm2Txd1Emb0/p45 7Ne2YL1VAOyqTJ4rNCZLG4EAFdIpfPKr54u179qWUk7EBajEARFwqBC0ob2ztDTGJ27T4Y L7rcfVeF8HBUj2g14Y3yKmZrnS04eCA= X-MC-Unique: u2LzLw-5PGWxaQqbLdBdww-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087105; x=1720691905; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VfZ2gFIZh1S09Ups+9rXVB9WcHJZ9HitC1LvQrZFclA=; b=qDKDtbhcl82VIgvC7TdFZAs5HWCL8BUfY97sE/fZQYgCary5rjawWrKEdVJU8Zco1I eu0yOb+DR50cukB+mJSNx8uOuKcmlld0esNLbk5ZyuDyeVIlsvmfhBilcAm0pHlCcS8H u16JwTM1+d3wHx0XHbczEthvnQdIoTN7EPdx8pnKODduHZ5oV/sEKqBjAMiQ7bZzjzCb PJsnOd9SeBgfdx6lD0IDH4sojAqi4bKG/0wEAdVLrw+R2CpDGL5AIIcSpPmkkNrKP1dk D6JHZztSIcVHCrzmmVTpGLSklTBlPYrO7comA6pbyH1pEQRsazD5PM8VqDrqVlS8ERUo xUQw== X-Gm-Message-State: AOJu0YxPV5S7ftPf7Fj3Q8J1l6uqQ0QRvGOwJrd3GdOd/TeTrm3PEDDC W9mblVOwiVYU/VkD+Rp5I6Nrm6t1L/KkLTc/xQw/G63DaZ1+7Ny4bUu03/FWCzqo9yHOGN7GJtI LvUB7A0X+9NOjK+Fq5LamMfg6ONd+R6UMF1yo3i/HiunWeIA06K2bBOTm8EuI26S9Vsw42Ki12K r8zK0lpuuXlnJFshPwmN77MkIFvBuKWxA6STBX X-Received: by 2002:ac2:4989:0:b0:52c:d56f:b2cc with SMTP id 2adb3069b0e04-52ea06d30d0mr766943e87.58.1720087104848; Thu, 04 Jul 2024 02:58:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3bmQY33yW7swpFbJJSb20ZXaYGeQclin5q1WsVn9Ns0+1S6l52VFMFdImicXPMxM3cAs/JA== X-Received: by 2002:ac2:4989:0:b0:52c:d56f:b2cc with SMTP id 2adb3069b0e04-52ea06d30d0mr766929e87.58.1720087104484; Thu, 04 Jul 2024 02:58:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiaoyao Li , John Allen Subject: [PULL 07/16] target/i386: pass X86CPU to x86_cpu_get_supported_feature_word Date: Thu, 4 Jul 2024 11:57:57 +0200 Message-ID: <20240704095806.1780273-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087222231100006 Content-Type: text/plain; charset="utf-8" This allows modifying the bits in "-cpu max"/"-cpu host" depending on the guest CPU vendor (which, at least by default, is the host vendor in the case of KVM). For example, machine check architecture differs between Intel and AMD, and bits from AMD should be dropped when configuring the guest for an Intel model. Cc: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 +-- target/i386/cpu.c | 11 +++++------ target/i386/kvm/kvm-cpu.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 29daf370485..9bea7142bf4 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -666,8 +666,7 @@ typedef enum FeatureWord { } FeatureWord; =20 typedef uint64_t FeatureWordArray[FEATURE_WORDS]; -uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, - bool migratable_only); +uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); =20 /* cpuid_features bits */ #define CPUID_FP87 (1U << 0) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4c2e6f3a71e..4364cb0f8e3 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6035,8 +6035,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Erro= r **errp) =20 #endif /* !CONFIG_USER_ONLY */ =20 -uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, - bool migratable_only) +uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w) { FeatureWordInfo *wi =3D &feature_word_info[w]; uint64_t r =3D 0; @@ -6078,7 +6077,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWo= rd w, r &=3D ~unavail; } #endif - if (migratable_only) { + if (cpu && cpu->migratable) { r &=3D x86_cpu_get_migratable_flags(w); } return r; @@ -7371,7 +7370,7 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **err= p) * by the user. */ env->features[w] |=3D - x86_cpu_get_supported_feature_word(w, cpu->migratable) & + x86_cpu_get_supported_feature_word(cpu, w) & ~env->user_features[w] & ~feature_word_info[w].no_autoenable_flags; } @@ -7497,7 +7496,7 @@ static void x86_cpu_filter_features(X86CPU *cpu, bool= verbose) =20 for (w =3D 0; w < FEATURE_WORDS; w++) { uint64_t host_feat =3D - x86_cpu_get_supported_feature_word(w, false); + x86_cpu_get_supported_feature_word(NULL, w); uint64_t requested_features =3D env->features[w]; uint64_t unavailable_features =3D requested_features & ~host_feat; mark_unavailable_features(cpu, w, unavailable_features, prefix); @@ -7617,7 +7616,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error= **errp) env->features[FEAT_PERF_CAPABILITIES] & PERF_CAP_LBR_FMT; if (requested_lbr_fmt && kvm_enabled()) { uint64_t host_perf_cap =3D - x86_cpu_get_supported_feature_word(FEAT_PERF_CAPABILITIES, fal= se); + x86_cpu_get_supported_feature_word(NULL, FEAT_PERF_CAPABILITIE= S); unsigned host_lbr_fmt =3D host_perf_cap & PERF_CAP_LBR_FMT; =20 if (!cpu->enable_pmu) { diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index d57a68a301e..6bf8dcfc607 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -143,7 +143,7 @@ static void kvm_cpu_xsave_init(void) if (!esa->size) { continue; } - if ((x86_cpu_get_supported_feature_word(esa->feature, false) & esa= ->bits) + if ((x86_cpu_get_supported_feature_word(NULL, esa->feature) & esa-= >bits) !=3D esa->bits) { continue; } --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087220; cv=none; d=zohomail.com; s=zohoarc; b=fZwfdnUMQUnLMeuIGdMqXHLhJak3//I7wM4ZwOuztksy6cCOHVC38hyTbNofbehG3tDd1JQQn0FQ0QaZwvWiTRuKqVn7cHPJRF+isO/ih3HT8XwGXwpZz5fxqt2jmAP/xTVH3Iq2/GN1AJAA0IJqjtJwHYuNxEpZ5LQfonJdWiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087220; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xodI69XkEFxSKoRXtaeS0GzJTj+TYzlh41WlJfxNZDg=; b=P69ge/EE5YCjtQIUPe2AxK8BqXjW0DVIEybYQFShKPnEcuuhmxWs06CTgslodpkd1oLc23dT47QUZY9GhjaAY0++cP9Hq1o7j+NGYmhVHk36uwon0e4hJc/8Iq1D0XLz4aR47t0rXUisXzwq7yKQ1bL7v475exqB80mSga9byJo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087219854858.0167394180003; Thu, 4 Jul 2024 03:00:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEh-0006mC-25; Thu, 04 Jul 2024 05:58:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEd-0006fN-6e for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEX-00087R-N8 for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:37 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-Lghdnl2BNJ6CUTtu0MKcWw-1; Thu, 04 Jul 2024 05:58:30 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4257f95fe85so3476095e9.1 for ; Thu, 04 Jul 2024 02:58:29 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d6133sm17665845e9.13.2024.07.04.02.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xodI69XkEFxSKoRXtaeS0GzJTj+TYzlh41WlJfxNZDg=; b=LkfBwcEsXqGhDUuIDweGkFKyEiNlkn8QYY2KmMP72qMuY2ANZqG1HOgYJ0SFDwmaF92NT5 xqL5fICXnGC+I0ObnxDl39yCpb0jYKKlgBhkMOAY17onimB8aamLE1fVQdtDzRtcRMa8bR SrkvB5qq3/SVEyMkcArJ+uAy2jvA7ls= X-MC-Unique: Lghdnl2BNJ6CUTtu0MKcWw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087108; x=1720691908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xodI69XkEFxSKoRXtaeS0GzJTj+TYzlh41WlJfxNZDg=; b=Y2CJFcqHTZfKKBQUt580NVbxEhNOaBUA3E1G1K7lR4lU8GXjPntKEbJhCSndNSqomI 8QFomidnWafuZxJ0urD8rcdDAEd95HHxPueu0rAnwCmCOYJzjBy2hT8kv+2V9aUZA+TC X29WkSLJkA2dx4Z9cjgA3PLLv9Ien0ZRDlQAEK9072yzPYatO4eh5VuzqN6xt5TP6PB5 fkcPtDi5Rt2Hl+YUPwJyGfVPQ0wdx/OvP8/KdszQ/+rOWhbQ+JFYOBGHS5f9XO/F778E WTHPVh6GN/oJCxUew4Z+uYyxzLN3OPfrFX6Mvjke4PLj+k4LSXFLbjQa62V+KafJY3mR Hrwg== X-Gm-Message-State: AOJu0YwrWad0URxcre62hBr7hfH/RYVURYt/0hcZ67rGnkXfDS8McZkB QDrNKJUxAxcvdJIdYXHGRvXA2Xo5RvrRopwsTlLgX+S0zKSPgleYM731WUUr5EmqAtJO+zkSA2J gaoY9FAwyeccAugJrICZMUxBrTIV/hUBXhHs4pNkxH/h16dsm5Is8r3WBKb1XF98Ar7enZhATQF EvOvaI4Zr8FpKvpOycsjA3yj8D4nxY97QvH9uT X-Received: by 2002:a05:600c:5349:b0:425:5e9a:5958 with SMTP id 5b1f17b1804b1-4264a3e88d1mr8493155e9.22.1720087107888; Thu, 04 Jul 2024 02:58:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEt3D+mPlZv70+ZMY47xcWhULRk9EV/JIyeppJd5DyPT38ApverxhnbUDAD6jMIAuujdOWwPg== X-Received: by 2002:a05:600c:5349:b0:425:5e9a:5958 with SMTP id 5b1f17b1804b1-4264a3e88d1mr8492995e9.22.1720087107531; Thu, 04 Jul 2024 02:58:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiaoyao Li , John Allen Subject: [PULL 08/16] target/i386: drop AMD machine check bits from Intel CPUID Date: Thu, 4 Jul 2024 11:57:58 +0200 Message-ID: <20240704095806.1780273-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087222200100005 Content-Type: text/plain; charset="utf-8" The recent addition of the SUCCOR bit to kvm_arch_get_supported_cpuid() causes the bit to be visible when "-cpu host" VMs are started on Intel processors. While this should in principle be harmless, it's not tidy and we don't even know for sure that it doesn't cause any guest OS to take unexpected paths. Since x86_cpu_get_supported_feature_word() can return different different values depending on the guest, adjust it to hide the SUCCOR bit if the guest has non-AMD vendor. Suggested-by: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4364cb0f8e3..5e5bf71702c 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6039,6 +6039,7 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *c= pu, FeatureWord w) { FeatureWordInfo *wi =3D &feature_word_info[w]; uint64_t r =3D 0; + uint32_t unavail =3D 0; =20 if (kvm_enabled()) { switch (wi->type) { @@ -6064,19 +6065,33 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU = *cpu, FeatureWord w) } else { return ~0; } + + switch (w) { #ifndef TARGET_X86_64 - if (w =3D=3D FEAT_8000_0001_EDX) { + case FEAT_8000_0001_EDX: /* * 32-bit TCG can emulate 64-bit compatibility mode. If there is = no * way for userspace to get out of its 32-bit jail, we can leave * the LM bit set. */ - uint32_t unavail =3D tcg_enabled() + unavail =3D tcg_enabled() ? CPUID_EXT2_LM & ~CPUID_EXT2_KERNEL_FEATURES : CPUID_EXT2_LM; - r &=3D ~unavail; - } + break; #endif + + case FEAT_8000_0007_EBX: + if (cpu && !IS_AMD_CPU(&cpu->env)) { + /* Disable AMD machine check architecture for Intel CPU. */ + unavail =3D ~0; + } + break; + + default: + break; + } + + r &=3D ~unavail; if (cpu && cpu->migratable) { r &=3D x86_cpu_get_migratable_flags(w); } --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087276; cv=none; d=zohomail.com; s=zohoarc; b=M2vhqWrLsxiA2+02xJP/jUbUzHcnGPvobWXU5GYSwowP8N6q1W83ZoLU3xcwqCyhk/Sey3pY44NuKQAitrXpkIrZkAZkPaXqaok/w6Awkdi0X8HqUBXkVM5wJF1kibnNoEKC3YNHWKat9YCkBoD3Wg7tnU7aFnMlU6b4jDTMV2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087276; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=oseQ60e5wmgH0ZYm/I14i7Pkbsm8+uJkxNMnBtHXQnA=; b=ccUDZBwIOErpteVcKVz85W+vneAsawDjXhjRTl9Tf9bMAv96kJg8TxVrT000TMyDC0VAXsaC1Hc8Buey1/zWiCFoecQv8B9IjD5oYwIFTOWuMmUiovvjKpKI9Li1e2kMxgd+Qdba5PgPBiF5L4w6ELLIfB5Jjs2P4UH1tIL1Sm8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087276047223.7303104100257; Thu, 4 Jul 2024 03:01:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEs-0007Ae-NF; Thu, 04 Jul 2024 05:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEh-0006n6-9m for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEb-00087W-GO for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:42 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-102-V77fFsZZMcGcPJcMkJ5YGA-1; Thu, 04 Jul 2024 05:58:32 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-36793b39ee5so353656f8f.2 for ; Thu, 04 Jul 2024 02:58:31 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36794e6863dsm3595268f8f.50.2024.07.04.02.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oseQ60e5wmgH0ZYm/I14i7Pkbsm8+uJkxNMnBtHXQnA=; b=im3Gz5c6uPI+Vf+Ognv3VP28mWvKjjp01N52qt8rmX26nopIsx4BXsSeaXN+M9jWwNofXo 5dGCgI3MHgyVfhNHEt/Nhk/4BCgnheE/vjfPLStGg8ktBms84RPN6+c9PBp+lTavKw44o6 vmzDbgBvOqdefM1Ho8yLeGzPVxd4p0c= X-MC-Unique: V77fFsZZMcGcPJcMkJ5YGA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087110; x=1720691910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oseQ60e5wmgH0ZYm/I14i7Pkbsm8+uJkxNMnBtHXQnA=; b=w9EBwlttGr+EdJs0FYsrXzCI+aE2d5dN11+gDDUYoDaE9J6v9xtlg6aXJVF9xCOBoW 5qBRSnNsr4+IMciMe/OUrBUmWZHoavrQZ4xBdxGO5TmtZhSLKR8DJeSnDeNSsg3DG6hl nZ1BLcVAfD8IFrHhZb1o3411WBTUmY3/5lFaxmdAMhpEQCEgoeoY/mLRvENn73UJwm7Q aC7TeTrtMUQz7QPJ6Socz3POyY6Q8mw4in33A+ZgQsl5r2xwq4qrUc8ESMRiI5ir9QLl /Rwibh64zJ5tdmUNwEjYr5XHJ1bCkv9/NJCwTUcgxSz3cRKn4Spcvy+pHZOGZ5elmV0i uVlg== X-Gm-Message-State: AOJu0YzbdQF0e40h5kzYxkkVq0SOdl+n1mC49yljzB5b/EnRwiQM1f66 ZuVAu0icjQyH2dSLnETSfJ64eygfbnJ6kO8S8D3DZBHlTTDVDAZVREzSdw+gK8bqdPLd134Vcpy goqDzKNOGvC1VlJhHNaU+RRimVZrURYgagXxELFje9qLlPjRrukDzHMO36hoDjQo6N3KOxnH59a 9XTQLlLNL299HMGoQp60MANy2yEmDwNTliebho X-Received: by 2002:a5d:634a:0:b0:35f:2030:d42c with SMTP id ffacd0b85a97d-3679dd23884mr836053f8f.17.1720087110333; Thu, 04 Jul 2024 02:58:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHiGLzNYBYPP7ccKZI76EO1/MeLF57Qjfznlta5K+o3POQ3uYjQmQIBywRVTbBLyrO+TN6YQ== X-Received: by 2002:a5d:634a:0:b0:35f:2030:d42c with SMTP id ffacd0b85a97d-3679dd23884mr836041f8f.17.1720087110019; Thu, 04 Jul 2024 02:58:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/16] target/i386: SEV: fix formatting of CPUID mismatch message Date: Thu, 4 Jul 2024 11:57:59 +0200 Message-ID: <20240704095806.1780273-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087276452100001 Content-Type: text/plain; charset="utf-8" Fixes: 70943ad8e4d ("i386/sev: Add support for SNP CPUID validation", 2024-= 06-05) Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 3ab8b3c28b7..2a0f94d390d 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -841,7 +841,7 @@ sev_snp_cpuid_report_mismatches(SnpCpuidInfo *old, size_t i; =20 if (old->count !=3D new->count) { - error_report("SEV-SNP: CPUID validation failed due to count mismat= ch," + error_report("SEV-SNP: CPUID validation failed due to count mismat= ch, " "provided: %d, expected: %d", old->count, new->count); return; } @@ -853,8 +853,8 @@ sev_snp_cpuid_report_mismatches(SnpCpuidInfo *old, new_func =3D &new->entries[i]; =20 if (memcmp(old_func, new_func, sizeof(SnpCpuidFunc))) { - error_report("SEV-SNP: CPUID validation failed for function 0x= %x, index: 0x%x" - "provided: eax:0x%08x, ebx: 0x%08x, ecx: 0x%08x, = edx: 0x%08x" + error_report("SEV-SNP: CPUID validation failed for function 0x= %x, index: 0x%x, " + "provided: eax:0x%08x, ebx: 0x%08x, ecx: 0x%08x, = edx: 0x%08x, " "expected: eax:0x%08x, ebx: 0x%08x, ecx: 0x%08x, = edx: 0x%08x", old_func->eax_in, old_func->ecx_in, old_func->eax, old_func->ebx, old_func->ecx, old_= func->edx, --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087241; cv=none; d=zohomail.com; s=zohoarc; b=Xik/ul18LOCO/vSzPKVLXIa2kJFKPfy6W8Pn2GdjKvEY7z0TJKTAsSItJOymkPEEuuJhw1TLLyTJIzH241sqzEsuPglap++zepumDbU3JESJD9s9y6fbQaU/c+uWq6sozutxP4qVaH+CX8hpOXMmr9FjywxWEBeAJCrKTtNX6q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087241; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=4MTUOgRFnaAQLOr/FyDNaauHZx0Uilejdebgta3jTEQ=; b=bhZ1iSo955wdGvkkmeKSC/7jnHavUGFdTubv8oW/+1+5DkchK205SqZ6pPOOwWLWOJUkGHSShMTTOsjiA5urwGp/o1oP4P98h5CTrKpAh2UYfLgY3yNoaqalH+81QrYfuaBjWRgG7tAyG/phvE38Uxu7DctGTQA41cMLpFXyHNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087241986642.4687762466349; Thu, 4 Jul 2024 03:00:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEj-0006n0-1G; Thu, 04 Jul 2024 05:58:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEe-0006iF-1z for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEb-00087p-7u for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:39 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-480-GSME48tbO5WlGufHvFhuHQ-1; Thu, 04 Jul 2024 05:58:33 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-425685183edso3708165e9.0 for ; Thu, 04 Jul 2024 02:58:33 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264aa07a95sm15361815e9.1.2024.07.04.02.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4MTUOgRFnaAQLOr/FyDNaauHZx0Uilejdebgta3jTEQ=; b=XuH5OJ8fsxNMdMJon5SFxh6gMbFKnNQHPkimbElbNONoxJwSjfr89QEHdCWe8oEaIK6125 W6a/AUSDjAz/IMVmAz6HXE9FHa3qhQzEUwoSxG4WIQr8kz4p/moQzb67T8NTqBPqFwAePh i1iVRzIo4Vpc3+sv1QJzYsseDxnUBEU= X-MC-Unique: GSME48tbO5WlGufHvFhuHQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087112; x=1720691912; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4MTUOgRFnaAQLOr/FyDNaauHZx0Uilejdebgta3jTEQ=; b=iwb8txBFgrGIVw7IPQl2edHa5YFCN+z/OUGM/0Ixg0oRp/sJqul1lWimSHhZ3QKQLm gAZrYWa+PVscCXnbFlOW3TZfnRRDROzDi8zlRCLWEKmpu0XF8GRToSQxGHxEbIY2oEja jeWmAxJGvdado+c3c//i2s7ooiPg1yeQoX7yACkVfz1Yf9rBEfjcxVL2GVeyBTu0rlXB H42CD1la12C1V7CaEB9ZSZT3NXDtjedgW1XtrR+LXdysr4+QF9J0caJbKkiGPW//AJZX 7iU+CbcQtgg0b8RaSQ/OSc9ShO4nz6CWyR+Tislu9cV2NBuMz1Ld25mEFWBZo3u5TRlf kQ0w== X-Gm-Message-State: AOJu0Yx9MUAipAqy3UPYHZEBi3mQzbK95I9sZyESaxoPtXkX1lHPhyLP rCLk/RQLIhf77tXtzpjTYby5vl+fZ2osKCPmFEnWpnXfAUlCLWW8nPaZ4uoXIfFac5YFDBMjISZ jQoPMQc5tGktSJ+9KqEiy1p5uLF+5lfqVqMIFTK/8s4Yg5MNsXYrmyjPRgz3zPPDkTkSfOdc8Lv vdzB22zN/K2Frh4DhsxC/RnRsCc4FDhh7oOAze X-Received: by 2002:a05:600c:1d01:b0:424:a823:51d7 with SMTP id 5b1f17b1804b1-4264a3d98edmr7901895e9.5.1720087111876; Thu, 04 Jul 2024 02:58:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2d7pjRtK/y4tRaCePStbfdb7cFHEqio4Q9CKTU86/vYRj+HdJQeMBy9PKSnx3DzlKf/ij5g== X-Received: by 2002:a05:600c:1d01:b0:424:a823:51d7 with SMTP id 5b1f17b1804b1-4264a3d98edmr7901815e9.5.1720087111483; Thu, 04 Jul 2024 02:58:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/16] target/i386: do not include undefined bits in the AMD topoext leaf Date: Thu, 4 Jul 2024 11:58:00 +0200 Message-ID: <20240704095806.1780273-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087242232100001 Content-Type: text/plain; charset="utf-8" Commit d7c72735f61 ("target/i386: Add new EPYC CPU versions with updated cache_info", 2023-05-08) ensured that AMD-defined CPU models did not have the 'complex_indexing' bit set, but left it set in "-cpu host" which uses the default ("legacy") cache information. Reimplement that commit using a CPU feature, so that it can be applied to all guests using a new machine type, independent of the CPU model. Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 +++ hw/i386/pc.c | 1 + target/i386/cpu.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 9bea7142bf4..0d5624355e4 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2104,6 +2104,9 @@ struct ArchCPU { /* Only advertise CPUID leaves defined by the vendor */ bool vendor_cpuid_only; =20 + /* Only advertise TOPOEXT features that AMD defines */ + bool amd_topoext_features_only; + /* Enable auto level-increase for Intel Processor Trace leave */ bool intel_pt_auto_level; =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 77415064c62..5dff91422ff 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -80,6 +80,7 @@ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 GlobalProperty pc_compat_9_0[] =3D { + { TYPE_X86_CPU, "x-amd-topoext-features-only", "false" }, { TYPE_X86_CPU, "x-l1-cache-per-thread", "false" }, { TYPE_X86_CPU, "guest-phys-bits", "0" }, { "sev-guest", "legacy-vm-type", "true" }, diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5e5bf71702c..c40551d9bfb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6982,6 +6982,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, *eax =3D *ebx =3D *ecx =3D *edx =3D 0; break; } + if (cpu->amd_topoext_features_only) { + *edx &=3D CACHE_NO_INVD_SHARING | CACHE_INCLUSIVE; + } break; case 0x8000001E: if (cpu->core_id <=3D 255) { @@ -8293,6 +8296,7 @@ static Property x86_cpu_properties[] =3D { DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor), DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true), DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, tru= e), + DEFINE_PROP_BOOL("x-amd-topoext-features-only", X86CPU, amd_topoext_fe= atures_only, true), DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false), DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true), DEFINE_PROP_BOOL("kvm-pv-enforce-cpuid", X86CPU, kvm_pv_enforce_cpuid, --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087135; cv=none; d=zohomail.com; s=zohoarc; b=Hkqi2fkvfiMYj1u4KVeqvEoIWdu5d0T/UdVOA/X2y0LOjGE4QnnL40W5uL0C2BjLEU52fR+W9WLx/8uDnHI363LUGk8ZbADFP1EkOxXoEXABnUmLRsLFwwTk31EV8hTb6KSALbXLH/61njtuMnR11l58tsDlrIRbRb67XMrHqmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087135; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2tVvMMPgyZXQgsinAc2GOpqwGj2XLuY/AeQ9jg80A08=; b=mxReEZC0pZxtTMhfWV1t9ZMjlOqUqgpxXHfmVS6olafv02dv72y77yDTXj605OFbOJfozfUmxfueKE+DiHElEcObIOcdGwncQvOw6gGjSHiPL3uEZbODRq8bKImkL3t8k6N5fiLrKXKRpNwykbljY7uN4AfW8NjyYnr+tP25LA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087135003206.395988904378; Thu, 4 Jul 2024 02:58:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEg-0006jz-88; Thu, 04 Jul 2024 05:58:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEe-0006iG-Em for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEc-00087z-MT for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:40 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-S82vzlgINrmhO2TGv_qK6A-1; Thu, 04 Jul 2024 05:58:35 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4255f94080bso3264635e9.2 for ; Thu, 04 Jul 2024 02:58:35 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264d4c861fsm3553255e9.14.2024.07.04.02.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2tVvMMPgyZXQgsinAc2GOpqwGj2XLuY/AeQ9jg80A08=; b=Ak5xFk0G3uG8fziFbtggRg/w113cmL4MLqcqLGGwZ7azwojEvdIOzt3/kMEXAWJNe7hCYu 9qWbKs+2Yh+FZ2Fnzisk/uhmG/MRoZZZgCPbsUUIWBhOWsKxG5t/b148Cut3HGNZxm2L0U wJBRFHJEKh1LNQQVsdD+SR7sGT9kJgI= X-MC-Unique: S82vzlgINrmhO2TGv_qK6A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087113; x=1720691913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2tVvMMPgyZXQgsinAc2GOpqwGj2XLuY/AeQ9jg80A08=; b=NeLPSNNUbRzXtCRaPNrHMvjRNJm++E44PyHRIed+X+8TSkPklcov3lnSWBogtg1z16 x5puYMZ4GWfdGxJtNE1QYiLB5PGO2AKzHlhzTxtvVVnkz7JN2EzzcisnGPKOaJqVVwvu LrZ05i6Hf9IAvKqMxBFvxBH80cyRURTPArmSgupEQG7jpPprgES5RST/btK6F/ynXJP0 bPhSOTETeipZh6EWh3/2/iitiPxzi4NINyD28RHZ35RodRotHNZGbRqDEuky1fMoShMf 5lSF5O4iOiEvvFsLs7ZaMqGQK546bdUPY9vLclrlO6gY2ynvVmZ1jCRrKcPKUEBrWjn8 stjQ== X-Gm-Message-State: AOJu0YxA4InGDBiMsw+s1ICMiZ3mWEGJZuEpaHpe6ZTVEkaZco79b0yG ZRg7s+9/rCpsHVOGcUVR3MWK3kE1mKvbp9eRnV9cZIFdeDxweDzlMup0REv1OoAt6tiGz2CuVd+ AO2G/FdKi8izdAJJxjNwYnXHp0FFrnHpAUqmCutquwqJMqcJe1Q2Vcviue0pbz+RlvHmfNJ+WFb ghxKSe1rza6hflM4EQSjwsAbrWo+zgCff+fQBp X-Received: by 2002:a05:600c:15d4:b0:425:633d:926a with SMTP id 5b1f17b1804b1-4264a3e8b60mr8638465e9.21.1720087113354; Thu, 04 Jul 2024 02:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEI53qrC4vU/dEiQlgBgVWcLhDCxbTzLT2OC/uRDBXGJ8hIhsafGUb/49/VSIs1SHKgamR1KQ== X-Received: by 2002:a05:600c:15d4:b0:425:633d:926a with SMTP id 5b1f17b1804b1-4264a3e8b60mr8638365e9.21.1720087113021; Thu, 04 Jul 2024 02:58:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Michal Privoznik , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/16] i386/sev: Fix error message in sev_get_capabilities() Date: Thu, 4 Jul 2024 11:58:01 +0200 Message-ID: <20240704095806.1780273-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087135695100002 From: Michal Privoznik When a custom path is provided to sev-guest object and opening the path fails an error message is reported. But the error message still mentions DEFAULT_SEV_DEVICE ("/dev/sev") instead of the custom path. Fixes: 16dcf200dc951c1cde3e5b442457db5f690b8cf0 Signed-off-by: Michal Privoznik Reviewed-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/r/b4648905d399780063dc70851d3d6a3cd28719a5.17= 19218926.git.mprivozn@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 2a0f94d390d..054366878aa 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -597,7 +597,7 @@ static SevCapability *sev_get_capabilities(Error **errp) fd =3D open(sev_device, O_RDWR); if (fd < 0) { error_setg_errno(errp, errno, "SEV: Failed to open %s", - DEFAULT_SEV_DEVICE); + sev_device); g_free(sev_device); return NULL; } --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087149; cv=none; d=zohomail.com; s=zohoarc; b=cHse1MLC2rxV9dHB9uWD5vXBe6rwIJGgVnmlir/22xkXn+uglJS5O/JIRvbsM4LSlofnACm7bHbNSvdSB2tFw64OhRvDC6r5ELCAnlGTZe34XWcVTRv9u4Afr1WQ807odATUtXFyO9GWmYOMoRcZoTSxl3N5f/ADEKHYM9kguUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087149; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pRScqcX5QDybTFLfNWFpvTz+PpMZynX466ZxF4qnzH4=; b=BWFE9i7zIcHTdM41DUjTzVjr92S1IdldttgbtV0v9Jmu66nuk6TYaNHYVUedrC85YkzDSRqCM7BXlTecaZbUrsBP/7xgHwNCppeErdceXLwku+54B8inDdImzmrjnV2/CsyP3ptKNvfjhQrpSiMzLtxQu0B45n97hGOWY8omkEY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087149227272.60528745649344; Thu, 4 Jul 2024 02:59:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEl-0006vH-2x; Thu, 04 Jul 2024 05:58:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEg-0006lh-IW for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEe-000889-RL for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:42 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-Qg6uIkizPTOHD_QYMkfFbw-1; Thu, 04 Jul 2024 05:58:37 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42648daf064so2826785e9.1 for ; Thu, 04 Jul 2024 02:58:37 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d6677sm17316115e9.17.2024.07.04.02.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pRScqcX5QDybTFLfNWFpvTz+PpMZynX466ZxF4qnzH4=; b=ADkYR14syI8Mrpob96w3B5deOz/PhINzoQ4zAuDCJtG5Nvr/8JKKzapzdJxuQFHt3ntsN8 oWu7JRctDsDaiIvWSJXloyW17Q5QRakqoYUXX7yzCZbPWrGLZx6q1GgAI9QIvOfy7soWHG ZVBhqyXdMWTeAv/eZinEKbHHTRym+bs= X-MC-Unique: Qg6uIkizPTOHD_QYMkfFbw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087116; x=1720691916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRScqcX5QDybTFLfNWFpvTz+PpMZynX466ZxF4qnzH4=; b=qavvhOs/DTN/ry/pVDVLrxl8vEyik5Mad+2UTnQ/FPgXQ0Xj/N/YzkqI5rWWc7pGzu iCHiRt/AGpNqZ190mfjTMLDYnD25FpWFjeFvMBFIN7yW2rUUkulkR+IdMP6XXSz/YDXS jT8h2ctVIeChvnV7E7PuevRyWsZ2fzG1I2tOWBpLN6A44Q5Bf0rFT0YhXiRs9Sqbom0D KMTX5agfS4HuuUqIJFO6EuabWAEDzoH7JjFAB+xygcJsXIh1RUB/3+QDKVXvVnWUB16o kDYHyf3mfkKQummjGAKshBslFLG3Rs2u82fZLjfZphoOVMt2C2S1GO8ny6EY2H/EDoSt Kegg== X-Gm-Message-State: AOJu0YyLIMbomC0fVzfiBDunYngbljj/JQxVxYymD+FSkFwqrOibU+1s sKWW1PjV3Km/RuBsCE7w3Zi27IL3UZu8XRsw3jtl5D69Tembqq3H0JcyPDcTVz17eL/op883aNo 7HQDB6PF1u1MA4pPlBvjYWvS44rNBf+7Bv9eWTC63vrOlYc2RvV35ncZrCQVqfYcfdWr6aoEXcy +vtTqvSuQJdIaRdoQsNfryN9ZH3+Ztb5Sfm43C X-Received: by 2002:a05:600c:47c5:b0:426:4765:b905 with SMTP id 5b1f17b1804b1-4264b1275dfmr10103155e9.7.1720087116065; Thu, 04 Jul 2024 02:58:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvHS8Ui8lUT2zZuT2ZO17MVP1SKwRLd/pL2wqAGdo1MH6IGfrxk7WBCAxWkzsOpWUxqdM99Q== X-Received: by 2002:a05:600c:47c5:b0:426:4765:b905 with SMTP id 5b1f17b1804b1-4264b1275dfmr10102915e9.7.1720087115691; Thu, 04 Jul 2024 02:58:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Michal Privoznik Subject: [PULL 12/16] i386/sev: Fallback to the default SEV device if none provided in sev_get_capabilities() Date: Thu, 4 Jul 2024 11:58:02 +0200 Message-ID: <20240704095806.1780273-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087149768100005 Content-Type: text/plain; charset="utf-8" From: Michal Privoznik When management tools (e.g. libvirt) query QEMU capabilities, they start QEMU with a minimalistic configuration and issue various commands on monitor. One of the command issued is/might be "query-sev-capabilities" to learn values like cbitpos or reduced-phys-bits. But as of v9.0.0-1145-g16dcf200dc the monitor command returns an error instead. This creates a chicken-egg problem because in order to query those aforementioned values QEMU needs to be started with a 'sev-guest' object. But to start QEMU with the values must be known. I think it's safe to assume that the default path ("/dev/sev") provides the same data as user provided one. So fall back to it. Fixes: 16dcf200dc951c1cde3e5b442457db5f690b8cf0 Signed-off-by: Michal Privoznik Link: https://lore.kernel.org/r/157f93712c23818be193ce785f648f0060b33dee.17= 19218926.git.mprivozn@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 054366878aa..2f3dbe289f4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -587,13 +587,13 @@ static SevCapability *sev_get_capabilities(Error **er= rp) } =20 sev_common =3D SEV_COMMON(MACHINE(qdev_get_machine())->cgs); - if (!sev_common) { - error_setg(errp, "SEV is not configured"); - return NULL; + if (sev_common) { + sev_device =3D object_property_get_str(OBJECT(sev_common), "sev-de= vice", + &error_abort); + } else { + sev_device =3D g_strdup(DEFAULT_SEV_DEVICE); } =20 - sev_device =3D object_property_get_str(OBJECT(sev_common), "sev-device= ", - &error_abort); fd =3D open(sev_device, O_RDWR); if (fd < 0) { error_setg_errno(errp, errno, "SEV: Failed to open %s", --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087193; cv=none; d=zohomail.com; s=zohoarc; b=lqpposw8LitSpqFbpG1Mt/Q0pZIkqRo8nT5q7sEJA1IxsWzhUdajXi/14KSdRFr/HbgwELi9oE5aJghA0t5GWZgFdPnqZXXqCbuhc1d9uoL2xsqcJe8OC6WPolAsb2BtH75Yl/eXKKfCLBqcxLl2IFv8jQ5MJAzk+4dTxXRXJdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087193; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=n3cYvj5uU+nN/F2qMr7WF3fjwOiYUBjz++YEMm43ueI=; b=g816FoDul7oYyuwEgDkje+PAfHxBYCf5SlgaQWXHjuHnQtk7JhD/eUf6/a+zVDBSbnrAPWguIE7XKOvWFwOXqObSbubqXlbxcJsHhtbIaf08r7BBB/CJF4ptMjBtBZ+2mDXSeLRiSrsD0Sq8heH1Dqc4Ye7qPA0qO0QexjVx8Ng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087193360118.09391340292689; Thu, 4 Jul 2024 02:59:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEq-00076P-5i; Thu, 04 Jul 2024 05:58:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEj-0006oT-0O for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEh-00088O-2Y for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:44 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-386-3abIG9b9Mg-LwzYgKsfyqA-1; Thu, 04 Jul 2024 05:58:39 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-367990a5796so327964f8f.1 for ; Thu, 04 Jul 2024 02:58:39 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3678f41116bsm5012238f8f.116.2024.07.04.02.58.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n3cYvj5uU+nN/F2qMr7WF3fjwOiYUBjz++YEMm43ueI=; b=FaCCpdx/gYE8Xdn6zoOKWzSGz4qGjWlIKS6+UJx8sBQJiLocbrGwg+9rJfyzHck9FU+6VH 1Y4aXXjH5cMQ/d20JA+a5DmsaVl6kyp5N4ksvS0UJqd6yEWLupSdnFGzXQG6wDQkLzho2J F197iH82dw5QAg4rWUa6G67D/wNwGdI= X-MC-Unique: 3abIG9b9Mg-LwzYgKsfyqA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087118; x=1720691918; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n3cYvj5uU+nN/F2qMr7WF3fjwOiYUBjz++YEMm43ueI=; b=p0C64IWpfslj1R3Nd2JQmR1GBKJ/sXbYarf84HI/HK+JfflxtWLUNr9rN7XCO4gce4 yxS7WdaAMOwt0D+kZVWJmJJPkOOsEsGsl7c3iwKYEqdsCn4B1p8uLcoCM/5DdRzSVSKI Fv9lYq5czZv+Ul/xUhKcDl1k+fYrAnOihx0/+2A9fBZNU7/vSv4GvgGvvcwiH9zTHMft f+IybFqUyfim7iCF4rkzDsUlZinpyqAk9v/CH38cUyvZE4B27EV343CW5rase7ux0RRA WpJ4fBbgSrxSB5NNjFkJAlMs3Em0ZjPIJ8XoQlkNuBh3SkIP9FTIZQdzFA/J6BSsmOvy 2muQ== X-Gm-Message-State: AOJu0Ywkngbx3+DUoFyaSz6b7zes/WfUTEzxynoUXBuBm5bH2Yxn0L3q fRf8oUr1KcgJeplzTDL2lAnGvClRxUh/WuQVQEiynJwQSkG20MQeFrMiYDuiA4wdoZ7WaUXhKJ3 4MWcbHG57SXxX0H22rqiYbyu7dLhjQzHdPb/l+6gni5ZqwqXbBgi1DateeHyzV/a9mrMT8LoViG WWxDlhalS68T045JzFUnYe6YXA7KjsNXMfjP9Z X-Received: by 2002:adf:ed49:0:b0:367:9621:6fa with SMTP id ffacd0b85a97d-3679dd547e9mr1072970f8f.37.1720087118522; Thu, 04 Jul 2024 02:58:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLcRS0a81rrU++UgUxCznRNHJ0gaYkNI/TL3izcN7UbeUahDDOXDs3q8Qw6UShiNbW4Mit6g== X-Received: by 2002:adf:ed49:0:b0:367:9621:6fa with SMTP id ffacd0b85a97d-3679dd547e9mr1072958f8f.37.1720087118185; Thu, 04 Jul 2024 02:58:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/16] target/i386: add avx-vnni-int16 feature Date: Thu, 4 Jul 2024 11:58:03 +0200 Message-ID: <20240704095806.1780273-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087193935100001 Content-Type: text/plain; charset="utf-8" AVX-VNNI-INT16 (CPUID[EAX=3D7,ECX=3D1).EDX[10]) is supported by Clearwater Forest processor, add it to QEMU as it does not need any specific enablement. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c40551d9bfb..c05765eeafc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1131,7 +1131,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { .feat_names =3D { NULL, NULL, NULL, NULL, "avx-vnni-int8", "avx-ne-convert", NULL, NULL, - "amx-complex", NULL, NULL, NULL, + "amx-complex", NULL, "avx-vnni-int16", NULL, NULL, NULL, "prefetchiti", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087254; cv=none; d=zohomail.com; s=zohoarc; b=I1fHrCSo3AsUP0ypg8NPrSNEuD2LxFR/z0tWstWNNIi5qPpgjh/sBv9ddqaa40PQ704GzYyQh6eVCzn1hjofQntse2V/QboDZLZE1m1F3jkNRx26lWfchFo7bnwpVMYgDbN8cs9NjRDSCU8iSz4HXNYyzgvjXTTdMIPBz5Wns6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087254; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7MkRViG8QZ36KoPeTrYQRb9R5sxJAqGeAW3NIdlDUcY=; b=OjRtNvyoz/p2V/VsidBMLegTsuDnVX+wJYhNOygm4IXpvuQ4/S/abCtIPGYoA7KX7bX9cFQ7iKKPFiDcEZhiI5zONBwRMnsVLCFcMW2KNbhOknZ2PT0lzaR030irmG4h1CL8BgORm0Fdcd6bXJ0KVikZvsIX5/MHKywFOWsv2y8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087254675253.98127140505915; Thu, 4 Jul 2024 03:00:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEs-00077u-Fh; Thu, 04 Jul 2024 05:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEk-0006up-Dz for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEi-00088i-Oj for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:46 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-tNuVtscjOc6-240Cr64Ovg-1; Thu, 04 Jul 2024 05:58:41 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-367990a5796so328071f8f.1 for ; Thu, 04 Jul 2024 02:58:41 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a103366sm17879438f8f.102.2024.07.04.02.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7MkRViG8QZ36KoPeTrYQRb9R5sxJAqGeAW3NIdlDUcY=; b=Urkq4L4IQ2uprxgwuu/HXJLuY0vCp6j/8Ya+pqWPKAn7lErARkj2wVrwUwGnuSP/OTDzzn stFvaJtMCeFcu4THV6u6lV9hKtTfw1JNA3ZRUF8obAwOU3a6JZIBlEMwHttoYn6WZ3kD/+ /X1vhKWc0yH0EImCSbZQ0UILceS1f2w= X-MC-Unique: tNuVtscjOc6-240Cr64Ovg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087120; x=1720691920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7MkRViG8QZ36KoPeTrYQRb9R5sxJAqGeAW3NIdlDUcY=; b=wE9Q+VN4sUvT7XAjP+/kA8prsI8ptUwxdi6LsQhwRqz0nSkqbbp0YmAY7isVSc0Pr9 uxTARjvDRRQajxKHhnf4PoYHqca3OeXAYTOJsFcaoguwW6OnkzEhzGCemHrq+lCJUFQJ HtWBaOK247nlKuBpQZXBG+2SgNr9j63TrwOI3/NKqF92+BfGmioAYHQcSqvDRcbWZI7t 1X3pMZIt958Y4U0BX4w84knrIKF1oVRN0A37lJgtKbIxPXQTM/xEFYxrasPiLgYOFRWq c1lNUrRQQ1CCuGiR93LTEtcZoHr8TEscHseFg8PX/vcGcKvaTfwb1Y7gtkukMBQKV/sT rRyQ== X-Gm-Message-State: AOJu0YzRZ1bJW7ujvM//twM1m2RcuDR9873r/pULzXRfW/NBtgJGPIZ9 A5RtVLjarUXr046OCCRimzEP7hF0xwNSIDq8PbMrWNhz3ndVqcf6F+r6OoP91tAsYxVy8Ne9XVD ucPLK155SAjQT+2VLMg/K7S+YgBYpyGrrOk7ubf1JwQTti5Npy+GCa8bybrXmlvPsKMtmMi69mV npoV9l27Gu7oqFsTSclwYbsKlDZ0X4XGW1Xsfq X-Received: by 2002:a5d:5265:0:b0:367:9ce3:1667 with SMTP id ffacd0b85a97d-3679dd3c4eemr791563f8f.15.1720087120022; Thu, 04 Jul 2024 02:58:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeWQQn67J2uNHzR8rJjJIkc2KFIzrg2kotGZayvEsJHFaCKCLm0Ujp2E8Z28vRLJSuY4OYwg== X-Received: by 2002:a5d:5265:0:b0:367:9ce3:1667 with SMTP id ffacd0b85a97d-3679dd3c4eemr791554f8f.15.1720087119695; Thu, 04 Jul 2024 02:58:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Maxim Mikityanskiy Subject: [PULL 14/16] char-stdio: Restore blocking mode of stdout on exit Date: Thu, 4 Jul 2024 11:58:04 +0200 Message-ID: <20240704095806.1780273-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087256528100003 Content-Type: text/plain; charset="utf-8" From: Maxim Mikityanskiy qemu_chr_open_fd() sets stdout into non-blocking mode. Restore the old fd flags on exit to avoid breaking unsuspecting applications that run on the same terminal after qemu and don't expect to get EAGAIN. While at at, also ensure term_exit is called once (at the moment it's called both from char_stdio_finalize() and as the atexit() hook. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2423 Signed-off-by: Maxim Mikityanskiy Link: https://lore.kernel.org/r/20240703190812.3459514-1-maxtram95@gmail.com Signed-off-by: Paolo Bonzini --- chardev/char-stdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c index 3c648678ab1..b960ddd4e4c 100644 --- a/chardev/char-stdio.c +++ b/chardev/char-stdio.c @@ -41,6 +41,7 @@ /* init terminal so that we can grab keys */ static struct termios oldtty; static int old_fd0_flags; +static int old_fd1_flags; static bool stdio_in_use; static bool stdio_allow_signal; static bool stdio_echo_state; @@ -50,6 +51,8 @@ static void term_exit(void) if (stdio_in_use) { tcsetattr(0, TCSANOW, &oldtty); fcntl(0, F_SETFL, old_fd0_flags); + fcntl(1, F_SETFL, old_fd1_flags); + stdio_in_use =3D false; } } =20 @@ -102,6 +105,7 @@ static void qemu_chr_open_stdio(Chardev *chr, =20 stdio_in_use =3D true; old_fd0_flags =3D fcntl(0, F_GETFL); + old_fd1_flags =3D fcntl(1, F_GETFL); tcgetattr(0, &oldtty); if (!g_unix_set_fd_nonblocking(0, true, NULL)) { error_setg_errno(errp, errno, "Failed to set FD nonblocking"); --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087269; cv=none; d=zohomail.com; s=zohoarc; b=lV7Tt0bWxH7M3pMX61jaJn95zUVQM90zt0DCES0Bo85eKkT8G/mGX4gIulGBrs/mjmw+KB0zLZjxrKpbXi9c8e/yHkoryGzDPxHjfDOiJxjdcA4U7WEVp57OlDhzFhUNBKAjSOu7k4DhGctoO3K4jqSFyMR6nR9FMq+Q31PHHCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087269; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=8YNBGwi/blnINBXAKV0uUkbw1rjgQvKXb4SGyR3x4F4=; b=chJSLKhudTYWP5P/MakS+jF/gzoOHzJ6egEl6I4op2R4fT20dbyuEQaLVPndK5PASw25Jbh6tnJmNG28bpuzONTWbDMPywFMg0hHnuJbCqCN4zNQrxsGIm0Dib+3wLDdCGlr+vKB8VSR56/Gg9liuPMjnLgmhdG9gO6SuxFsX38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087269278903.2247362216535; Thu, 4 Jul 2024 03:01:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJEu-0007Cm-Md; Thu, 04 Jul 2024 05:58:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEr-000784-EF for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEp-00089a-Tp for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:58:53 -0400 Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-VhyKXNYVOwuQhCBSBTcTPw-1; Thu, 04 Jul 2024 05:58:46 -0400 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2ee45dea727so5316061fa.2 for ; Thu, 04 Jul 2024 02:58:45 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a2ca5casm17347975e9.32.2024.07.04.02.58.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8YNBGwi/blnINBXAKV0uUkbw1rjgQvKXb4SGyR3x4F4=; b=iHDadlmrjbUdMSnltO9MtNhtpFdZKNFdZn8m6knaaKkjB+AlXM1kg60vr0mbqfBamovniY C8Bu3iNNkg3taMxMhwafXM9Wyn/3Pvl7brsbe6Iiaoco6w0fuUxgtG7TdHBlXPdsS1qO3c AtMYcY7xdAohbG/3P0WWyRPW9XfUqRc= X-MC-Unique: VhyKXNYVOwuQhCBSBTcTPw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087124; x=1720691924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8YNBGwi/blnINBXAKV0uUkbw1rjgQvKXb4SGyR3x4F4=; b=ajdvJQ6J+zdTdhg23pVWIPSelOoKKlUg29YqO57wIm0mQzXHBx7WyZKzhiBTIb3t2n v8s6TXU4pzxorbgU3+eOJitYyjPnIFjzQ2Jih8I/sru2Xz061xQ/T7F6Gijcm6/Aavy2 zNk/bLjZpSTxCBReZPyuitfPQuOJtw2saFAY+X9TLb8YhQItOJZj5RrKLepY32TNU2k4 25SqMA+Iuj8pcuZ3zt6tFoDiA1Ph+OvYUJTXO9mLPzhlgxzV+Ck4KjdocZY5OtvfWOAA w64oL1LGncJL0b/XLyEba8eyxppYU+zBATqXm71EYwsQ3jAhdbhcGaQDquMa4d7d0hoD ecHA== X-Gm-Message-State: AOJu0YxQeKc5aryteQa0ljDc77XIU98C92rr/9xabOfVRHPd9nc1mZPE p83buCEQX/CN8shzPnmYhMVKEEVtgiISjYBMkerl6zXpAqYQcWi0RNFGL2SCqNQ0ljuW7JHnpdl 0sPFh/ZypQDE5n/6Q60LD7OJrzlnz5UeHgZCkAPHNj83lLbWP7bhcKF0GV9wG3VElC0FU8uIP9i ag/kS6nZkPyhfSlVwXkUXrkeXNP9+NMa88kTbn X-Received: by 2002:a2e:a312:0:b0:2ec:54ec:173d with SMTP id 38308e7fff4ca-2ee8eda7119mr8166341fa.27.1720087124426; Thu, 04 Jul 2024 02:58:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDiga0/GUfD4Rgrx8+CnT1PyHAG6o5mf302odZeu+v/p+zB4VAkIC6VzT4yxXetWBxXcrRSQ== X-Received: by 2002:a2e:a312:0:b0:2ec:54ec:173d with SMTP id 38308e7fff4ca-2ee8eda7119mr8165661fa.27.1720087121932; Thu, 04 Jul 2024 02:58:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/16] target/i386: add support for masking CPUID features in confidential guests Date: Thu, 4 Jul 2024 11:58:05 +0200 Message-ID: <20240704095806.1780273-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087270403100001 Content-Type: text/plain; charset="utf-8" Some CPUID features may be provided by KVM for some guests, independent of processor support, for example TSC deadline or TSC adjust. If these are not supported by the confidential computing firmware, however, the guest will fail to start. Add support for removing unsupported features from "-cpu host". Signed-off-by: Paolo Bonzini --- target/i386/confidential-guest.h | 24 ++++++++++++++++++++++++ target/i386/kvm/kvm.c | 5 +++++ 2 files changed, 29 insertions(+) diff --git a/target/i386/confidential-guest.h b/target/i386/confidential-gu= est.h index 532e172a60b..7342d2843aa 100644 --- a/target/i386/confidential-guest.h +++ b/target/i386/confidential-guest.h @@ -39,6 +39,8 @@ struct X86ConfidentialGuestClass { =20 /* */ int (*kvm_type)(X86ConfidentialGuest *cg); + uint32_t (*mask_cpuid_features)(X86ConfidentialGuest *cg, uint32_t fea= ture, uint32_t index, + int reg, uint32_t value); }; =20 /** @@ -56,4 +58,26 @@ static inline int x86_confidential_guest_kvm_type(X86Con= fidentialGuest *cg) return 0; } } + +/** + * x86_confidential_guest_mask_cpuid_features: + * + * Removes unsupported features from a confidential guest's CPUID values, = returns + * the value with the bits removed. The bits removed should be those that= KVM + * provides independent of host-supported CPUID features, but are not supp= orted by + * the confidential computing firmware. + */ +static inline int x86_confidential_guest_mask_cpuid_features(X86Confidenti= alGuest *cg, + uint32_t feat= ure, uint32_t index, + int reg, uint= 32_t value) +{ + X86ConfidentialGuestClass *klass =3D X86_CONFIDENTIAL_GUEST_GET_CLASS(= cg); + + if (klass->mask_cpuid_features) { + return klass->mask_cpuid_features(cg, feature, index, reg, value); + } else { + return value; + } +} + #endif diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index dd8b0f33136..056d117cd11 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -548,6 +548,11 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uin= t32_t function, ret |=3D 1U << KVM_HINTS_REALTIME; } =20 + if (current_machine->cgs) { + ret =3D x86_confidential_guest_mask_cpuid_features( + X86_CONFIDENTIAL_GUEST(current_machine->cgs), + function, index, reg, ret); + } return ret; } =20 --=20 2.45.2 From nobody Sun Nov 24 20:34:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720087172; cv=none; d=zohomail.com; s=zohoarc; b=lpxHSb3sBkRfcyyzvFzM0nF2hl//H+tyFAcVMCK0qGWwkb2YS+z2JMX0Nugm4NXSFFMdooKP/vpt1aym0423+/93SsGbKFaJxS7CKyBOo6j7MW3FZs9Vm8PKPzvtMDk2suV4T6FTnevKJnwqAeKyGUqn13GN63LGxaiIDlLfaoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720087172; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=84KwKQf/6CUqIB9ra91r9/AV4OKX4iDYobaOtPDgsqk=; b=h3oOsiAX2qGBZ+rJaEuS7+ClHft1QpwOa1MLQ76fGHyzV0RlIr+x3BL0D8uqr9h80YMSRJ3yf5K/f19EfBEZ+eqmWDa4Aro8/g2LbKWkT8iXgD+u352901/Uf42d4IZwBGsfZ0GgoRpimW/yWs0Xb1/HajQTBaQrKJBnXLQoVC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720087172912827.9049180051703; Thu, 4 Jul 2024 02:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPJF0-0007Eh-8w; Thu, 04 Jul 2024 05:59:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEy-0007Dj-SQ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:59:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPJEp-00089b-5o for qemu-devel@nongnu.org; Thu, 04 Jul 2024 05:59:00 -0400 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-507-xDBNFXTpPlmShGKNrlMPCg-1; Thu, 04 Jul 2024 05:58:48 -0400 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-52ce324c204so539399e87.1 for ; Thu, 04 Jul 2024 02:58:48 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367958d8966sm3379604f8f.91.2024.07.04.02.58.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 02:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720087130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=84KwKQf/6CUqIB9ra91r9/AV4OKX4iDYobaOtPDgsqk=; b=Wj1TCngQYFsXr1wWzXvjH25OF3jNXw4QTfsEvpBkcL9QGqEr6Ej8645ghpmJeB2M3jKXbZ dChK3rkRROYCyIb+361VOwTpf3o6UtctiaH7Pal9ziUdaOVI/Vj//xlHLiir+Fq9NHom6V cVDwDr/m+licVfdwYCyvtt8Gul7Gt3M= X-MC-Unique: xDBNFXTpPlmShGKNrlMPCg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720087126; x=1720691926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=84KwKQf/6CUqIB9ra91r9/AV4OKX4iDYobaOtPDgsqk=; b=BXDi8rxMZnXNA3JtGrZMadY/7/rXg4UCt2aoT/n4sgm1dMfog38NjQCcgJSq1UV5+F HPlCRqZFE+5OMUriiaooXqQHb/3l8xRqezWBkP9g5HHYztmriZNd+UbGYC/a41MHiCKa TC70xF/9OKZ1VyeXyIXORAb1L7raqXMvHd2arYxr0KtljY2jv/92a82GEMCVHuBBpMFn HiCKMhlH1q4eWNlONA6Od7eeyK0tQDAP1V6RoEY0CiArDiu2+8uRhCwEcALK3HMRjI47 IYBCZiYGRKLYGtnGlClkiZerEnVgOmtf4ths1FE9pIinsHZuYU1+z9yGcnoMJfG1YzBo dPEQ== X-Gm-Message-State: AOJu0YzPeOM692i1GZBoQXGlwxibsEW4x55jmKb4Ki5anFtRTRyjChJj DjmGbj00u8mCRWwaMc9bVEx1WsneaaNsDdbZPiiD3xymBqKckiuMiAluqZu9lakbG0enZaq6RO5 DaPqUy7sfxWZIo9UphH2LyN4jmAVOQdmgJ5Mln/kPhoAzaSyx4ZhjYeWoHTsBlzElUN7rgT3PtL tUhMh1JQTyRf48g3QYplhphM9IXcC9mdThylb/ X-Received: by 2002:a19:3852:0:b0:516:d692:5e0b with SMTP id 2adb3069b0e04-52ea06e5636mr724470e87.54.1720087126476; Thu, 04 Jul 2024 02:58:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgDvPk1J+c+TOk+u7128hSIdj6H4a7q1b5JRuEIQm+hzhDJ6MbsVr+3hQ6ZdG3pLAWIk0sEA== X-Received: by 2002:a19:3852:0:b0:516:d692:5e0b with SMTP id 2adb3069b0e04-52ea06e5636mr724461e87.54.1720087126096; Thu, 04 Jul 2024 02:58:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/16] target/i386/SEV: implement mask_cpuid_features Date: Thu, 4 Jul 2024 11:58:06 +0200 Message-ID: <20240704095806.1780273-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704095806.1780273-1-pbonzini@redhat.com> References: <20240704095806.1780273-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720087173885100004 Content-Type: text/plain; charset="utf-8" Drop features that are listed as "BitMask" in the PPR and currently not supported by AMD processors. The only ones that may become useful in the future are TSC deadline timer and x2APIC, everything else is not needed for SEV-SNP guests (e.g. VIRT_SSBD) or would require processor support (e.g. TSC_ADJUST). This allows running SEV-SNP guests with "-cpu host". Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4 ++++ target/i386/sev.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 0d5624355e4..c43ac01c794 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -812,6 +812,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu= , FeatureWord w); =20 /* Support RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE */ #define CPUID_7_0_EBX_FSGSBASE (1U << 0) +/* Support TSC adjust MSR */ +#define CPUID_7_0_EBX_TSC_ADJUST (1U << 1) /* Support SGX */ #define CPUID_7_0_EBX_SGX (1U << 2) /* 1st Group of Advanced Bit Manipulation Extensions */ @@ -1002,6 +1004,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *c= pu, FeatureWord w); #define CPUID_8000_0008_EBX_STIBP_ALWAYS_ON (1U << 17) /* Speculative Store Bypass Disable */ #define CPUID_8000_0008_EBX_AMD_SSBD (1U << 24) +/* Paravirtualized Speculative Store Bypass Disable MSR */ +#define CPUID_8000_0008_EBX_VIRT_SSBD (1U << 25) /* Predictive Store Forwarding Disable */ #define CPUID_8000_0008_EBX_AMD_PSFD (1U << 28) =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index 2f3dbe289f4..2ba5f517228 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -945,6 +945,38 @@ out: return ret; } =20 +static uint32_t +sev_snp_mask_cpuid_features(X86ConfidentialGuest *cg, uint32_t feature, ui= nt32_t index, + int reg, uint32_t value) +{ + switch (feature) { + case 1: + if (reg =3D=3D R_ECX) { + return value & ~CPUID_EXT_TSC_DEADLINE_TIMER; + } + break; + case 7: + if (index =3D=3D 0 && reg =3D=3D R_EBX) { + return value & ~CPUID_7_0_EBX_TSC_ADJUST; + } + if (index =3D=3D 0 && reg =3D=3D R_EDX) { + return value & ~(CPUID_7_0_EDX_SPEC_CTRL | + CPUID_7_0_EDX_STIBP | + CPUID_7_0_EDX_FLUSH_L1D | + CPUID_7_0_EDX_ARCH_CAPABILITIES | + CPUID_7_0_EDX_CORE_CAPABILITY | + CPUID_7_0_EDX_SPEC_CTRL_SSBD); + } + break; + case 0x80000008: + if (reg =3D=3D R_EBX) { + return value & ~CPUID_8000_0008_EBX_VIRT_SSBD; + } + break; + } + return value; +} + static int sev_launch_update_data(SevCommonState *sev_common, hwaddr gpa, uint8_t *addr, size_t len) @@ -2315,6 +2347,7 @@ sev_snp_guest_class_init(ObjectClass *oc, void *data) klass->launch_finish =3D sev_snp_launch_finish; klass->launch_update_data =3D sev_snp_launch_update_data; klass->kvm_init =3D sev_snp_kvm_init; + x86_klass->mask_cpuid_features =3D sev_snp_mask_cpuid_features; x86_klass->kvm_type =3D sev_snp_kvm_type; =20 object_class_property_add(oc, "policy", "uint64", --=20 2.45.2