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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BACE5C35257 for ; Wed, 16 Sep 2020 20:37:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F6DE2087D for ; Wed, 16 Sep 2020 20:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbgIPUhp (ORCPT ); Wed, 16 Sep 2020 16:37:45 -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.