Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp398478pxv; Wed, 30 Jun 2021 08:05:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVHm+OlGsjf2XZsH31OeBIMjUVCDlaf+2/zOtunlQZDHvPVoyInzpA5Kg0gTaEDuBT8AMn X-Received: by 2002:a17:906:c408:: with SMTP id u8mr8938084ejz.519.1625065538430; Wed, 30 Jun 2021 08:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625065538; cv=none; d=google.com; s=arc-20160816; b=oYLHCdTfgNzN96DwjfzQeGyLKIwX2WqMA6GGBUEhesFuBC7fnYKkIRJlPZGMLHQrWN xGiy+BeQXBQhI9wE2huEZKNc0/JSpktObGOskGWouOMa6hMO7b59CxJYskkiFuaYQ5lY Ih/9DTJVxmvHaj997Zg9qUwpQiIzGx/CJ14B5GaulDb0ttsJYLJVMPwwF3nkkPLKZ+yD b/RjW+1fNxT5NkZn3l1v0b2uuFO6vM+5it3DiM7UekIwyum4lJIkkuHLQSJqATJKkAKN hpjGyoGOoATst4fXWnFPQsrshvtljoNxXhhSS3WqqriLDftCU+GVh9PACx7RESfzoaZS 63rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=1A02Vb1b0hWl2fsJJswCKDtOOcqlivyCit8PUhlwAU4=; b=JEUc9giFfVkpTVUbMRfBIPUrDZBPT3C+ZlHY2sFD3Ty1dVZx6jjV85senxC5ZKTz0X lWsjXKNPhDzHK7eWowzNVVDaAbaVL8bZ8fHPlDrOJRh6gQgjgHXPl4V090ursFTYmOC5 obh1xz/RWtij2mNaVfwW24gbyuMiRm3444e2kLr4kPdGlpeSD4Z1rEGtIe9TOPFrTk8D 4wRaVKAVUGEH+tFYXEsp3qm76b6DJz1XcAroYPoE1v0dhXiwd4Pt60dDE3LZZuP3U6LP oNN3SVkgNcGlCltxmMkOi8DCMR3Q6Zw96USJf2cpiBmG8Kg560OiQJUWDDzudtZgAlU3 1Jkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Go8xRQTH; 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 23si21725398ejg.6.2021.06.30.08.05.13; Wed, 30 Jun 2021 08:05:38 -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=Go8xRQTH; 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 S235837AbhF3PFd (ORCPT + 99 others); Wed, 30 Jun 2021 11:05:33 -0400 Received: from linux.microsoft.com ([13.77.154.182]:45646 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235534AbhF3PFc (ORCPT ); Wed, 30 Jun 2021 11:05:32 -0400 Received: from [192.168.86.23] (c-73-38-52-84.hsd1.vt.comcast.net [73.38.52.84]) by linux.microsoft.com (Postfix) with ESMTPSA id 17B5220B7188; Wed, 30 Jun 2021 08:03:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 17B5220B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1625065383; bh=1A02Vb1b0hWl2fsJJswCKDtOOcqlivyCit8PUhlwAU4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Go8xRQTHsSWhZIKZ1FtjNlG7k3rULbb589ryayPmFbnQFelG5VYc86izQWQaCd1+N z7o7C3aV9S1sKGMFeVAewa9ntrbeX+SfuoeeB5xM+Y4Y+OMI3pyqHy8VeIO3vYih6G FszfrRg+vL0jjL/nzoJipPaRcQ1zx0Ardlhn2Jdc= Subject: Re: [PATCH 06/17] mshv: SynIC port and connection hypercalls To: Wei Liu Cc: Nuno Das Neves , Sunil Muthuswamy , Michael Kelley , Vitaly Kuznetsov , "K. Y. Srinivasan" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org References: <3125953aae8e7950a6da4c311ef163b79d6fb6b3.1622654100.git.viremana@linux.microsoft.com> <20210630111048.xn3gbht33inx2luh@liuwe-devbox-debian-v2> From: Vineeth Pillai Message-ID: <50df2b12-18a6-8a11-f57a-d1e4bc04e9cd@linux.microsoft.com> Date: Wed, 30 Jun 2021 11:03:05 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630111048.xn3gbht33inx2luh@liuwe-devbox-debian-v2> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> + >> +int >> +hv_call_create_port(u64 port_partition_id, union hv_port_id port_id, >> + u64 connection_partition_id, >> + struct hv_port_info *port_info, >> + u8 port_vtl, u8 min_connection_vtl, int node) >> +{ >> + struct hv_create_port *input; >> + unsigned long flags; >> + int ret = 0; >> + int status; >> + >> + do { >> + local_irq_save(flags); >> + input = (struct hv_create_port *)(*this_cpu_ptr( >> + hyperv_pcpu_input_arg)); >> + memset(input, 0, sizeof(*input)); >> + >> + input->port_partition_id = port_partition_id; >> + input->port_id = port_id; >> + input->connection_partition_id = connection_partition_id; >> + input->port_info = *port_info; >> + input->port_vtl = port_vtl; >> + input->min_connection_vtl = min_connection_vtl; >> + input->proximity_domain_info = >> + numa_node_to_proximity_domain_info(node); > This misses the check for NUMA_NO_NODE, so does the function for port > connection (see below). > > I think it would actually be better to leave the check in > numa_node_to_proximity_domain_info to avoid problems like this. > > Of course, adapting this approach means some call sites for that > function will need to be changed too. Thanks for catching this and fixing Wei, will roll it into my branch. ~Vineeth > > ---8<--- > >From 8705857c62b3e5f13d415736ca8b508c22e3f5ba Mon Sep 17 00:00:00 2001 > From: Wei Liu > Date: Wed, 30 Jun 2021 11:08:31 +0000 > Subject: [PATCH] numa_node_to_proximity_domain_info should cope with > NUMA_NO_NODE > > Signed-off-by: Wei Liu > --- > include/asm-generic/mshyperv.h | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h > index d9b91b8f63c8..44552b7a02ef 100644 > --- a/include/asm-generic/mshyperv.h > +++ b/include/asm-generic/mshyperv.h > @@ -31,10 +31,14 @@ 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; > + proximity_domain_info.as_uint64 = 0; > + > + if (node != NUMA_NO_NODE) { > + 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; > }