Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17257468ybl; Thu, 2 Jan 2020 01:50:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxHb54YDb4oi97YN6OiERKACNCJ01z4Gy5aZ4Wlwn4UCP8htz7iuY18VIypjQS/0ngGqF5A X-Received: by 2002:a05:6830:1e8a:: with SMTP id n10mr80172185otr.303.1577958639536; Thu, 02 Jan 2020 01:50:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577958639; cv=none; d=google.com; s=arc-20160816; b=jccrqAHht4VBnAlN6U7NHRQrXqdsoKzFCl+RTvZOSau1Jr47MEPawGUZ1KJDuVwP1N FfrqleraFDWHc45pwg1BLm13z4oB77laMUHCzw/itZuPQZ71+Z84c6hIGPwofWfPvgk+ Rh5/RB6ShjmSjdqt9fnw+kZbo2aFG+aj87ixc0U2BTokkTvl8AnYEnYEocNfVGh+zSFH xvAQruFmD8Obdh4Hf/JHpT3wdCfvxPqhdmZlrzIjWlbF3OaFUTqYRIVhWCj6+hbJm8cR p+hwCKx0MlW7tXnwSO4IdYLOjIncl0tW5dlliQEp+v0JLbLY0jODNrZ2m53q60AlD7hg 5WYg== 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=CJNF7zzDiHYcqJL9y97v859TagsM8CsUOrBW1KXmnOw=; b=HgzFVLHwQg8XaSEPkDp3y1Lv2rzLNIgHWd/wfR5LEMqpmJreO4ACLbXhJcama/rhYe 0bG3YtzfqV/YgE4oHSaczFI89I1NYWkbs5LFpb0zh/gcEtDQchKfklgv3YPoyph71iW1 GRkbyXQkcWtnfghGzQ9MoUwn2T1Dbp4RVmWgPwgmqMtcORplPzka6D11Te+B5MPL3iTq C6tKv5Q9y1llx1taMNxieA0lwS48CuI87w9v/NMCWowa4GRjN24pHrcUfi9iSvym15TY UAcaN5tlzNP0hY6zucqsOc9lIyhUoFOgZCaTybXoV3agQigcDiXdX9wc2Lvy8rMyJAzq Coqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=bfxdHICm; 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 65si24933105oif.14.2020.01.02.01.50.27; Thu, 02 Jan 2020 01:50:39 -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=bfxdHICm; 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 S1727990AbgABJts (ORCPT + 99 others); Thu, 2 Jan 2020 04:49:48 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37653 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbgABJts (ORCPT ); Thu, 2 Jan 2020 04:49:48 -0500 Received: by mail-lj1-f196.google.com with SMTP id o13so28718301ljg.4 for ; Thu, 02 Jan 2020 01:49:47 -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=CJNF7zzDiHYcqJL9y97v859TagsM8CsUOrBW1KXmnOw=; b=bfxdHICmkxcEYk5OqlY+pj/RJQV8jBDzu+Hk25x1/g+JImSxDSfnYQOxIrmXzQ+Zgd PjAU/WPzFr2vCOqpHXfpBCSSMlUNHVrD+JdDmY+/O+DguHH18pwVhGVvmiD2Oz6Qpr9L B+JCov8imOiK2GfvkEKA6L7+SE7Bv0vWlhX56P9Q+0UXVcUBbaHHSKCXPo5dJ13rLKrL z9r+U7toJbDsca1SYgfDjAGfRTOr0EBJN9jEMVNiMCcqmO38+FCmi3XBHQ0jzO3QDdIZ RHd80FQHaTbgL4YD+6GSPYYEsy1hiIwYYl4CkAxJEUPlMnPZIm1B3MbM8zqdcRaSa2UJ rDOg== 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=CJNF7zzDiHYcqJL9y97v859TagsM8CsUOrBW1KXmnOw=; b=FduYIN7zO402g1FfdDvo7LBLkyfASCNIADbJ3KtEngFbMrXGFjSEMEaEoBxTNkT8bM IO1WSHajcQQHqYi1iAIBUFDQqVO3dsn+t2ImqJmdosW1e7GE66G94E0KqoJs+T7WZAJC NQimNSDo8CWBNj5mcELRk8JFbb7GvEh3uNr/TTA9sHp+MJwi6DxOdwhIcf02gyU4TizD E60W+epOikCiqMjxS3O26j3oTPuvV14u098shmabQTJGX+nIuWnCvWeRT2Ikeo/8+wch kj6GEkjea8ig93twz2YjV9HXWhw//GsWetQfet7EWchWIug9CCZFMCMlGHBHiCg34vTy O1mQ== X-Gm-Message-State: APjAAAXslABcQ5+BEqGbYYtsDMY01BgKoMBX2FKn+kwjvk2F58PTHV2y VW4ajyzI0GJms4lQyHx550D31Q== X-Received: by 2002:a2e:9008:: with SMTP id h8mr49408333ljg.217.1577958586448; Thu, 02 Jan 2020 01:49:46 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id m11sm23025754lfj.89.2020.01.02.01.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 01:49:45 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 1A2C410006A; Thu, 2 Jan 2020 12:49:46 +0300 (+03) Date: Thu, 2 Jan 2020 12:49:46 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Andy Lutomirski , Jann Horn , Thomas Gleixner , Ingo Molnar , "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: <20200102094946.3vtwrvxcyohlqoxh@box.shutemov.name> References: <20200102074705.n6cnvxrcojhlxqr5@box.shutemov.name> <498AAA9C-4779-4557-BBF5-A05C55563204@amacapital.net> <20200102092733.GA8345@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200102092733.GA8345@zn.tnic> 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, Jan 02, 2020 at 10:27:33AM +0100, Borislav Petkov wrote: > On Thu, Jan 02, 2020 at 04:55:22PM +0900, Andy Lutomirski wrote: > > > In most cases you have struct insn around (or can easily pass it down to > > > the place). Why not use insn->x86_64? > > > > What populates that? > > insn_init() AFAICT. > > However, you have cases where you don't have struct insn: > fixup_umip_exception() uses it and it calls insn_get_seg_base() which > does use it too. Caller can indicate the bitness directly. It's always 32-bit for UMIP and get_seg_base_limit() can use insn->x86_64. -- Kirill A. Shutemov