Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp749259pxj; Wed, 2 Jun 2021 10:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfZBi8EudP5BfZbFNY6gh0yhOlsuZaT7xSUzjAuls/cLhxu5NlEUGUF5SiJiziz120Any/ X-Received: by 2002:aa7:cd77:: with SMTP id ca23mr39499949edb.378.1622654695523; Wed, 02 Jun 2021 10:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622654695; cv=none; d=google.com; s=arc-20160816; b=SWuz0KkxpJMMb1PqbJ0c6mc/W0MDj6Nc3XglR1L68Nf1Vm+Ho4x/LUn4Xgcp45mj6X q6X4TBSLkjELFWD10FtMKUZmK5LEF0BhXuttiP4GfZx+e3kYC2hnZtZoNu4I5SPuTHbB ms9WB+Ky24Sn0t0FloNCyCfyKUm76CXhmoX6ZUBkPFcM54g/OJSsO9himuTOqcLbbFK3 oPSthXIehEebGxHZbyc8QMXEdekzluoTFy/vlyo0zGHxkPupAy860rNTxv7GFYg788SC z56TJ7pF409CNL+fA37CWNsRmt4+M/uR4VMVdLS5jSoV9lRgw66m8wd/nmr3axWQTjUC bAcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=/qyyPfDhCSOvSSJ4ytAjJIJ/ZobYwNoLWEJybKLalzw=; b=phBJw17J3CUJbVwANlnOeuNe69flT81ZNNdGsbvcGbIXZp0O52ICENMWsj1r/N1Re6 uiyEdm1eGBHcjeh2L6KSHhLNzMWSTHRTKZJk4MR9tjzpwBwqqdqcL7/CNQnlQ4Jyq5Jc lifeccoZUXxB/cBwToGp1AxKn2Ce2mARlIoNzaP9egGFL7LyK2Rn5vwpPOBW72Bcx4r2 8zTjT5X4bWlgNK9ovwR0ZTrZHA/9J24hrD9YPnNk05kZcFEn+4m8fAPKGvaaNkwfaHdm xVQ8GWdNeZPWwC0dOUFFbvCeYSRo3St0DW791y9FkDZcNhtp+s9PwYbe15wOg/gERU8F 148A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jPaRonM9; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si348605ejc.105.2021.06.02.10.24.31; Wed, 02 Jun 2021 10:24:55 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jPaRonM9; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbhFBRXD (ORCPT + 99 others); Wed, 2 Jun 2021 13:23:03 -0400 Received: from linux.microsoft.com ([13.77.154.182]:51132 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbhFBRWy (ORCPT ); Wed, 2 Jun 2021 13:22:54 -0400 Received: from viremana-dev.fwjladdvyuiujdukmejncen4mf.xx.internal.cloudapp.net (unknown [13.66.132.26]) by linux.microsoft.com (Postfix) with ESMTPSA id 2588F20B800A; Wed, 2 Jun 2021 10:21:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2588F20B800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1622654471; bh=/qyyPfDhCSOvSSJ4ytAjJIJ/ZobYwNoLWEJybKLalzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPaRonM9ubP64S0+h09D7nQRSwwnsWRVmHeFHfY/cjxNmTNcxSUax0XofmwIlDla3 phnOL45EIEc7nIbSUDy46rGUbQUV0pBUdYMvT1YvpK/rxQhAm7Rzt/jUmMHl0EtlaQ 8cUFmrJ+Zqrm6mjVghtN+crfDmYQ8CI9FyvwlqfM= From: Vineeth Pillai To: Nuno Das Neves , Wei Liu , Sunil Muthuswamy , Michael Kelley , Vitaly Kuznetsov Cc: Vineeth Pillai , "K. Y. Srinivasan" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 04/17] hyperv: Wrapper for setting proximity_domain_info Date: Wed, 2 Jun 2021 17:20:49 +0000 Message-Id: <59b4e5f5d9568960ef4f3e07b98d3cc0d4f855f9.1622654100.git.viremana@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor the code to populate proximity_domain_info from numa node as a wrapper function. This wrapper is needed in future patches in this series. No intended change in functionality. Signed-off-by: Vineeth Pillai --- arch/x86/hyperv/hv_proc.c | 15 ++++----------- include/asm-generic/mshyperv.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/arch/x86/hyperv/hv_proc.c b/arch/x86/hyperv/hv_proc.c index ec9b0c69603e..30c88f1ec558 100644 --- a/arch/x86/hyperv/hv_proc.c +++ b/arch/x86/hyperv/hv_proc.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -146,7 +145,6 @@ int hv_call_add_logical_proc(int node, u32 lp_index, u32 apic_id) u64 status; unsigned long flags; int ret = HV_STATUS_SUCCESS; - int pxm = node_to_pxm(node); /* * When adding a logical processor, the hypervisor may return @@ -163,10 +161,8 @@ int hv_call_add_logical_proc(int node, u32 lp_index, u32 apic_id) input->lp_index = lp_index; input->apic_id = apic_id; input->flags = 0; - input->proximity_domain_info.domain_id = pxm; - input->proximity_domain_info.flags.reserved = 0; - input->proximity_domain_info.flags.proximity_info_valid = 1; - input->proximity_domain_info.flags.proximity_preferred = 1; + input->proximity_domain_info = + numa_node_to_proximity_domain_info(node); status = hv_do_hypercall(HVCALL_ADD_LOGICAL_PROCESSOR, input, output); local_irq_restore(flags); @@ -191,7 +187,6 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags) u64 status; unsigned long irq_flags; int ret = HV_STATUS_SUCCESS; - int pxm = node_to_pxm(node); /* Root VPs don't seem to need pages deposited */ if (partition_id != hv_current_partition_id) { @@ -211,10 +206,8 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags) input->flags = flags; input->subnode_type = HvSubnodeAny; if (node != NUMA_NO_NODE) { - input->proximity_domain_info.domain_id = pxm; - input->proximity_domain_info.flags.reserved = 0; - input->proximity_domain_info.flags.proximity_info_valid = 1; - input->proximity_domain_info.flags.proximity_preferred = 1; + input->proximity_domain_info = + numa_node_to_proximity_domain_info(node); } else { input->proximity_domain_info.as_uint64 = 0; } diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index ec9afca749f0..d9b91b8f63c8 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -21,10 +21,24 @@ #include #include #include +#include #include #include #include +static inline union hv_proximity_domain_info +numa_node_to_proximity_domain_info(int node) +{ + union hv_proximity_domain_info proximity_domain_info; + + proximity_domain_info.domain_id = node_to_pxm(node); + proximity_domain_info.flags.reserved = 0; + proximity_domain_info.flags.proximity_info_valid = 1; + proximity_domain_info.flags.proximity_preferred = 1; + + return proximity_domain_info; +} + struct ms_hyperv_info { u32 features; u32 priv_high; -- 2.25.1