Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1333619rda; Mon, 23 Oct 2023 09:21:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5mLS4EA/8kwUFwdZCvQeH1526IwC+jCKbTOjypkL6GbTRN3X/FqlZACrPEcFyC5M5SnqB X-Received: by 2002:a05:6358:c9b:b0:168:e84f:386b with SMTP id o27-20020a0563580c9b00b00168e84f386bmr1531738rwj.1.1698078083200; Mon, 23 Oct 2023 09:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698078083; cv=none; d=google.com; s=arc-20160816; b=KlDpFFGfJtVrckutFWH+NaVW6+AXQtXPEBtq8z2fMIY+jLJpullHZ59YRC6uFlhaii Hwmt3UZvJwi3PALSZl3mz35uW8kAI7twy2vIOOGINHfGLu1VKiKpw6VN7B8KLOq0Ek63 wx2N4VC7p8T0nCKAcy4aaNa8/gO342kTkJkDDfAOFuIeWqLKq1B5AfoVxkHSbKyoxwrU owy79CJ5wJWh/PR8dgxf8I2dGpO4JX260BtY+NCASS/xiAsIbFBR7ZIYY6/S/L7JIqKN gdvbufflFGhmsFeF9YoEgtjr0DVyogYzg4bX0/fOjrtcRUzpvxFD0//li9NDkEtBgIh2 xSow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Q6M5Qcu8/m7OmULF94b0ZtR8TUikaFRq5dVXXqiKXwE=; fh=e5b2UcnN4Hvp9bvOQUtHiXwDZJAlE/kT7G1+4jee5Ek=; b=O/B5ZbztiFCynxwYeQYNWLYyUy/mUSMm0ZrGO/hKYOgwu7ZVBqO7gq6XqUpXhKzYZm k5VVGkelrY9I52JX6OttPNBkQELe6a01m1+/y/I6iXNqHGDEXSJ+Gdt4aS0q8yFKWiIL Tik+hNPiGBs/pNiFpCj9udikdMAgVZRLKMGfn1DT4iKFnC8EN/Z8NdGhgGNjXwV0pd/O gE9IyFObTg7pkY5WZ3LBKviO6+ZJYl+19hKo2E3pRjgqoRQARVZfhvL3lJFQMh0vMUSC jRShNLVs4sCe2Ade4DNVESd//zEOtkOL/khn5NvVQ8jmLBqecH2m/rWYFPuBXYBAOdAs oUvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VsPR9Aa7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bw38-20020a056a0204a600b005b7dd1e13e7si7020613pgb.556.2023.10.23.09.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VsPR9Aa7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id AE29C806BF3B; Mon, 23 Oct 2023 09:21:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233522AbjJWQVB (ORCPT + 99 others); Mon, 23 Oct 2023 12:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbjJWQU7 (ORCPT ); Mon, 23 Oct 2023 12:20:59 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1258410C for ; Mon, 23 Oct 2023 09:20:57 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1cbe08af374so2044375ad.3 for ; Mon, 23 Oct 2023 09:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698078056; x=1698682856; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Q6M5Qcu8/m7OmULF94b0ZtR8TUikaFRq5dVXXqiKXwE=; b=VsPR9Aa7h9wJMuKyJLL0Rrk7gSaJd4M0k/q8KjPP6SGHXf+bEtIbH9h5d9z7USI4tK VTBC/bwSa176KERuEeEtnJFzYqcbvDFVGkmmFyDULik+30g6E2oz2+RMwax9KCxtJLDc JhjH+bDrjSKs8fpDiMj3vT8KW7c/l3T7r+pL5v6xo7zeGgkFL1bBC5l2+8QFhzoKpH0Y pUGV1r7ngWc3HRF1gV1zz2uJZ4vQ9SgmQnjFthTHJIw6PqVmEkNw0zyL7E83hvHjpv6Y 7hTp4cOR/AtwApc3hnr9Sic9uX8oEZ3aOqDUSeDLp8Wlzo9L2qwG6M1o7Ap22ioznSoS EBmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698078056; x=1698682856; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Q6M5Qcu8/m7OmULF94b0ZtR8TUikaFRq5dVXXqiKXwE=; b=NUMSfS9WjA3VNywGnhKDmzNCzhJPrnbJZCl8yBXhuIvVAAHmyJjGARWr5LW3j4HBJq fOwN6EBTauLBjnS1dla1EadJYku4/xbVBFBUO6Nb3WoySv7DEvk5m8N8EArvr6SxJSuj GmzMZIDHOww0YZb4QKaT3lgpY1JS/dWa9trq/Q9d6EY3OC7d4yyvwvM3eYYP/t55qLK6 TiTdP1O0GNgw4DNz/Ipz3GlKOn5p/UFFn+2Kg5jnjdPDVAtBXy+DUIOmv6l3J8ajphZc C1Rf0jt4BXxzyXdtELfKOVC8z+E84M7uZL49srEauNjL7RIyY40aLRw7QoQlpibfm+eF GiTw== X-Gm-Message-State: AOJu0YxoEHRWZeF70Hi5rPBOaxe0RFxrlx4zu1mJTryiZCbiD3qdRW4q KaCbPMVwh4CiblJwRGALXw9jtjZnq+I= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:23cc:b0:1ca:4d35:b2f9 with SMTP id o12-20020a17090323cc00b001ca4d35b2f9mr176090plh.8.1698078056416; Mon, 23 Oct 2023 09:20:56 -0700 (PDT) Date: Mon, 23 Oct 2023 09:20:54 -0700 In-Reply-To: <20230913124227.12574-3-binbin.wu@linux.intel.com> Mime-Version: 1.0 References: <20230913124227.12574-1-binbin.wu@linux.intel.com> <20230913124227.12574-3-binbin.wu@linux.intel.com> Message-ID: Subject: Re: [PATCH v11 02/16] KVM: x86: Use a new flag for branch targets From: Sean Christopherson To: Binbin Wu Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, chao.gao@intel.com, kai.huang@intel.com, David.Laight@aculab.com, robert.hu@linux.intel.com, guang.zeng@intel.com Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 23 Oct 2023 09:21:11 -0700 (PDT) On Wed, Sep 13, 2023, Binbin Wu wrote: > Use the new flag X86EMUL_F_BRANCH instead of X86EMUL_F_FETCH in assign_eip() > to distinguish instruction fetch and branch target computation for features > that handle differently on them, e.g. Linear Address Space Separation (LASS). A slightly different shortlog+changelog: KVM: x86: Add an emulator flag to differntiate branch targets from fetches Add an emulator flag, X86EMUL_F_BRANCH, and use it instead of X86EMUL_F_FETCH in assign_eip() to distinguish between instruction fetch and branch target computation for features that handle them differently, e.g. Intel's upcoming Linear Address Space Separation (LASS) applies to code fetches but not branch target calculations. The shortlog in particular is far too vague. > As of this patch, X86EMUL_F_BRANCH and X86EMUL_F_FETCH are identical as far > as KVM is concerned. This patch looks good, but I'm going to skip it for now as it's not needed until LASS is supported, since LAM doesn't differentiate between the two. I.e. this should have been the first patch in the LASS portion of the series. No need to repost, it's trivially easy to tweak vmx_get_untagged_addr().