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.3 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 C1196C433E1 for ; Tue, 25 Aug 2020 09:22:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1D4E2068F for ; Tue, 25 Aug 2020 09:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729053AbgHYJWa (ORCPT ); Tue, 25 Aug 2020 05:22:30 -0400 Received: from 8bytes.org ([81.169.241.247]:39304 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbgHYJW3 (ORCPT ); Tue, 25 Aug 2020 05:22:29 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 840D829A; Tue, 25 Aug 2020 11:22:27 +0200 (CEST) Date: Tue, 25 Aug 2020 11:22:24 +0200 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, Joerg Roedel , Tom Lendacky , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v6 02/76] KVM: SVM: Add GHCB definitions Message-ID: <20200825092224.GF3319@8bytes.org> References: <20200824085511.7553-1-joro@8bytes.org> <20200824085511.7553-3-joro@8bytes.org> <20200824104451.GA4732@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824104451.GA4732@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Aug 24, 2020 at 12:44:51PM +0200, Borislav Petkov wrote: > On Mon, Aug 24, 2020 at 10:53:57AM +0200, Joerg Roedel wrote: > > static inline void __unused_size_checks(void) > > { > > - BUILD_BUG_ON(sizeof(struct vmcb_save_area) != 0x298); > > + BUILD_BUG_ON(sizeof(struct vmcb_save_area) != 1032); > > BUILD_BUG_ON(sizeof(struct vmcb_control_area) != 256); > > + BUILD_BUG_ON(sizeof(struct ghcb) != 4096); > > Could those naked numbers be proper, meaningfully named defines? I don't think so, if I look at the history of these checks their whole purpose seems to be to alert the developer/maintainer when their size changes and that they might not fit on the stack anymore. But that is taken care of in patch 1. Regards, Joerg