From patchwork Thu Aug 12 11:10:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lara Lazier X-Patchwork-Id: 12433235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A547AC4320A for ; Thu, 12 Aug 2021 11:12:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBB8F61019 for ; Thu, 12 Aug 2021 11:12:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DBB8F61019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE8dd-0000LT-SZ for qemu-devel@archiver.kernel.org; Thu, 12 Aug 2021 07:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE8cJ-0007OC-LS for qemu-devel@nongnu.org; Thu, 12 Aug 2021 07:11:21 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:55058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mE8cI-0006ln-09 for qemu-devel@nongnu.org; Thu, 12 Aug 2021 07:11:19 -0400 Received: by mail-wm1-x336.google.com with SMTP id g138so4184185wmg.4 for ; Thu, 12 Aug 2021 04:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ggcz6ifefrwwLbHZT3YC9yosocnIv/l2pobUP+e3cTg=; b=njsDXT4518M7KaHjleocGCwRhLkpzyV2rr3e74Qc2FgL1L7qa5V5ATtTMeH5XNLOqL FK3H/Cw6VctNZu0w/ZPBSnQgppOYI9qVVL+1LdYcrnluhM6RbhdHZhJ0IYT1l4L26YND oHvag0Qv/mxlgbmslgpDH1X9gQ508ibhkSnEbiirQNhL9aLdV17Ydt5O/UQTXcwSdZ15 E43fVKmkhzHL1/UEzsFYkAqWljrqIHlYzyxndx1c+MCQFeo2MGMO8hqAaY+CNtpU74nk oGGpyyDOtRjUyQvxcqeLPsWCz+HqQmyeJ7NMCO5OljeY0EuBSmR3FOL+4SL+CBkhd8fp NkPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ggcz6ifefrwwLbHZT3YC9yosocnIv/l2pobUP+e3cTg=; b=PNwkBJrFwwTkfO9MiSk/iWiGjbRSshq2UKqs6jZNPGdsN/9hr/z00Jh123R1wWjUyK DY+t+MnWGzXzfK+imPhLmNUywp5mAvDLdhELL4TjWB4WAExHnR5xFWjDdLTOXBrTU7vf N8rhEpORrHDELoR7My/GXAPKAshE3yVjsEjvOiMAbQhgA98ZdjBCPmpuXbPxm+p219EQ qtz83DI4b7wXzs4mlAySt6dUxTcIg7JTA80xl7N85xet2a2L63oBAOi21vgeMrzTGwHo MnaXyLXC0VbZ7d6ZiE5QhswcvQ7yZQ9xJohB7aqw70KFbqdBJPZ5X9ND+X7UbdjhN61D BpgQ== X-Gm-Message-State: AOAM5310M6ZahVybQy2Aa3KBx0p4Bnkvugqb99QpO/q/Ce1lJloyQVlE yMemF2fHqLVW93v4lJl1Qxx/c8PvScQ= X-Google-Smtp-Source: ABdhPJwVYe5RrMblujh/pwSrk9mUDEGQ3TdXWv325PTKmYicqVK5HXmcN3FU1zb6GPewaBa21yBZag== X-Received: by 2002:a1c:10e:: with SMTP id 14mr14724554wmb.93.1628766675963; Thu, 12 Aug 2021 04:11:15 -0700 (PDT) Received: from laral.fritz.box (200116b82b4d700068bb3a85648165df.dip.versatel-1u1.de. [2001:16b8:2b4d:7000:68bb:3a85:6481:65df]) by smtp.gmail.com with ESMTPSA id h2sm8999228wmm.33.2021.08.12.04.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 04:11:15 -0700 (PDT) From: Lara Lazier To: qemu-devel@nongnu.org Subject: [PATCH] target/i386: Fixed size of constant for Windows Date: Thu, 12 Aug 2021 13:10:56 +0200 Message-Id: <20210812111056.26926-1-laramglazier@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=laramglazier@gmail.com; helo=mail-wm1-x336.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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Lara Lazier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ~0UL has 64 bits on Linux and 32 bits on Windows. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/512". Reported-by: Volker Rümelin Signed-off-by: Lara Lazier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/misc_helper.c | 2 +- target/i386/tcg/sysemu/svm_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/misc_helper.c index 0a7a58ca9a..91b0fc916b 100644 --- a/target/i386/tcg/sysemu/misc_helper.c +++ b/target/i386/tcg/sysemu/misc_helper.c @@ -97,7 +97,7 @@ void helper_write_crN(CPUX86State *env, int reg, target_ulong t0) break; case 3: if ((env->efer & MSR_EFER_LMA) && - (t0 & ((~0UL) << env_archcpu(env)->phys_bits))) { + (t0 & ((~0ULL) << env_archcpu(env)->phys_bits))) { cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC()); } if (!(env->efer & MSR_EFER_LMA)) { diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 3891f4e4a8..42cd5053e5 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -290,7 +290,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend) } new_cr3 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr3)); if ((env->efer & MSR_EFER_LMA) && - (new_cr3 & ((~0UL) << cpu->phys_bits))) { + (new_cr3 & ((~0ULL) << cpu->phys_bits))) { cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC()); } new_cr4 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr4));