From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0134C43334 for ; Tue, 12 Jul 2022 17:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232838AbiGLR36 (ORCPT ); Tue, 12 Jul 2022 13:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiGLR34 (ORCPT ); Tue, 12 Jul 2022 13:29:56 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B56E125C45 for ; Tue, 12 Jul 2022 10:29:55 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id v4-20020a17090abb8400b001ef966652a3so12323633pjr.4 for ; Tue, 12 Jul 2022 10:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=cPzGU1EfDB8Kgcn5JHE6BwdeQ1cMejvPjGeavCHnVz8=; b=FaJWZzBb1jX9HT1+ULW4ocEesfyiky40mJwIH0YyxpvyU6kqJHizewanQP8vaIOQfe A1HyUBeFmi4d1vBQY/nVowUu2tsmDyZBUAKSAJ5bAbntJYNdqgy3jh1XhHbky0Cc70Jp TafIwYWjwpyj3IbKU6k/WaDePxKSkpHBDZDWRJH/VhEwbfwbmWFGyCcjoy3VzFx4bQk8 U2+I0yGzItVxfWW0dY6YGJrxec6sm2MeDqlaEm6u+iYkYOKW09IcxdCjRKedL+S2qbNA CcR/6f5kTt5JoT2BZbUcqbXTI9ZKMlLbZqDxGuKV1z+Bo4ytbimnupH+F1rd3DZVZbUi WQFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=cPzGU1EfDB8Kgcn5JHE6BwdeQ1cMejvPjGeavCHnVz8=; b=zNRIMWmuV8cQb9wOg/+XBp6lXO/q/52ZrUeHzlDQevWOlYdKFBnRM+ETgwCAVsJISQ dswMO4WwVPWXfjRvWFxKmCJSsLEXi9yzVp/EITNgmFBwWLZhpA/nO0QM+RIHuDLEWYKD ERZ68EpLAb/8ICmhlfxdwmSomWoMiEIj9pFQQQzwF+soXARjh2R53JhRlSc0/Spru6xX PFc8JzqxM2NnYODmo1q5vYyiKO3CFr7PcnmfIQgXQqmvRew/uoLVJpbx8ZxsUB59dEez lqHIYeeFKMtpOD2UdRnpXoOIrPedSdrbOLFibtf0NHA11OrY0rZvO8hHQ3ep2DA2CPkJ lhhw== X-Gm-Message-State: AJIora96i2aQ9rELWen47AcZJuLC1Zmwj8gz5FGSSaYxxVVLuoh6MgV8 puPaYoFBow1QTRclqvhSpN9/ug== X-Google-Smtp-Source: AGRyM1tv8Boig7iuJJg8G6TPawy0AOJXdxhyWB7ZE4Sbrj6cY35fVhpvSWNf/VS6E4WPsivU8vCfYQ== X-Received: by 2002:a17:902:f691:b0:16c:4043:f6a2 with SMTP id l17-20020a170902f69100b0016c4043f6a2mr13927905plg.72.1657646995183; Tue, 12 Jul 2022 10:29:55 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id z18-20020aa79592000000b0052abfc4b4a4sm6430987pfj.12.2022.07.12.10.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 10:29:54 -0700 (PDT) Date: Tue, 12 Jul 2022 17:29:51 +0000 From: Sean Christopherson To: Maxim Levitsky Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+760a73552f47a8cd0fd9@syzkaller.appspotmail.com, Tetsuo Handa , Hou Wenlong Subject: Re: [PATCH 1/3] KVM: x86: Mark TSS busy during LTR emulation _after_ all fault checks Message-ID: References: <20220711232750.1092012-1-seanjc@google.com> <20220711232750.1092012-2-seanjc@google.com> <8307c007823eac899d3a017d1616e0d08a653185.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8307c007823eac899d3a017d1616e0d08a653185.camel@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022, Maxim Levitsky wrote: > On Mon, 2022-07-11 at 23:27 +0000, Sean Christopherson wrote: > > Wait to mark the TSS as busy during LTR emulation until after all fault > > checks for the LTR have passed.  Specifically, don't mark the TSS busy if > > the new TSS base is non-canonical. > > > Took me a while to notice it but I see the canonical check now, so the patch > makes sense, and so: > > Reviewed-by: Maxim Levitsky > > Unrelated, but I do wonder why we use cmpxchg_emulated for setting the busy > bit, while we use write_segment_descriptor to set the accessed bit. 99% certain it's a historical KVM bug in how it updates the accessed bit.