Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2930523rdb; Fri, 22 Sep 2023 12:22:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGN1UiJ8WI2Cbn7vk0pNUpfvkajK22EzB0ojYUFwjw36tu7dOUr2EfSW3EuFIJy1S/tCS2e X-Received: by 2002:a17:903:1248:b0:1b3:d4ed:8306 with SMTP id u8-20020a170903124800b001b3d4ed8306mr420605plh.19.1695410535596; Fri, 22 Sep 2023 12:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695410535; cv=none; d=google.com; s=arc-20160816; b=Vo3FzdgaJq/y372nTr0QB3jY4gnnePymZmqAEl0E6aem+gCtbrzrReNzZ5xT/zEDUO D5Mjdbv3FXgbIKsPSTmyAZ0m3knNyowSp3XJFV3Gno4Dq/YjuRBCAR+Zz5dJfVSGefSD zSIuM/YhU3GjeuIJvDVjoBsSV8lk0GdSwS0HsMm5LgvgptVfR0MhVq9Gey5k3KbpxWeD dPK1n10nun4nAxxu5yxKzm9Q5bj5EDziq12ETdzXSN1WAC2lZzK+nCfjSyfh22srd5Wj TDsfaCMb65HUhITidxHcCP6+o2Jzkom/nG0klOPgR7KsgBDsYQyd6Ct4fi3UnzN+jm03 mezg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=atbToeCfvaYcx4Wh/Dx61jMrCUFQT/qhHFCE0ode6Mo=; fh=s4kTJuGDw6boQYlDYt310QNoxls4KEx9sfomJ0cGWgA=; b=W4UhNGmuZrz9+YyXQWHraLIsPpXSMKOjerOskYDVIWsaQ1cLD4yeoG+mzSxnOc3lE3 pZqQb8+aXENX/s9Ney/FNOdU+DlRW+DPajEDhnh5fWxKJsKEJ6xoKiXOdmFU7YcyzPEv Wp4FBJ6XRo3G16Leymh3jh7BOBR4S/Hr/lXRfD8GJHhGBRyKtcr7YYTrO39ofJqi4exu Dg4FPy5ucHQ/INV7H+044KHqsX5BsCUfZZrUaMyWmlsOecqODJFt5M4/grpw8n2kReWF PvWPN3pssGujkAvxjyHNX3tqHKQYxmh5g9+1T/mAZOZ+mDGK2JwlnNQEr8tZb1jBmT4Q u5qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z18-20020a170903019200b001b8a70d11e4si4731154plg.529.2023.09.22.12.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 12:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5AD358077925; Fri, 22 Sep 2023 11:45:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233559AbjIVSpQ (ORCPT + 99 others); Fri, 22 Sep 2023 14:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbjIVSpO (ORCPT ); Fri, 22 Sep 2023 14:45:14 -0400 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05EF6AB; Fri, 22 Sep 2023 11:45:09 -0700 (PDT) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1bf5c314a57so21419115ad.1; Fri, 22 Sep 2023 11:45:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695408308; x=1696013108; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=atbToeCfvaYcx4Wh/Dx61jMrCUFQT/qhHFCE0ode6Mo=; b=APSFFRDv4VBfuWYT7rhjPgpigYu8GvZw0OInTiCO62ALGNjCKEqMVtERbEAK1MozTY 1kTcUaIpoijDwClUgbOytwcJBFY4bYWZLfBe9DKV0MGge25Vvo/N6aqJH+CQyuH4n8pT hEdO+NlNsjg6Pn8pSgZUc+SfWyj97qTj4OES4OWychlgclOq9+P8n2R/O3Uezggkjwjr 0pKi3iHrvqNVglgQ0ByJcoqyALkd9WrI0roh3svEztftPGqu70ZGDaqnfsWJ0Nt+Yw7E Ye6yfNO9P/Ob5HT6+4DWT60Q+iZlMovJYM4FpB2jD70NBODEalnNR9HN9dLOu0to0RcG SGUw== X-Gm-Message-State: AOJu0YxgLh72yGDHAciBezE7gm18VfviYxZaIZ0QZEybfFuSthjWIggT ZOAN4UOat0s31SYlHy/amFbxu+CDh9w= X-Received: by 2002:a17:903:41c3:b0:1c5:70d3:f193 with SMTP id u3-20020a17090341c300b001c570d3f193mr350824ple.10.1695408308401; Fri, 22 Sep 2023 11:45:08 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id iw11-20020a170903044b00b001c582de968dsm3832439plb.72.2023.09.22.11.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:45:07 -0700 (PDT) Date: Fri, 22 Sep 2023 18:44:25 +0000 From: Wei Liu To: Dexuan Cui Cc: Olaf Hering , "linux-hyperv@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , Wei Liu , Arnd Bergmann Subject: Re: [PATCH v1] hyperv: reduce size of ms_hyperv_info Message-ID: References: <20230918160141.23465-1-olaf@aepfle.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 22 Sep 2023 11:45:18 -0700 (PDT) X-Spam-Level: ** On Tue, Sep 19, 2023 at 06:18:53AM +0000, Dexuan Cui wrote: > > From: Olaf Hering > > Sent: Monday, September 18, 2023 9:02 AM > > [...] > > Use the hole prior shared_gpa_boundary to store the result of get_vtl. > > This reduces the size by 8 bytes. > > [...] > > --- a/include/asm-generic/mshyperv.h > > +++ b/include/asm-generic/mshyperv.h > > @@ -53,8 +53,8 @@ struct ms_hyperv_info { > > u32 reserved_b2 : 20; > > }; > > }; > > - u64 shared_gpa_boundary; > > u8 vtl; > > + u64 shared_gpa_boundary; > > }; > > extern struct ms_hyperv_info ms_hyperv; > > extern bool hv_nested; > > How about moving the 'vtl' field to an even earlier place: > > --- a/include/asm-generic/mshyperv.h > +++ b/include/asm-generic/mshyperv.h > @@ -36,6 +36,9 @@ struct ms_hyperv_info { > u32 nested_features; > u32 max_vp_index; > u32 max_lp_index; > + > + u8 vtl; > + > union { > u32 isolation_config_a; > struct { > @@ -54,7 +57,6 @@ struct ms_hyperv_info { > }; > }; > u64 shared_gpa_boundary; > - u8 vtl; > }; > extern struct ms_hyperv_info ms_hyperv; > extern bool hv_nested; > > This also reduces the size by 8 bytes, and keeps > the isolation_config_a/ isolation_config_b/ shared_gpa_boundary > together, which are related. Either method works for me. Will there be a v2 of this patch? Thanks, Wei.