From nobody Sun Nov 24 05:40: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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1726240850; cv=none; d=zohomail.com; s=zohoarc; b=Hp/RDxAJyDdO+u88UJFchqDI3UieCxTd+xYe43x+7hrVavV/bxAO+X/MMyWAkiqdEBMEURTgtR/s46Y0PVV4EFQZOctu1XTF5OuEh6U4p8fGO5db+Tkoh41dTz2ao0O83ZhZVF7r5zYc8mE5+HzTB/E+UeQjKBKwn6tQ32etMFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726240850; h=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=wrqlu0MBnX/IwubC7JB6PnaVoLkJuNGIJqIpkcG99Z0=; b=DirneDF+FEV1oiM4RPKiWJfctaQSxXTfRKg7CoDsZxo3qfPGn/nbUARJzmjvTBWUG1sO+CvKQQ6bdAezItAyrcyebGvBr4gtoDbyrcct5iZVdrwHcA/MBrP6c5SuyewFoBUVWU4aC3YE45jZ6MxxO+fEunf90PUBs3iN5DxwhSY= 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 1726240850602835.4567931659601; Fri, 13 Sep 2024 08:20:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sp81A-000640-0k; Fri, 13 Sep 2024 11:15:28 -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 1sp809-00025c-1S for qemu-devel@nongnu.org; Fri, 13 Sep 2024 11:14:25 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sp806-0007n7-SS for qemu-devel@nongnu.org; Fri, 13 Sep 2024 11:14:24 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42cae102702so9679715e9.0 for ; Fri, 13 Sep 2024 08:14:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42d9b16bfbfsm29152325e9.22.2024.09.13.08.14.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 08:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726240460; x=1726845260; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wrqlu0MBnX/IwubC7JB6PnaVoLkJuNGIJqIpkcG99Z0=; b=bCjPegGDQRwUKtiLErAZs/JZfUgrz5u1wRzQKqyW2atmPICu4uX6Jb8zkC20RIPy7P uFG5rxjEGryHyXI5tuYhbiyN2Odm7kA34jEQy1OVSDTEoieKMTHJG1OHErTXCCiRUI39 aBoWZwntOFx4lnmJ9NdaAUplHnHTVOrV/Mb5qSAvM66YdUVV/aBgJUMB5vbXo1dVH9ox sDJP2LmOT8a79pGY2N4/d7KchC1IykFt0vKXCJ7xpGdoc7LhJ9ZQlYNWpfOlqzooO0kB KgUtfRSz2dNNjQ1CmUcIq/ShvC+HYc2fOM+Z1Q3nZyai4NyZZYJOCbkaJ+rMdMvgpL6l w4+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726240460; x=1726845260; 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=wrqlu0MBnX/IwubC7JB6PnaVoLkJuNGIJqIpkcG99Z0=; b=Wcl3+IHJOYOPT1oUuhw/Yx6MCCCdtvTV2+oCNBAbfLhFTwtc1VvcUEPD1/217IVe1z EZ7BYSt6szGGSdm3r+f7lb1ywelTSmMglqdCQhFYSUY3+OEW6I/45GU6jzMNTLlhDunB BkutgXEpvnRD5+A1ujZexwEWYo+bRwlVEnCpuQe2+/i119/1qWkfZJssPV9qrkDryEyw r1b3d9P7wD/QP0fnbVY1VRHXH09ahd3e6ryRGJeJe64A9wUidb4JxA5DMLtPXiILMlC8 CJdq/nejLUvda5KCGLUwg28l6crY9TWQktRkUZd6K+QQnxvSX3bq6dvxinYaKFGIFQw6 dcAg== X-Gm-Message-State: AOJu0Yxo6k0KoU45ViUAnfZjb2uQn+O/N4L+OQSfnj57rc2gAon6/Zb/ QKE7AfaLRgqGjLGkgoeqq9sjc5dHiVWW+MY4qbW660FmHTvefha/AHVobjeuDYzpg1gylhJN/VS a X-Google-Smtp-Source: AGHT+IHHQ2HVSDmGVdLXr6iijTfHYsoCILBoUQ5/Q0copxpqmB2BcOl0c6rOs/J90Fa97qFokLL+UQ== X-Received: by 2002:a05:600c:4746:b0:426:6158:962d with SMTP id 5b1f17b1804b1-42d964d8612mr25076665e9.23.1726240460250; Fri, 13 Sep 2024 08:14:20 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/27] hvf: Split up hv_vm_create logic per arch Date: Fri, 13 Sep 2024 16:13:58 +0100 Message-Id: <20240913151411.2167922-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240913151411.2167922-1-peter.maydell@linaro.org> References: <20240913151411.2167922-1-peter.maydell@linaro.org> 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=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.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, 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 @linaro.org) X-ZM-MESSAGEID: 1726240851492116600 Content-Type: text/plain; charset="utf-8" From: Danny Canter This is preliminary work to split up hv_vm_create logic per platform so we can support creating VMs with > 64GB of RAM on Apple Silicon machines. This is done via ARM HVF's hv_vm_config_create() (and other APIs that modify this config that will be coming in future patches). This should have no behavioral difference at all as hv_vm_config_create() just assigns the same default values as if you just passed NULL to the function. Signed-off-by: Danny Canter Message-id: 20240828111552.93482-3-danny_canter@apple.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/sysemu/hvf_int.h | 1 + accel/hvf/hvf-accel-ops.c | 6 +----- target/arm/hvf/hvf.c | 9 +++++++++ target/i386/hvf/hvf.c | 5 +++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h index 5b28d17ba1f..42ae18433f0 100644 --- a/include/sysemu/hvf_int.h +++ b/include/sysemu/hvf_int.h @@ -65,6 +65,7 @@ void assert_hvf_ok_impl(hv_return_t ret, const char *file= , unsigned int line, #define assert_hvf_ok(EX) assert_hvf_ok_impl((EX), __FILE__, __LINE__, #EX) const char *hvf_return_string(hv_return_t ret); int hvf_arch_init(void); +hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range); int hvf_arch_init_vcpu(CPUState *cpu); void hvf_arch_vcpu_destroy(CPUState *cpu); int hvf_vcpu_exec(CPUState *); diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index ac08cfb9f32..dbebf209f48 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -61,10 +61,6 @@ =20 HVFState *hvf_state; =20 -#ifdef __aarch64__ -#define HV_VM_DEFAULT NULL -#endif - /* Memory slots */ =20 hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size) @@ -324,7 +320,7 @@ static int hvf_accel_init(MachineState *ms) hv_return_t ret; HVFState *s; =20 - ret =3D hv_vm_create(HV_VM_DEFAULT); + ret =3D hvf_arch_vm_create(ms, 0); assert_hvf_ok(ret); =20 s =3D g_new0(HVFState, 1); diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index ace83671b59..19964d241ed 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -929,6 +929,15 @@ void hvf_arch_vcpu_destroy(CPUState *cpu) { } =20 +hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range) +{ + hv_vm_config_t config =3D hv_vm_config_create(); + hv_return_t ret =3D hv_vm_create(config); + os_release(config); + + return ret; +} + int hvf_arch_init_vcpu(CPUState *cpu) { ARMCPU *arm_cpu =3D ARM_CPU(cpu); diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index c9c64e29781..68dc5d9cf75 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -223,6 +223,11 @@ int hvf_arch_init(void) return 0; } =20 +hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range) +{ + return hv_vm_create(HV_VM_DEFAULT); +} + int hvf_arch_init_vcpu(CPUState *cpu) { X86CPU *x86cpu =3D X86_CPU(cpu); --=20 2.34.1