From patchwork Thu Feb 15 14:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13558482 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B59A131E30 for ; Thu, 15 Feb 2024 14:20:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006847; cv=none; b=hHvcbIuyM4K0KB+R/TYPIAttvwAGVtUlY9TZ+WTzK04U5usMttAPvyjIs0M986q8+Ube43z5DfbZLPk796x3kFW1yrGiUoSIj/goo5lCLtwE/Ho4oQudg6WWjkI/+qwyCNYifKymWkOhj8wPZd2MegttNu7J7WCHXvZqunxe+dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006847; c=relaxed/simple; bh=xHRMWJ8U4kbvMXSdNn6Zps6Lxpkqp7ZuqexgMReFnIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YqQp80bn63wP/9Z1GTIRb5n7NOfpXb8OC1wgqmmbIiHY5i3CEU28HoebC4v9Mr4cGOFiYES8zkCdgn0SlF8JCHt2bw5KOOuIK8aDxDSo53KMDZayGKjZ3Owkpxc513xD/JwihQDjzZdS95+RH/55iomVRZATgj/ghKEnCXinGMI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=by3WlXYQ; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="by3WlXYQ" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4122a8566e4so2380335e9.2 for ; Thu, 15 Feb 2024 06:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708006843; x=1708611643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3nHBcC1vTxuWuhw1KTr8iuMLr3JCNHYJX8skgFi1VDE=; b=by3WlXYQuWqrO3poTGUh9Yiyf+2d8Cx01UNl/897ZHyywPGOP/wBzhuN0p/nvByHEj iYM6wYv81KpcebEEhQchB4jwY4gQ81HYBoN/FTORWzTagjGL6KNaAVhTCfSot8UYdjO/ Uo7HlrZfwoCKM0uaR4RrtgpYGt37+pttbwZ3n78MyRbaptbpSIGJTWaY4zW8g3VpzJuJ EiD9kiOvXAPaIoboQ7XE9GFhVGIsIwc4yLqkOWKBm9iIGAYpA9NW8mw3Ua+rgX/p1MIx kNnQ9Uti/kH+YbAA7MVXQay+Tr4ERVN57ol4eRwrkvJkhEQb13uGfVR3vy5Wny02Jgmz hMQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006843; x=1708611643; 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=3nHBcC1vTxuWuhw1KTr8iuMLr3JCNHYJX8skgFi1VDE=; b=q/FhuilWcyQPGRHQpnVMytmPiY4HcFvastdTD64jktHXtEMaCGmkILGUd51WYt5sPA vhNSmYNRuoFaYny9Lt8yOGFlXjS1a5Db69UnPlNvNiKqtpYqhuRIZKP6Wfg38QrZ8v00 /wPuz2HLLkg4C+OT6XUTph6QsydlJuKWAx9OJ+PtqHc8zx7YKovZ/MK7YAMrO+3nfW1s knO+GNPrgJ4KRDRbZedH3GybyGNM8ZATxv1asMuhqSpAOjmVR293RCj+p50BwWF8O49+ 6Zf8riPCwdXLqbsZIxTYzXOGAwNPe+xFcAez/+HV2KTkTRqVeVBeRTQa57tuD2AVFdu7 Izwg== X-Forwarded-Encrypted: i=1; AJvYcCWjbl1iZyK2tHExjkRmpi+Ed0Z+vfpbRNu8ZF1qOAPo3skKYZ2ZZONAVC3U+/jCqqXgBVm+/nVSoDsNYidW44i7EAWH X-Gm-Message-State: AOJu0Yyn+NYXeieg7O6J14/86czaAAs/aKux6hj6Df0seUsIQbeHRP7I o35XJmAV/ILbkP+jGHSjKw9eJf3B7h2dgQfQeFimY9noGZqOE/nIauLd/1DjOxaYQDCg29mhsfx IKBs= X-Google-Smtp-Source: AGHT+IGYTlTqE8oJnVvdqEH05RJIW0vLAV8SwKPHsQTNe656NKaFZ1cePEGe5vdZtMaDKsmuuMyucg== X-Received: by 2002:a05:600c:3caa:b0:411:d7de:ea8e with SMTP id bg42-20020a05600c3caa00b00411d7deea8emr1310715wmb.23.1708006843679; Thu, 15 Feb 2024 06:20:43 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id z7-20020a05600c0a0700b00411c3c2fc55sm2159883wmp.45.2024.02.15.06.20.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 06:20:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson , Paolo Bonzini , kvm@vger.kernel.org, Marcelo Tosatti , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH v2 1/3] MAINTAINERS: Cover hw/i386/kvm/ in 'X86 KVM CPUs' section Date: Thu, 15 Feb 2024 15:20:33 +0100 Message-ID: <20240215142035.73331-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215142035.73331-1-philmd@linaro.org> References: <20240215142035.73331-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index a24c2b51b6..b526a08015 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -490,6 +490,7 @@ L: kvm@vger.kernel.org S: Supported F: docs/system/i386/amd-memory-encryption.rst F: docs/system/i386/sgx.rst +F: hw/i386/kvm/ F: target/i386/kvm/ F: target/i386/sev* F: scripts/kvm/vmxcap From patchwork Thu Feb 15 14:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13558483 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 812A8131E30 for ; Thu, 15 Feb 2024 14:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006853; cv=none; b=nuyXT2pQrDZa8IntmJr33s+1Z3DalLgo00+ZudTZaoRiBZ/qGe65wUxzEGdAOjCcrUTI1RUnjv1qUfP/ixpatfeWFRZlN2scUwApsncaHQ1k0FFiJrncdOT6I/e1MgynLmGpfd+1HSu16c6g+DhhZuxCePho5e0LH09OFjW6uvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006853; c=relaxed/simple; bh=WyB1JhRirQvALYuIAg0sQ/WdGGgWts4aWXr39mwQhDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EP7KYRc3Wk3kJIYAaUl/19jAnDfHDuHtOEYxxxG50v+VdmiKvb3mxocn8V7dqgE4/+OTMboZgWjgvnd+t3KZ9uRFJYRPwEhHKMm1hEjupWGkrqgrkYm/BwZK2J/lpvryWfG90alJRmX4IbQjbfpdXKj5FTa8Z397TryMCqnxpi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uCrB+Ouy; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uCrB+Ouy" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d0a4e8444dso9701801fa.2 for ; Thu, 15 Feb 2024 06:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708006849; x=1708611649; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZLvepa7gcmUSWKB1EKhqFyqI1EusKlbmBcij87F8F7E=; b=uCrB+OuyHUYzuOp8oJcVpncTV9DytoCUeMzUfJG99r6vFtLPTBWqaTbYBYzvy76lrY RLltpuSgp3gac2ncfEvuM8pWpe9WnekNIZvYkOBUfyNBFcftgnigW4x1eHTSgStE4E63 1Pv0oFZ4qpvpgxiFDmtcqiszZ0jqb49uuctDnhpLftz0Hm9hxj41W7IKGE5GAaQ/DZ4R z4YLv8G+7/rA8SDS5NaNBiLAIFK2dnXrAr3PwVMQNTsiCrBeN9+N8RcYDDx9rCisGrz4 6Ez6i/EtVILEyITpeQukeFdyNWy5BjtOupgaRqaOtOWLomAtTuC8t3L3vyeETcJEMzF1 sEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006849; x=1708611649; 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=ZLvepa7gcmUSWKB1EKhqFyqI1EusKlbmBcij87F8F7E=; b=PnetNear3ZIFG6yIzWJi6WSEuGt2EdnL1u6RshAYTZ0Ezo4NQc6kinhcKqIeVEb/ZN J3j29b/0pmrdRy5ZdoCeyznJWlB1qCdCwe/KBYGddOC6CsH+hzRcz90aI6si7OX5mf9Q +40MYWdg4cjE7YxOR3l5BPq3asznTpMEamkB394ZV1JFaix5M4+SUQWk3tj79LhBNr4E cJxBFLz7BWPoYK2BiWr6nxj4IGVSl7AMBG8mE8YnZ15bBG+jC6qYsTjC0OO79vSmNOXe WhR939DD+kY4xW3b89aIxtxXBEcW63uIB+HC21k3PPQFDlE3vd6usAYo1MXG7FwF96YS uDug== X-Forwarded-Encrypted: i=1; AJvYcCWERBvfvzKFSoID///Hhh3pLzpSQqY/AVia3BIAlXVx39i9mvCrSQMJbHcBGdcWuj0oLEitjuICYoAl1RcJESaHpse+ X-Gm-Message-State: AOJu0YxrBpLwfFEHVDrbxF5gKep9TADCYodxFVQfh0nIm7ke1m6NbqFY K95bhpjXwTP192Chrjoe4/6due1nUGjdEWgxZFqPbOsg4MirzKx9hz6k9/HrhXtjQ2wNZIZNFeJ zBCU= X-Google-Smtp-Source: AGHT+IHYEUm7AulymZdpVTj48jkAUwAJORdqCYy7sFA89JTpfclzWJG6O7qdsxMhmWM6peItH9Yd8A== X-Received: by 2002:a2e:a548:0:b0:2d0:c996:7c99 with SMTP id e8-20020a2ea548000000b002d0c9967c99mr1604340ljn.51.1708006849401; Thu, 15 Feb 2024 06:20:49 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id m40-20020a05600c3b2800b00411c9c0ede4sm2228137wms.7.2024.02.15.06.20.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 06:20:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson , Paolo Bonzini , kvm@vger.kernel.org, Marcelo Tosatti , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PATCH v2 2/3] hw/i386: Move SGX files within the kvm/ directory Date: Thu, 15 Feb 2024 15:20:34 +0100 Message-ID: <20240215142035.73331-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215142035.73331-1-philmd@linaro.org> References: <20240215142035.73331-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Per hw/i386/Kconfig: config SGX bool depends on KVM So move SGX related files under kvm/ for clarity. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/{ => kvm}/sgx-epc.c | 0 hw/i386/{ => kvm}/sgx-stub.c | 0 hw/i386/{ => kvm}/sgx.c | 0 hw/i386/kvm/meson.build | 3 +++ hw/i386/meson.build | 2 -- 5 files changed, 3 insertions(+), 2 deletions(-) rename hw/i386/{ => kvm}/sgx-epc.c (100%) rename hw/i386/{ => kvm}/sgx-stub.c (100%) rename hw/i386/{ => kvm}/sgx.c (100%) diff --git a/hw/i386/sgx-epc.c b/hw/i386/kvm/sgx-epc.c similarity index 100% rename from hw/i386/sgx-epc.c rename to hw/i386/kvm/sgx-epc.c diff --git a/hw/i386/sgx-stub.c b/hw/i386/kvm/sgx-stub.c similarity index 100% rename from hw/i386/sgx-stub.c rename to hw/i386/kvm/sgx-stub.c diff --git a/hw/i386/sgx.c b/hw/i386/kvm/sgx.c similarity index 100% rename from hw/i386/sgx.c rename to hw/i386/kvm/sgx.c diff --git a/hw/i386/kvm/meson.build b/hw/i386/kvm/meson.build index a4a2e23c06..c9c7adea77 100644 --- a/hw/i386/kvm/meson.build +++ b/hw/i386/kvm/meson.build @@ -13,6 +13,9 @@ i386_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files( 'xenstore_impl.c', )) +i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'), + if_false: files('sgx-stub.c')) + i386_ss.add_all(when: 'CONFIG_KVM', if_true: i386_kvm_ss) xen_stubs_ss = ss.source_set() diff --git a/hw/i386/meson.build b/hw/i386/meson.build index b9c1ca39cb..d7318b83e4 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -17,8 +17,6 @@ i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c')) i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmouse.c')) i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c')) i386_ss.add(when: 'CONFIG_VTD', if_true: files('intel_iommu.c')) -i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'), - if_false: files('sgx-stub.c')) i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c')) i386_ss.add(when: 'CONFIG_PC', if_true: files( From patchwork Thu Feb 15 14:20:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13558484 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8612131E53 for ; Thu, 15 Feb 2024 14:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006858; cv=none; b=qF+Gjhpuv/YJBYU/ZTP7oK9/2dPxLMkuGEeitAspJ8NlfwakqAZk01FN6Fvoeo272BT/tLBeSg0j+lc2EgBdy9RtHJvRQl70IlCz368dTDPJU+FKp1KYOGLJE6Nw9lUgCPaDb7bFaTgXKuArY25sZcx0aGyO3qA7CWintdUPX+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006858; c=relaxed/simple; bh=8N2KbE37hzzYop+XNgXAu0dXKbVPb7QPPap+rSBDaRA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J1fJYpRgVVWYLqDGpHULo2GFq++xUCRm/WXO4JLm3dhD5F3islbd1shAZLk+Mzft/cJURjuNqpEg7zDgXGbx2hN3myd3rqdwKv+d1oGyVV1gQyT3EsOp//4LCPAQVml3Xlbyk9GzQ8vOhswfMm9T8M9Ks77NQQuUaU7yElFA9GY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IPO2XVG/; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IPO2XVG/" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-410e820a4feso11477555e9.1 for ; Thu, 15 Feb 2024 06:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708006855; x=1708611655; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V9a2tbqcFhv7866Po+eazVne7c9fJyb++6ZKJPt9MeE=; b=IPO2XVG/egnudZE4iG99xRo4Bze5lw4+sSlUIxo8qvq97VpdCWfuevsKd0LcAs8qGA e9I0eC9VMTjEu2g49RspcUWZQ3m2MM2dRJOhaXZg8dPKDCE8NeSVSuJVOpUcjb81jgei N9XmtDf5Jn0luj/L7ynYo6NkzIXlImtfOM31r9Qm/5gku9g3Ja055Y1er4NvhHosxrca O9Uxq6owL4BJVfnnxO9Esq7ZxYFF6nDvRlexxpzCThIOzGyDX9VTYp6yMitylx7994rb YObm5bIawteP3/Vg+GaES5Iv/xyFzDfL7VpAkcJYjP7yQeMPVvUyel0ehORWmLAMfKx+ BtMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006855; x=1708611655; 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=V9a2tbqcFhv7866Po+eazVne7c9fJyb++6ZKJPt9MeE=; b=TEKV2+AEtWPD+m+rSPxpzeioY8wvoThoXermSjZZZS/820PGnkDbVhnDOAM8Swfcm0 qEl5wVQXJMHSPrrtUW25R0iKPZdJxNag19zWf0UfVTWZ0GrQJg8PVqwrZNsT5vwWMdhD kXHqak8LvSwLbeAPPO+g00K0SAiUrUXPlN6OA1AV8OfV8xh5+9SQABhN/oR55E7W5op5 jyNkduR4VXKfwloJt5/1bhjm3ZvALaqiRIl5/Fh+tN88RIo071xwN9pCECvNtoejTAcn WdzbWT35FE/wz59CRTFG1Q8nGrMRZqrMKkAr8WhjVt7hLO4x34iII8B/XP9rS+yb77Yz 92Sw== X-Forwarded-Encrypted: i=1; AJvYcCXqGgfR2so7JPS5XYmjsduw1yobyjbuVAulS7XQOi1HEYcSaBgINAYj6stMsQLHksUHNhZAYJlGY7JFy1GAiWAF9LrQ X-Gm-Message-State: AOJu0YwVUCssD+O3U5BL/AjNREX3KWUJygyaDW0taOvrGOm+LgwmT4FN Jwqnc3SGAG/M7Wq2vB7adl6V5vyaOFi5wydeolYwAxU4AzHrvY4ZExxL7XzvzpY= X-Google-Smtp-Source: AGHT+IHZtXtX6MfTefPcXDCoXO9cBpuaZm8C6bzeO6EAUHK2OKEi7VgqOojokGFFWz2RMHHac1bnig== X-Received: by 2002:a05:600c:1c0a:b0:411:dd82:a23c with SMTP id j10-20020a05600c1c0a00b00411dd82a23cmr1813787wms.0.1708006855024; Thu, 15 Feb 2024 06:20:55 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id bi20-20020a05600c3d9400b004103e15441dsm2147381wmb.6.2024.02.15.06.20.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 06:20:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson , Paolo Bonzini , kvm@vger.kernel.org, Marcelo Tosatti , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Michael Tokarev Subject: [PATCH v2 3/3] hw/i386/sgx: Use QDev API Date: Thu, 15 Feb 2024 15:20:35 +0100 Message-ID: <20240215142035.73331-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215142035.73331-1-philmd@linaro.org> References: <20240215142035.73331-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Prefer the QDev API over the low level QOM one. No logical change intended. Reviewed-by: Michael Tokarev Signed-off-by: Philippe Mathieu-Daudé --- Only build-tested. --- hw/i386/kvm/sgx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/i386/kvm/sgx.c b/hw/i386/kvm/sgx.c index 70305547d4..de76397bcf 100644 --- a/hw/i386/kvm/sgx.c +++ b/hw/i386/kvm/sgx.c @@ -286,7 +286,6 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) SGXEPCState *sgx_epc = &pcms->sgx_epc; X86MachineState *x86ms = X86_MACHINE(pcms); SgxEPCList *list = NULL; - Object *obj; memset(sgx_epc, 0, sizeof(SGXEPCState)); if (!x86ms->sgx_epc_list) { @@ -300,16 +299,15 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) &sgx_epc->mr); for (list = x86ms->sgx_epc_list; list; list = list->next) { - obj = object_new("sgx-epc"); + DeviceState *dev = qdev_new(TYPE_SGX_EPC); /* set the memdev link with memory backend */ - object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memdev, - &error_fatal); + object_property_parse(OBJECT(dev), SGX_EPC_MEMDEV_PROP, + list->value->memdev, &error_fatal); /* set the numa node property for sgx epc object */ - object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value->node, - &error_fatal); - object_property_set_bool(obj, "realized", true, &error_fatal); - object_unref(obj); + object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP, + list->value->node, &error_fatal); + qdev_realize_and_unref(dev, NULL, &error_fatal); } if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) {