Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751229AbdFBCKW (ORCPT ); Thu, 1 Jun 2017 22:10:22 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36021 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdFBCKT (ORCPT ); Thu, 1 Jun 2017 22:10:19 -0400 Date: Thu, 1 Jun 2017 19:10:14 -0700 From: Nick Desaulniers To: Paolo Bonzini Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] KVM: x86: avoid large stack allocations in em_fxrstor Message-ID: <20170602021014.4sdvqe6mgqa4cq46@lostoracle.net> References: <20170529224858.9942-1-nick.desaulniers@gmail.com> <20170531030838.23182-1-nick.desaulniers@gmail.com> <1815926933.3699401.1496228489339.JavaMail.zimbra@redhat.com> <20170601010505.jl7dlat3zaaw6osf@lostoracle.net> <92c4ae48-2356-8ed1-64bd-2adbdb34cdfa@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92c4ae48-2356-8ed1-64bd-2adbdb34cdfa@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 668 Lines: 15 On Thu, Jun 01, 2017 at 09:36:18AM +0200, Paolo Bonzini wrote: > On 01/06/2017 03:05, Nick Desaulniers wrote: > > On Wed, May 31, 2017 at 07:01:29AM -0400, Paolo Bonzini wrote: > >>> + size = offsetof(struct fxregs_state, xmm_space[16]); > >> This still has the same issue (it should be multiplied by 4). > > > > I'm still misunderstanding the math here. > > > > Why multiplied by four, in this case? 8 * 16 / 4 is used in other cases. > > *16/4 is the same as *4. :) I meant the use of an expression full of literals rather than either a single literal or an expression formed from well named variables seemed kind of like a code smell, but w/e. Patch inbound.