From nobody Wed Nov 27 20:29:54 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=1697647283; cv=none; d=zohomail.com; s=zohoarc; b=h/Z+EJE9FgDqXXLyhmgZbIoIdFylnSEkoTxt+YuutWVOlTdqfPz02qxIaQ6h5zSx5DOOqvqem+gl6gOnu0A6Tsl4/D4kSwcXMsmE8BKMzxPfSMmL+OU0lIEuaSRozytGvYAnrdEMs9D7+8Efal+TD+736Cs/+nFkAeKD81YnpKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697647283; 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=l81+EyOeU3LSHiNMN6aj26DOrdFpEtWh0cb0/Y84qOo=; b=mjBN2ZLuRcEaT6s/unxesjTDdTgQ05WylRWI5SKgsBjBEdv8VjGrNe9K1tRLcNmyOwI917UXx7mTIRLLs0Bnwlmf/XUPaZdBzwFFW+ToD+UGZeHIFwuh3SaNq16CE6+O/Dj+AWIsJJ/I/Mm1JduTLr6LockpbOI7kzh/BODT3Nk= 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 1697647283697918.3126431333599; Wed, 18 Oct 2023 09:41:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt9Yl-0001O9-Iu; Wed, 18 Oct 2023 12:38:17 -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 1qt9Yc-0001Co-Hb for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:38:07 -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 1qt9Ya-0007Px-QP for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:38:06 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-97-iiVz7xmWM9y3WP4Rjng0Gw-1; Wed, 18 Oct 2023 12:38:02 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9a9e12a3093so778494366b.0 for ; Wed, 18 Oct 2023 09:38:02 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id g2-20020a50d5c2000000b0053ebe6c1396sm3131611edj.27.2023.10.18.09.37.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697647083; 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=l81+EyOeU3LSHiNMN6aj26DOrdFpEtWh0cb0/Y84qOo=; b=N0w9l9Ftwt6G8ZHQV7t8EWkXvGTyadHuKy1olAaxt0qKgDkyWD6C/fmZesKO5Uypg7w6HG DDMM5mlwm5+APHKKkIaSXpr61sA9w0U55ViAaCKQhrZ8naAbvvzsf8oAU0FPv9buCaHoxJ fn0o8SaFbKnrAHwDIwyhR3+lZpImdPc= X-MC-Unique: iiVz7xmWM9y3WP4Rjng0Gw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697647081; x=1698251881; 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=l81+EyOeU3LSHiNMN6aj26DOrdFpEtWh0cb0/Y84qOo=; b=TOxyvDnhRngyPtaj4WwOfe1nQhceW5ETai/1RX7hgoSJYn9kyC9pjyjfuUYhKHMhBz RhG0QofxXdra2L3R+i6AXkwXrJrMB6exbfLASRFiU9aAeAAIxDggQgAZI9crH+u1WXEH NYoIMCrSwVVw8neLVqu+rw6Ubdixepx1DczMC12wibxR0z4cF3ShCPyzRxTBOrW4NFe7 yaSt6a8nqrwWqolFgEb6XsYM/XcZ0HP9N5gqqiHsvdDqNreGlRwQdpeCTFkSowVjaJZ7 ssQr3aH+9SLj+PCh/FePeRIattineBucAJtYa0o3G/LIFeUTbRqn7esZTJ9uAmPeCGQo KKRw== X-Gm-Message-State: AOJu0YwuEOMcTYRqxw+UBfnxusPm3cNE6w5Lyw74bGFU5ub5uP1gwEri bzqloPFHOXNH+4L1b/9sRfqJmpQxurmZbrpy8rMro56SJQ8ya4YWldllFH3hnyt0isDgE06snq/ s+sQ+90PoiY5clefFuZBrcNxRSsclnft5M0vbAh9+C3kXVP3Sg+Bw9DstKLUZWjaXGXZQ8JDMVG c= X-Received: by 2002:a17:907:7203:b0:9aa:1794:945b with SMTP id dr3-20020a170907720300b009aa1794945bmr4961575ejc.22.1697647080857; Wed, 18 Oct 2023 09:38:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA0V9+RH6GJAcpy5133H6UidEEqPjulDoN4+vNartrnn20sf11H+qt3FbEEDJMNHb8l3SUTg== X-Received: by 2002:a17:907:7203:b0:9aa:1794:945b with SMTP id dr3-20020a170907720300b009aa1794945bmr4961555ejc.22.1697647080474; Wed, 18 Oct 2023 09:38:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 16/17] kvm: i386: require KVM_CAP_SET_IDENTITY_MAP_ADDR Date: Wed, 18 Oct 2023 18:37:27 +0200 Message-ID: <20231018163728.363879-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018163728.363879-1-pbonzini@redhat.com> References: <20231018163728.363879-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: 1697647285189100011 Content-Type: text/plain; charset="utf-8" This was introduced in KVM in Linux 2.6.32, we can require it unconditional= ly. Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index df131fcc8b1..a3d52cb538f 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -99,6 +99,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = =3D { KVM_CAP_INFO(X86_ROBUST_SINGLESTEP), KVM_CAP_INFO(MCE), KVM_CAP_INFO(ADJUST_CLOCK), + KVM_CAP_INFO(SET_IDENTITY_MAP_ADDR), KVM_CAP_LAST_INFO }; =20 @@ -2600,20 +2601,13 @@ int kvm_arch_init(MachineState *ms, KVMState *s) * In order to use vm86 mode, an EPT identity map and a TSS are neede= d. * Since these must be part of guest physical memory, we need to alloc= ate * them, both by setting their start addresses in the kernel and by - * creating a corresponding e820 entry. We need 4 pages before the BIO= S. - * - * Older KVM versions may not support setting the identity map base. In - * that case we need to stick with the default, i.e. a 256K maximum BI= OS - * size. + * creating a corresponding e820 entry. We need 4 pages before the BIO= S, + * so this value allows up to 16M BIOSes. */ - if (kvm_check_extension(s, KVM_CAP_SET_IDENTITY_MAP_ADDR)) { - /* Allows up to 16M BIOSes. */ - identity_base =3D 0xfeffc000; - - ret =3D kvm_vm_ioctl(s, KVM_SET_IDENTITY_MAP_ADDR, &identity_base); - if (ret < 0) { - return ret; - } + identity_base =3D 0xfeffc000; + ret =3D kvm_vm_ioctl(s, KVM_SET_IDENTITY_MAP_ADDR, &identity_base); + if (ret < 0) { + return ret; } =20 /* Set TSS base one page after EPT identity map. */ --=20 2.41.0