Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17173692ybl; Wed, 1 Jan 2020 23:48:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzrsNo2BCsKbMHbw0AmHw8FCpP4kKof+nfSJjcWadz1YEM3jAm9QpjxhlsKpzfRhAcuXWRv X-Received: by 2002:a9d:6045:: with SMTP id v5mr84785640otj.252.1577951280848; Wed, 01 Jan 2020 23:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577951280; cv=none; d=google.com; s=arc-20160816; b=mLkzd5QRAfPMpUKi6mIx5aKhbTATzrgioWWxcaUAqJyOywRsY9ZR9izKHNaOpDQxUf PURNGmnrQfO4/pA+rNnM9AvkBHHUpk1ki6Jr5FvQJ8nQ6xFrbqN4LBGBXdO7plhb+Pl6 DVhK4lHDijno/uCRmb20gyRr+iWd31w3bQv1oMQ2vMLvtczJqEt1EKnxhJYoTIeLT0kW rcFXh1PRlWQCxCENMFye1ywB4qgkmuWmwVvlklzNDIwzp3m0JszbL2WWqN21VvS5/AtX 0Wa/4ZxuOjO9Zw9j/523J/UAXSGRlShpOr9PKL3A8KGO0CERKHs8xoqBnqG5XkdVm5Es vehQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UMsZF9sy1sW5J3kVgI/fUJy6gl0uFtVuKYIkDGAzFWk=; b=mpqjYz7iIz9Dr1iwAafz/WvpLdwuKpMObUsq6Pjn16c1VHguZ0xDmsPcAlM7PzElyn ZqI/308Kq/u9sq+tB7hObZm/aI4d4ZRziEKCd8Qk9kiUlqSTvv2qyb80DbCq0Qd3jQwf bwK8aA7EnlmXY7iW9EIfmed/2L/FKhCVLFzIK479ewC+KGQJCboH46Pi+hozkIKXsTtv +SVx4FV+JxKAivLV8Hnbm/TUFJbXzg/dhMpIwdjl0vYVFjf1D0xtrM6ZHFyI7Ts4azNd 1ZThhTVqg9KAvU7A54mvdZDYSjViEO0hh2KeC8CC3DaSLPCgQdihm+Qxf8hdrk5lObfP LavA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=OXFQiSuv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b145si20521390oii.67.2020.01.01.23.47.48; Wed, 01 Jan 2020 23:48:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=OXFQiSuv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbgABHrJ (ORCPT + 99 others); Thu, 2 Jan 2020 02:47:09 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44846 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgABHrI (ORCPT ); Thu, 2 Jan 2020 02:47:08 -0500 Received: by mail-lj1-f194.google.com with SMTP id u71so39853026lje.11 for ; Wed, 01 Jan 2020 23:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UMsZF9sy1sW5J3kVgI/fUJy6gl0uFtVuKYIkDGAzFWk=; b=OXFQiSuvcrGsBxZPaeQirPMFrClNc9rDGbdyE6WGJrLnluSMK/JxkV6wp3qL3rrGcg 0W9yJj/F/VsGBt1ubZQiz5WOVNVXq+K4JE9iUJHCTqRu2NPvcNHPkqF3HqMmEVTWLjdo eOuQVuA14rxB2aatZqQHIOTFs7x3bg6wO5LBoaMjaG7OBpLxL+HE6xUQcbuZYOVMOZVi tKCutxoMGHTdyMj7Bxfk9EZMInhx0rPic1cpynmCz0/B9rIU/S2YtffUNkjXm4t/UK5e whbNjDIPkHBZ7wO37ouNQgaJ/UvxTA49ndlm3LDOEoOY4nYBbAd2ejQdXoLAntOuqeIM Ergg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UMsZF9sy1sW5J3kVgI/fUJy6gl0uFtVuKYIkDGAzFWk=; b=a0cXByHH5JXCTJpVhiGDcpIM2ihGeZRs8oF05czhdJBxPtFwZrsA74UjlGmL4UZYD8 O1C4qwqZLrtzHFNf+zSWxkaeUVs4/gHLmreSVcG60f7QCDu5IS3LrXzwTilHXObNxckR f9gZjqrMMewnI70Be6pupiklsNDz/VMc3+WmWWbNmxQ52OvcmPKV7zg8kCHWyTQEP2xS oDwbOA/a0Chy/9VRdxkQ7ZTkK7QuQ6NezCWS9HpTiPw6v/B10XxXQ/8LF5iEzHRCQ5Lb 14Lni1WTZxxazGi4SzbYK7++4Ikg1mfPe2L0BSqbKtVSKGk96/tNkXZprZ+s0ZOAzIO+ gjig== X-Gm-Message-State: APjAAAXsO008LpVsD/9NxxUM64hiF/Fq4czU/mWth0MzY0O7jiK7mCl/ HfhFXyV8dlgP91lNH+grLl4WVQ== X-Received: by 2002:a2e:8651:: with SMTP id i17mr38826910ljj.121.1577951226498; Wed, 01 Jan 2020 23:47:06 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id u16sm22081579ljo.22.2020.01.01.23.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jan 2020 23:47:05 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id D26CE100528; Thu, 2 Jan 2020 10:47:05 +0300 (+03) Date: Thu, 2 Jan 2020 10:47:05 +0300 From: "Kirill A. Shutemov" To: Jann Horn Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Andrey Konovalov , Andy Lutomirski , Sean Christopherson Subject: Re: [PATCH v7 1/4] x86/insn-eval: Add support for 64-bit kernel mode Message-ID: <20200102074705.n6cnvxrcojhlxqr5@box.shutemov.name> References: <20191218231150.12139-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191218231150.12139-1-jannh@google.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 12:11:47AM +0100, Jann Horn wrote: > To support evaluating 64-bit kernel mode instructions: > > Replace existing checks for user_64bit_mode() with a new helper that > checks whether code is being executed in either 64-bit kernel mode or > 64-bit user mode. > > Select the GS base depending on whether the instruction is being > evaluated in kernel mode. > > Signed-off-by: Jann Horn In most cases you have struct insn around (or can easily pass it down to the place). Why not use insn->x86_64? -- Kirill A. Shutemov