From nobody Tue Feb 10 04:55:09 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=1622730773; cv=none; d=zohomail.com; s=zohoarc; b=BPqJXbfygFO+Zjc7iRjNTfmiMeHgsHeWPm9y0FD3vMSYBOS0jj+wvDJFIe2PeSe0UNNtFeM3dbUuE31O59Rz5LYdetTw8NCP3hpuhae2FBDLz8f9l6ehWhKvMdDr/BMz5t6isyg8xXtSDgPAwKXD55r4rs8aEFT/kRGFkQ4o1/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622730773; h=Content-Transfer-Encoding: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=eiNYKdEymzNvK37Wm5/uHgaRQxlBgWOvTJMeH6EfWJI=; b=F6EcHhFFw7TDd3yS9IyPJTTMGtfFOuypLu9ONX04M924HCruUz67lFJ1ThnsVZH7IpUmtpwcaWATJngbr5kSvjwmnuaLhWGpEESEQLEJC2LMXWnENKAyD4VLohBaZI+XZ+G4nKFNV5+HjBH0+CPguCIiFHilXczTmAD4EpEDIP4= 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 1622730773039981.8965554459065; Thu, 3 Jun 2021 07:32:53 -0700 (PDT) Received: from localhost ([::1]:41540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1looOx-0000Mf-S0 for importer@patchew.org; Thu, 03 Jun 2021 10:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1looJd-0005ie-E1 for qemu-devel@nongnu.org; Thu, 03 Jun 2021 10:27:21 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:38598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1looJb-0000J5-Rk for qemu-devel@nongnu.org; Thu, 03 Jun 2021 10:27:21 -0400 Received: by mail-ej1-x629.google.com with SMTP id og14so4230708ejc.5 for ; Thu, 03 Jun 2021 07:27:19 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id p13sm1562747ejr.87.2021.06.03.07.27.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 07:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eiNYKdEymzNvK37Wm5/uHgaRQxlBgWOvTJMeH6EfWJI=; b=pXv9TyuhdBwI4/dhVffFBp8GzmauTf896baQ9e71K7sEsoo3K6DLbD8apTcOgYsmya XxgV3qdQ0aStrqfRIotbwmek6jnyGJHRD1hifFkwaSRT0wxmOSr/iJsgE7yvKFJAsgZX lb2Bwi1VBrqwvzlW3n+zWxVhaRe3admwBREGoS/gbntf2djtc9poJwZPSACsoXcffMyO 4gjp8opQ/L4OFKD/+AK8EYhiX4gcVKYn8gEzYjq+qMPq0Ki3qHq6YtpsjmptXT0AZRX2 WQcyyJHSp2G6wcUYQnGNV+yMSGwhI69Ahws0quwR05TisPzaalvBEpyMGTXAY7bz5YYN ArtA== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eiNYKdEymzNvK37Wm5/uHgaRQxlBgWOvTJMeH6EfWJI=; b=OovpeIq+AafrHLTLMTaCh+MnS/NcCaMgGDYw6g0n1++eoBA8k94PSxwRik0wJQWNRK rS5ALr3BvKEt5GPiiYeF+imbjd1/xbhM7tUui6YvfLOpgHP6DgQBTdMq5xGJvvc2tFWy UIF86DaqAOnpgVEOspJpDbcRdosjdkdrZI+QUHHBG24r/twrjgWHPC/ERdv8XKCMxeCL Mu5AfiNrwdlaIkJYIwrH4/ubynl4CmC4PnF8XQ+18gMUxnymBDv39DI7hqJ1YyW4CpKd ZDuA2Gjg4sZY1xqfDAFft/pL2lEAwAxgzEe1xgPp3chmAVyiAeNrkWsw6LrUnl0AMudO Ub9w== X-Gm-Message-State: AOAM531L5B01M8Pt32zoDk6a9KvHTPg1B4Gw2FArD7OmKqhOO3TuUtfy 9Vrv/ZL2IYoe9KxIbAndL+EIfirtpiSpKA== X-Google-Smtp-Source: ABdhPJyklr70PpOmSHAo2yJ6lPy0AvlXFQJWl91Ct/7TgpPdqgvNjLLtCNzhubNnBNjNo57YWmtXzA== X-Received: by 2002:a17:906:2612:: with SMTP id h18mr22979668ejc.417.1622730438622; Thu, 03 Jun 2021 07:27:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/3] target/i386: tcg: fix switching from 16-bit to 32-bit tasks or vice versa Date: Thu, 3 Jun 2021 16:27:14 +0200 Message-Id: <20210603142714.224210-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603142714.224210-1-pbonzini@redhat.com> References: <20210603142714.224210-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::629; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x629.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: , 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" The format of the task state segment is governed by bit 3 in the descriptor type field. On a task switch, the format for saving is given by the current value of TR's type field, while the format for loading is given by the new descriptor. Signed-off-by: Paolo Bonzini --- target/i386/tcg/seg_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 2112c5fc51..3ed20ca31d 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -319,7 +319,7 @@ static void switch_tss_ra(CPUX86State *env, int tss_sel= ector, } =20 /* save the current state in the old TSS */ - if (type & 8) { + if (old_type & 8) { /* 32 bit */ cpu_stl_kernel_ra(env, env->tr.base + 0x20, next_eip, retaddr); cpu_stl_kernel_ra(env, env->tr.base + 0x24, old_eflags, retaddr); --=20 2.31.1