Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp661705pxk; Wed, 16 Sep 2020 13:41:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5LoAkr1k2zqd0kwIY5VfNhnNInkLOToY+QhKVxmfMJB8m0oBVgUPmeTq/Ookqtlx65mZQ X-Received: by 2002:aa7:dac5:: with SMTP id x5mr25423266eds.72.1600288874271; Wed, 16 Sep 2020 13:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600288874; cv=none; d=google.com; s=arc-20160816; b=xcfcIVvkgDZ3OkvOP124Bs5WsXQnSdnhglocua2WOyoDvm2Jidbyra7oH8GIvwe3Nl LfXHP7MqTFgdrUbNw5TA8Y42UadiADbcW57MRRuUrCJqRZq2icZXon79oksPU4cdjIWV HqV6L3eS87J1zs700WLhUfO4QEx6o482ZlBC24rrJkJacbwozCnvTMut6q4U9xzqCc2L uHUj7ZCQoeSwK0/guuYL2gLZtI07VK864nI3t29FduZRW452xf7C9HXeLdZfPzN5hdbK NnJvj9o5AQgRPK1AoUu9IW8g4MOrMfY2eGwBy0wbT+tfIbmK4ungk8oEpLiVF0BOl7+v Vg3A== 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:ironport-sdr:ironport-sdr; bh=h7Dpniy0bbxYpj84C390c+Vkyri6oKn6WS+zLkYyTiQ=; b=tu2Zn1zBfFLFEn0LW1bIoUiTgGgFHtfGs8lUEIuFMIALKXthiusEiS0s0MJJ9AXayc np1OwgV0NI/1K4wMOszu3S4OwRAVcNbTezg9FNP40onnmrQKygkFA+KRKqXvIcNZAiQc aYw9XVXz6LQWe4q5Z8Ga64x+Vkhvjfv2xQjtQAPsr6Ub4WBipuQIq8emgWmxDiwMspoo 3GRwXQ1WeDU4oprfAvba++uoAkWt2aFvdcJC3YdozvsKa4KQDI/P1xU+XpX/JSG/iqv0 +U02I0V5kv5A5ygPcwBadS4mWL27YXqqICCTr15ZxlK1U5TW06rGd5Hx8dWyG2UPalZm 9jFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si13719801edi.95.2020.09.16.13.40.50; Wed, 16 Sep 2020 13:41:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728273AbgIPUho (ORCPT + 99 others); Wed, 16 Sep 2020 16:37:44 -0400 Received: from mga04.intel.com ([192.55.52.120]:14999 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbgIPRJW (ORCPT ); Wed, 16 Sep 2020 13:09:22 -0400 IronPort-SDR: NRRfqxIk2POsUCi6COTFpiYUT+IRTW9bCotYLwH8EbF229HbkzlW3YosPyxkdHpKCMSaZ7yX/u gY13ALiH5vIQ== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="156909016" X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="156909016" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 10:08:41 -0700 IronPort-SDR: VQ1WRuPQofTMsAY577bwERRjOaaJuPrpDemjjRSKVq28NMlARkxp2x3q5tOYrRVqo7DIhV1eAn oCOKk015bv2A== X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="451937469" Received: from sjchrist-ice.jf.intel.com (HELO sjchrist-ice) ([10.54.31.34]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 10:08:40 -0700 Date: Wed, 16 Sep 2020 10:08:39 -0700 From: Sean Christopherson To: Alexander Graf Cc: Aaron Lewis , Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , KarimAllah Raslan , Dan Carpenter , kvm list , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 1/7] KVM: x86: Deflect unknown MSR accesses to user space Message-ID: <20200916170839.GD10227@sjchrist-ice> References: <20200902125935.20646-1-graf@amazon.com> <20200902125935.20646-2-graf@amazon.com> <186ccace-2fad-3db3-0848-cd272b1a64ba@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <186ccace-2fad-3db3-0848-cd272b1a64ba@amazon.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 11:31:30AM +0200, Alexander Graf wrote: > On 03.09.20 21:27, Aaron Lewis wrote: > > > @@ -412,6 +414,15 @@ struct kvm_run { > > > __u64 esr_iss; > > > __u64 fault_ipa; > > > } arm_nisv; > > > + /* KVM_EXIT_X86_RDMSR / KVM_EXIT_X86_WRMSR */ > > > + struct { > > > + __u8 error; /* user -> kernel */ > > > + __u8 pad[3]; > > > > __u8 pad[7] to maintain 8 byte alignment? unless we can get away with > > fewer bits for 'reason' and > > get them from 'pad'. > > Why would we need an 8 byte alignment here? I always thought natural u64 > alignment on x86_64 was on 4 bytes? u64 will usually (always?) be 8 byte aligned by the compiler. "Natural" alignment means an object is aligned to its size. E.g. an 8-byte object can split a cache line if it's only aligned on a 4-byte boundary.