Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3207313pxv; Mon, 12 Jul 2021 11:52:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYSD6OU7dw5KVkq57VForpOhAp47Oi34yNBek0jFodc9a0aQx7ofopYILWfdc/khBIv4BV X-Received: by 2002:a17:907:7887:: with SMTP id ku7mr586559ejc.102.1626115961486; Mon, 12 Jul 2021 11:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626115961; cv=none; d=google.com; s=arc-20160816; b=iZTCsOAhAqBSJIW9btV1MbyREQYTMnLqpSEEz3kvfqa9UKqG7iKJUMf2JQEDpcuVV6 WKMAzNkfa0T1zXQMdNb5d0pF9I5br+Dp1o+6PcGse3krNrPoW66993nsVcy83l+75XK8 2iEdvbMMg7AM96iPXpYBsd03CDo8JZ5R6tmjptlusXZi6MHffzLer+XJ3ZtqbJou753h iPTHfOrbKxlnX2hmjeWOTu1SerifgTu00kDjUT+Piyl/9Fv/cIy51546SDNcgDUhze4V q8trlvmFE9Ypw5qh3hog3g3ig6xeN6gsSN8hj9v86ftewIPjDSHX0Br/ns9RepsMRZ6Q lhJw== 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=q5+8/I2xuFzJHMxWB2HAAJNVN0cTcc2X0j3gTSMtEos=; b=sSFLNR5EI+Dl48MXyMEOtwotvH62aljt/B6hAYHkgSKv7HzI/TLUI3jivmHZsdbecC KsVNK/nZIBCQ24Xi11TzpxM0Jikq9pvff7y07GM4ar30GSJl1oDr79W+kRvHfCUiAuyL vpX1KSbZ75B8aj1lx12YXKcXk9o9Ij9Zwj0n8bnIrNZf/l5w4gB7sBeqgsOwx5Mtgf6X ZyiztpN0KOZ/K9dNXIULkKOWGFigWNjKOJJkRgHjoLtXaLuqGPSaNQfBsZnyvz1o0eB1 8WqVd6/c1C5L9BMf78uZsQ4453o8lbfBG1alwReGUhCuwglHLCPNPy0GyVmfFFwVcfqe gUxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si3344716eje.404.2021.07.12.11.52.18; Mon, 12 Jul 2021 11:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235973AbhGLSyA (ORCPT + 99 others); Mon, 12 Jul 2021 14:54:00 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:43641 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbhGLSx7 (ORCPT ); Mon, 12 Jul 2021 14:53:59 -0400 Received: by mail-wr1-f48.google.com with SMTP id a13so26972072wrf.10; Mon, 12 Jul 2021 11:51:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=q5+8/I2xuFzJHMxWB2HAAJNVN0cTcc2X0j3gTSMtEos=; b=Ju7PgHJxykQPSMAXpwq2MFXhdCTsYJ9XgKJ6NfzrvFpjsPBYfi2QyN70BH+XvnHM5A /+Ad9CSoUqILSmUQzjR6u8kqYUmaKONRlDkvTubVFOQbCNG0V9r9C8oJQsFl834yfCcL jzFNSY1drd87jZ8iyVNQuNAL7T7tLC7gr+e86A5yiPuVHKjUchHTvLPGGRp07FxRJ34R o8ty4ljZdLC6RDqPGZ8nFOkvglWkEVAxxtqtKVJ+H8LjAb4i0XIr+J+Im9dPjzB4Fx+d Bibldbo3pGrVpWfQ4HG5UWsqEhDTNRT1tM2WE0SPkHySLd+58H+4Kj2MkF8BhJZb8j5f /BnA== X-Gm-Message-State: AOAM5320zL0a45MjoqCmTl2RAEwCqsfRzUbYmfXY6eaWD145pO6k/umL mmNjMQt7LEXrwVKrxrhv75U= X-Received: by 2002:a05:6000:136a:: with SMTP id q10mr498157wrz.25.1626115869811; Mon, 12 Jul 2021 11:51:09 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id 11sm248292wmo.10.2021.07.12.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 11:51:09 -0700 (PDT) Date: Mon, 12 Jul 2021 18:51:07 +0000 From: Wei Liu To: Michael Kelley Cc: Wei Liu , Stephen Hemminger , KY Srinivasan , Dexuan Cui , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "x86@kernel.org" , "hpa@zytor.com" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-arch@vger.kernel.org" Subject: Re: [PATCH 1/3] Drivers: hv: Make portions of Hyper-V init code be arch neutral Message-ID: <20210712185107.vgm2qyltftzmfua7@liuwe-devbox-debian-v2> References: <1626060316-2398-1-git-send-email-mikelley@microsoft.com> <1626060316-2398-2-git-send-email-mikelley@microsoft.com> <20210712182400.yze3wochnyccaflw@liuwe-devbox-debian-v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 12, 2021 at 06:41:21PM +0000, Michael Kelley wrote: > From: Wei Liu Sent: Monday, July 12, 2021 11:24 AM > > > > On Sun, Jul 11, 2021 at 08:25:14PM -0700, Michael Kelley wrote: > > [...] > > > +int hv_common_cpu_init(unsigned int cpu) > > > +{ > > > + void **inputarg, **outputarg; > > > + u64 msr_vp_index; > > > + gfp_t flags; > > > + int pgcount = hv_root_partition ? 2 : 1; > > > + > > > + /* hv_cpu_init() can be called with IRQs disabled from hv_resume() */ > > > + flags = irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL; > > > + > > > + inputarg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); > > > + *inputarg = kmalloc(pgcount * HV_HYP_PAGE_SIZE, flags); > > > > This is changed from alloc_pages to kmalloc. Does it ensure the > > alignment is still correct? > > > > Wei. > > It does. The alignment guarantee made by kmalloc() was changed a > couple of years ago. See commit 59bb47985c1d. Here's the current text > from the comments preceding kmalloc(): > > * The allocated object address is aligned to at least ARCH_KMALLOC_MINALIGN > * bytes. For @size of power of two bytes, the alignment is also guaranteed > * to be at least to the size. OK. That's good. Wei. > > Michael >