From patchwork Fri Jun 3 21:38:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578490 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp1917233max; Fri, 3 Jun 2022 14:39:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWJoSmHVGCpuroGaYF9UvVftqQynjOjyCz0SITvrZa19YQLUCN/gUHvsIvlB3yMXquzX+8 X-Received: by 2002:a05:620a:4511:b0:6a0:5e0b:1374 with SMTP id t17-20020a05620a451100b006a05e0b1374mr7992661qkp.713.1654292345504; Fri, 03 Jun 2022 14:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654292345; cv=none; d=google.com; s=arc-20160816; b=hc/Tpq9lJ/Kro/+T2D3Knl3m8JFNPNCcoRmaHKNubFAFLfjbZm4prx+6DhvYwob/mG OdClu+PCRirvLIkbnP3/xh3+Ds3//gGiNaYyoABjia3aMMn8WiF7i6tlRKsS4EWAUa1R XO7pVGE66j9Qnl9cEABW9XdeuJsodRvJto1Te3vF3Y+VGpD3isgK7FuGu5nztUVNMXHl 9Q6gO7GPBYvngA5HhAsm9n9bs09vAGBj68IVpz6oPOGqA03uNyvJoxuewk2DUId7CXLj /bN2XHRXi+vuNqeuB30p/IMGbAT6cQme3XnTyCeoJh4rgbPSkmj3ensRPYdR17c3ko1L 1FjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=7J8p3wwa03XaanC4oCwrLuqiuI+yQhLiT9J1VYtX2Tw=; b=NrqEEsLcsfO8+b88QIbS7IJW3Ot70dTXG5eSvQqv2aP/10pjrQC4tsTO9qshSjDXxH UDtSkU55rDXWsNgkO8fINbhoKa580AaAtw2y7czwc5Ts++yxML1GCqJh4zaXS6bjtMpj e4jRbwdjI57l92ztdSh+sCD8hwkGrnz0Gnjy4Ke750Xpiqoq98r+dxfFHPWhj3Yt8B0Q rybYsCFsrI23ihIFCD9oSIg2gPchj6yUL3XP67FBe4trSHJQ5AP1EJfl9HTdoHEVf4ay PDJOI5Z1MCii71S0NjWrOKQ7lXu6LBG3I6sxhyVm/6CPA0BH73sCU2VGc0bjK1sYCXdr MB4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rGZr8vBZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i12-20020ad45c6c000000b0045aa50f4f93si4154740qvh.436.2022.06.03.14.39.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jun 2022 14:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rGZr8vBZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxF0b-0000Pw-30 for patch@linaro.org; Fri, 03 Jun 2022 17:39:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxEzq-0000Of-8Z for qemu-devel@nongnu.org; Fri, 03 Jun 2022 17:38:19 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:42796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxEzm-00031X-L0 for qemu-devel@nongnu.org; Fri, 03 Jun 2022 17:38:17 -0400 Received: by mail-pl1-x631.google.com with SMTP id d22so7662945plr.9 for ; Fri, 03 Jun 2022 14:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7J8p3wwa03XaanC4oCwrLuqiuI+yQhLiT9J1VYtX2Tw=; b=rGZr8vBZjg5gJsbsLKqKtuEASSk4nAGyQhKie/h4vkoBO+LsghLxqP/9rYUoT9AN1p ggNNqfBZM8labDSO+HB4CcJ5NeTiFWePpMMBrNOlx2KLSIvNg2iBq4zsoO5WHwRIXxSd Cah30ukV0c8XxoYgyVUSd7ctR0xeakwUUuuN+jm8mDBNNqOh35/vY+gayqucnM89rDD/ S9ELdsotpteLSvGVeg51z5miopNPpjJj7RYtzxHTKZif/vkFxZ7cApLxBDmALG9RLfy/ SlOpx/YnQfhb+hdgB9ZGlW6NucMRqtt7ZB7VTSmked+hoeOawfTjwa3o3z1on1l8nUjp tKOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7J8p3wwa03XaanC4oCwrLuqiuI+yQhLiT9J1VYtX2Tw=; b=MkWDjdD37lkRtHm+oJqjcQBQlkeK577Cu4T+fQvd2s5YfaQPLpL5dxoTSN7pIf0Diz /MbhkJgUs0XLdWX/iq73AMyxGp2rR/WRc4giQhX7L02Uo26VIQlzEwxYp/jFBgz4B62C r4Si70zukibIZCNAzk/fEzXIzSPmmSD4Xk3K4Udj4MdXENJ2dnyfwAZ8QE7YIsJSFkss w+dSoglG79puaV5T1BFDkDcW6/CRDZFxSsIxVB1ogiUJiAG8aIydulGske5thp7RupZX FAE8/SNo9p2Fkz0onWQTnfKzu9VFiOfEPOXG/QqUC9K6LQLT7M7RMlUm3ZlDwT5CsATN wsyQ== X-Gm-Message-State: AOAM532xyCdpC+YYbgnjR/+PzxUepgBBNIjhK/BIjdq4MYsYGzDu7kNH D4aftjRatSU1E+QdSOhFy/7020f+qVIXGw== X-Received: by 2002:a17:902:f34c:b0:163:fa4f:2ff5 with SMTP id q12-20020a170902f34c00b00163fa4f2ff5mr11819411ple.174.1654292283725; Fri, 03 Jun 2022 14:38:03 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3286:cc26:3d5e:3f94]) by smtp.gmail.com with ESMTPSA id o13-20020a170902d4cd00b0015e8d4eb2aesm5903523plg.248.2022.06.03.14.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 14:38:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu Subject: [PATCH] linux-user/x86_64: Fix ELF_PLATFORM Date: Fri, 3 Jun 2022 14:38:01 -0700 Message-Id: <20220603213801.64738-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We had been using the i686 platform string for x86_64. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1041 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier --- linux-user/elfload.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f7eae357f4..163fc8a1ee 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -130,19 +130,6 @@ typedef abi_int target_pid_t; #ifdef TARGET_I386 -#define ELF_PLATFORM get_elf_platform() - -static const char *get_elf_platform(void) -{ - static char elf_platform[] = "i386"; - int family = object_property_get_int(OBJECT(thread_cpu), "family", NULL); - if (family > 6) - family = 6; - if (family >= 3) - elf_platform[1] = '0' + family; - return elf_platform; -} - #define ELF_HWCAP get_elf_hwcap() static uint32_t get_elf_hwcap(void) @@ -158,6 +145,8 @@ static uint32_t get_elf_hwcap(void) #define ELF_CLASS ELFCLASS64 #define ELF_ARCH EM_X86_64 +#define ELF_PLATFORM "x86_64" + static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) { regs->rax = 0; @@ -221,6 +210,21 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_386 +#define ELF_PLATFORM get_elf_platform() + +static const char *get_elf_platform(void) +{ + static char elf_platform[] = "i386"; + int family = object_property_get_int(OBJECT(thread_cpu), "family", NULL); + if (family > 6) { + family = 6; + } + if (family >= 3) { + elf_platform[1] = '0' + family; + } + return elf_platform; +} + static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) {