From nobody Mon Feb 9 18:46:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612821346; cv=none; d=zohomail.com; s=zohoarc; b=dku0b4B39At9YpflcE4PlLFHa9gvOi2MmC1tswd9+EduZUJRJiPy9l7lBl4CKApkPbYc41PCMSTaXGsA6moIvo7mcm6X3HQ81U6Ko411O+nGvGui940KaGXXm+UNX0CzCVGcmeIU+ZEMrJ0rfV6M3JSEuIEcpln0b0UwtF0wsxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612821346; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ZrhSGZHZsewA1YLv+O2cscVrZTHkKVYgMwlTBRd5Qk=; b=JiPL/52Q/s76c5BfvLSm1M8X0iRddPOao6FS9TKbCDCl93MdRNAyCaypjTuCd1lcllC49Rz/zisDo1yndn3kXfAGYLgpNYykvcRC+h6bsL6SH+FLuby4BR9KQ0eSmXmK3XbseHz4t9RCkjMldQg8f5Zn/9FpKrJMzejso7/0hwg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612821346391980.0106633318376; Mon, 8 Feb 2021 13:55:46 -0800 (PST) Received: from localhost ([::1]:49980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9EVV-000201-5A for importer@patchew.org; Mon, 08 Feb 2021 16:55:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9BCL-0002wE-2W for qemu-devel@nongnu.org; Mon, 08 Feb 2021 13:23:45 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:53012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9BCJ-00064e-Ge for qemu-devel@nongnu.org; Mon, 08 Feb 2021 13:23:44 -0500 Received: by mail-wm1-x32c.google.com with SMTP id i5so55555wmq.2 for ; Mon, 08 Feb 2021 10:23:41 -0800 (PST) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm19670wmc.25.2021.02.08.10.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 10:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2ZrhSGZHZsewA1YLv+O2cscVrZTHkKVYgMwlTBRd5Qk=; b=NoY5jSyR8XDupV+I6XhCuhN6z2Np0YxzPlq0drZwb1Npfz79I3DJ6b1wRrxden5jvT qh/58maVFCpSiNHRBX/oNloXsWj1agGjcIXgdNL+F4Nlihi/RBQjxXpX0vJXRyRP/XYv 05R5gdJ3v6934AlW3X2PbVVmrYGmfvaBcv44Wqrr5HXooxAGZRf8SVZjFaj4JoqXSMVI RLfpUlpMTEqMseU1B0vVfdGW2SZ79wmCRjhqMoWphJzOLulVRBtACe6KEui4Q9JdXx2t neGZQC3go5rhnQwsYT9N42klxvYEseZCG5+bcw4tey/6P+26gr2ZEj3z92E7UOqLiL9d CJTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2ZrhSGZHZsewA1YLv+O2cscVrZTHkKVYgMwlTBRd5Qk=; b=P+HCdwHrEHe/LW05PjuhMF7eJsZqbWWNPoxK2rQn12It8sg4DMA071qVfsrWfFwk3f uNVSmb3m1VfMaRpKLH1calDfOFoodsKyb8K13TqO8IrKyQnx0du9bkZ88VkHyCwW9iA4 cxJzP15YyGKT+puTPcLmvgJdyXlxWoiRodWxnH6Ri4iNqS9rTlv0fRQCNGKyIOeCsxx3 +8AvcfSckWmEePTaM7wpce+H0qPXwqGFKy9wH5VVf9OWB6YLQAuy2DJ/IF0HxTJmx3Fu WOTyMs9FoL5VCs4X+CWhmPnoUQ0ts8+pK9ixbSQgUFiaPogEAW5IRsimdTkhrbpmBDRV jmjQ== X-Gm-Message-State: AOAM532K4TkGk3VAopbsZrl2/6sHG2c34Fywz8SSbymQ3uzeQ9u9z9G1 KV709qPc7P/k89hgKyfTbaEMgAgwynF+jQ== X-Google-Smtp-Source: ABdhPJx5RivjIg1G0F+pIKDtkiwQwAzveGTQi/OdYr0u9z/MFybWqcpVcBcRTs6+P1LyWEVVxxciTQ== X-Received: by 2002:a1c:b386:: with SMTP id c128mr95451wmf.48.1612808621138; Mon, 08 Feb 2021 10:23:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/46] target/i386: do not set LM for 32-bit emulation "-cpu host/max" Date: Mon, 8 Feb 2021 19:22:53 +0100 Message-Id: <20210208182331.58897-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210208182331.58897-1-pbonzini@redhat.com> References: <20210208182331.58897-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=2a00:1450:4864:20::32c; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nathan Chancellor Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 32-bit targets by definition do not support long mode; therefore, the bit must be masked in the features supported by the accelerator. As a side effect, this avoids setting up the 0x80000008 CPUID leaf for qemu-system-i386 -cpu host which since commit 5a140b255d ("x86/cpu: Use max host physical address if -cpu max option is applied") would have printed this error: qemu-system-i386: phys-bits should be between 32 and 36 (but is 48) Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ae89024d36..e775e9abb5 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5073,6 +5073,11 @@ static uint64_t x86_cpu_get_supported_feature_word(F= eatureWord w, } else { return ~0; } +#ifndef TARGET_X86_64 + if (w =3D=3D FEAT_8000_0001_EDX) { + r &=3D ~CPUID_EXT2_LM; + } +#endif if (migratable_only) { r &=3D x86_cpu_get_migratable_flags(w); } --=20 2.29.2