From: Brijesh Singh Subject: Re: [PATCH v5 5/5] x86/kvm: Avoid dynamic allocation of pvclock data when SEV is active Date: Thu, 6 Sep 2018 22:57:16 -0500 Message-ID: References: <1536234182-2809-1-git-send-email-brijesh.singh@amd.com> <1536234182-2809-6-git-send-email-brijesh.singh@amd.com> <20180906140738.GA370@linux.intel.com> <9b7ba5a6-5b2d-206d-46f0-32e0dbd2af70@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Tom Lendacky , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= To: Sean Christopherson Return-path: In-Reply-To: <9b7ba5a6-5b2d-206d-46f0-32e0dbd2af70@amd.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 9/6/18 1:50 PM, Brijesh Singh wrote: ... >> >> #define HVC_DECRYPTED_ARRAY_SIZE  \ >>     PAGE_ALIGN((NR_CPUS - HVC_BOOT_ARRAY_SIZE) * \ >>            sizeof(struct pvclock_vsyscall_time_info)) >> > Since the hv_clock_aux array will have NR_CPUS elements hence the following definition is all we need. #ifdef CONFIG_AMD_MEM_ENCRYPT static struct pvclock_vsyscall_time_info                             hv_clock_aux[NR_CPUS] __decrypted_aux; #endif > Sure works for me. > >>> +static struct pvclock_vsyscall_time_info >>> +            hv_clock_dec[HVC_DECRYPTED_ARRAY_SIZE] >>> __decrypted_hvclock; >>> +