Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4510560pxv; Tue, 29 Jun 2021 08:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEV3AfraQtIsN+rRBu1RvDh6gr/Cvx041Aoa2fu5Unp1GS3+bhbmy2R5mkbvfFEWyaso0/ X-Received: by 2002:a17:907:9c9:: with SMTP id bx9mr30582960ejc.144.1624981146097; Tue, 29 Jun 2021 08:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624981146; cv=none; d=google.com; s=arc-20160816; b=ixbwGuQ9d3KhOuOQQW5iJFp8qcIbGypx/dUWjnY5GdHn6NnnYcMn9Scv5A69XdZxho 06jn+R5EiaOjpR1g+1eIftE3BkI2ijJGaWxtf9K1X6LNRdT4eHCAYTWyKxcrV23iGHOl 0+7y2ekEMv/UFc8tburF+fANiMd8pW4iBfOPy1HBlqlAGt/aRF+cMbxODv+3sOh4kVPD 23il5uIWQ7p8k+Ckc3JcOEnxyUuwSTFc3NAnSHDLtp8XmXHILsEVq9y2oMzffPtjJZq+ yUWFsUta5PGwLyHoOquvGuQWcyQEBLFwndHfbKgGoRhAef9k6pRf3h9H1d4rikC4Q1ae oCMA== 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=c09axMTOtUdFn084x7QGWCEjh23Bflph50dJnZAUCI0=; b=KlEwt85xjwknJenor17FQ+fIKaUPnhkoqSP7i3xeMZvlxnLNc00TXmnH1ttowO3zze RzFOqd6A/OIi4WT3g32ixW/cLGk4ulYrls9Jm7EKsSK0bQ/dOVMtyrqkCqZZsJDat8rd ky1kWVJy7mbzaSABz7xG2es5jqYj42o6S3aHmPfLGQFpK3Q7MEo5YeW+EZSKXvDQCSv5 DHBlEGUwAMjrr8q670pvrU5XfJEzhItzWA9p80KcKBHj4UC7mLUWh3c32pdOH4TNRRI3 bPs0GhCrNIiyai6Z1RE/QtBoAhzR+wSi2AYwoDvB62MhkZj3r6tyoC323blK04nHM/EW acuQ== 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 kb6si7627114ejb.648.2021.06.29.08.38.38; Tue, 29 Jun 2021 08:39:06 -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 S233073AbhF2M5u (ORCPT + 99 others); Tue, 29 Jun 2021 08:57:50 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:33505 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232755AbhF2M5t (ORCPT ); Tue, 29 Jun 2021 08:57:49 -0400 Received: by mail-wr1-f42.google.com with SMTP id i8so3472721wrc.0; Tue, 29 Jun 2021 05:55:22 -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=c09axMTOtUdFn084x7QGWCEjh23Bflph50dJnZAUCI0=; b=slEgNLX32Gtn0HQJRsK2VF1t3q8blkraSpk+awmESrCN9xUQ1DxLn71QewjGTB1ekr N3fGLOwpZX8cu2zujCDcLni2+yhxVjq/5At/3TKoHxwPUTYl19D2L6kv6zian2ZIbfAA lHAMSaUDouC9bXKOutFoKsePdwdaikPDw3Rz/RdULqG28jQZbhQXdN5+ZRILboiBYQRf MO2Qh6qZhGOisYhr2ihmSDXB6vx8Pfi3SQTnJXRgCQb7Yekg1ScxAxwavADMmLOWQT60 pGJscRNOYY3I8Gf71yE+7C4ywLTF+qoF542RIzUu9UKZu+m2V6cp7I/ZdD1zkDI9oIOj Wepg== X-Gm-Message-State: AOAM531G3aO0KlV1SwtylTMDs2k4CUWxD69sxtFAClc5yDk8sDiwOdJV iSKqx+k+5DsnKLtIw4J/FHw= X-Received: by 2002:a5d:6a8b:: with SMTP id s11mr33418683wru.88.1624971321866; Tue, 29 Jun 2021 05:55:21 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id p5sm19411722wrd.25.2021.06.29.05.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 05:55:21 -0700 (PDT) Date: Tue, 29 Jun 2021 12:55:19 +0000 From: Wei Liu To: Vitaly Kuznetsov Cc: Vineeth Pillai , Nuno Das Neves , Wei Liu , Sunil Muthuswamy , Michael Kelley , "K. Y. Srinivasan" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 06/17] mshv: SynIC port and connection hypercalls Message-ID: <20210629125519.27vv3afwhjoobekf@liuwe-devbox-debian-v2> References: <3125953aae8e7950a6da4c311ef163b79d6fb6b3.1622654100.git.viremana@linux.microsoft.com> <87v96lykrz.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v96lykrz.fsf@vitty.brq.redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 02:19:28PM +0200, Vitaly Kuznetsov wrote: > Vineeth Pillai writes: > > > Hyper-V enables inter-partition communication through the port and > > connection constructs. More details about ports and connections in > > TLFS chapter 11. > > > > Implement hypercalls related to ports and connections for enabling > > inter-partiion communication. > > > > Signed-off-by: Vineeth Pillai > > --- > > drivers/hv/hv_call.c | 161 +++++++++++++++++++++++++ > > drivers/hv/mshv.h | 12 ++ > > include/asm-generic/hyperv-tlfs.h | 55 +++++++++ > > include/linux/hyperv.h | 9 -- > > include/uapi/asm-generic/hyperv-tlfs.h | 76 ++++++++++++ > > 5 files changed, 304 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/hv/hv_call.c b/drivers/hv/hv_call.c > > index 025d4e2b892f..57db3a8ac94a 100644 > > --- a/drivers/hv/hv_call.c > > +++ b/drivers/hv/hv_call.c > > @@ -742,3 +742,164 @@ int hv_call_translate_virtual_address( > > return hv_status_to_errno(status); > > } > > > > + > > +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); > > + status = hv_do_hypercall(HVCALL_CREATE_PORT, input, > > + NULL) & HV_HYPERCALL_RESULT_MASK; > > + local_irq_restore(flags); > > + if (status == HV_STATUS_SUCCESS) > > + break; > > + > > + if (status != HV_STATUS_INSUFFICIENT_MEMORY) { > > + pr_err("%s: %s\n", > > + __func__, hv_status_to_string(status)); > > + ret = -hv_status_to_errno(status); > > In Nuno's "x86/hyperv: convert hyperv statuses to linux error codes" > patch, hv_status_to_errno() already returns negatives: Yes, this needs to be fixed otherwise one of the following patch has the error handling check reversed. Wei.