Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1428050rwb; Thu, 10 Nov 2022 16:20:14 -0800 (PST) X-Google-Smtp-Source: AMsMyM6st9ATwDYIXstoL81ZsldZdXHuq/WoMmRxx2+kOhhJ1Wixv+CFTzz6cPJjmDPBarB1Polr X-Received: by 2002:aa7:da13:0:b0:460:9994:1b9b with SMTP id r19-20020aa7da13000000b0046099941b9bmr3822985eds.155.1668126014516; Thu, 10 Nov 2022 16:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668126014; cv=none; d=google.com; s=arc-20160816; b=tk3rnwJYbicl1QUU7cjn9X2tL8Hm+oYTjfz9FAAtQD2rtDrWAIyT/GLgiFu5w0DVHc 0piAc6jl9CUitDSh1uO1IBkRbnurGOA/+LhvyH2cCZKn5pQYaCnmKb3Nvrdf5XdRhn95 vlXtJArmmVJrxzwguap88VfUPOr2AIOyMLSwQAizfr60nCr8TMLcWhedtmJFN1QzmN8Y BI+0E/stL1ZMeFPPfYmVV6HewOtEVcHJLjTU+MQRe4IJwTkX+/2aji6fVj2Kk2zvkDMX HIml2wjIbaHVkki/rKEFUS4ZVb+byEC01enq8gB9RCt9MrbHAsHrvusPBitHuX8h8x5i BwKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8PHwJILADgwdipE7zP40ijyqZwmjfhC7ELa8FFACbUY=; b=i0U+s7t48KnXMOMWkhnuhwCezY02DbsaZRFAcjxh5jfGKftkkKkhjju0ZO/o+lYbSu +Ng56U9ljg3s7LJUM2urN85pmsSmH6W3ZV4xxfwUyRTuQANLT/+AL17k1r+2a8N+oBGr mYyqoSSpCPAjHK7OBtDFVWNSxaN4dE0Xu7tZsiUywYcNiyiGjZ38yLxWAJGdqMsRjjq9 KU5vy/OBo/gIAVKznraohiSOHWL0F6kUgaeVAhpISOAkoPGVDKvlxB0Q5U8W36/DRSva eeuj755g74K/DrlPlCKweoeSbTDlkaw31/yEMBePwrPgA9404TtzT/2V0byNJR2yK2r2 kAMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=oJFv2GwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a17090636cb00b007a44a13536bsi545221ejc.243.2022.11.10.16.19.52; Thu, 10 Nov 2022 16:20:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=oJFv2GwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231659AbiKKADh (ORCPT + 92 others); Thu, 10 Nov 2022 19:03:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiKKADg (ORCPT ); Thu, 10 Nov 2022 19:03:36 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6D0C49B52; Thu, 10 Nov 2022 16:03:34 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AANU1EL005940; Fri, 11 Nov 2022 00:03:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=8PHwJILADgwdipE7zP40ijyqZwmjfhC7ELa8FFACbUY=; b=oJFv2GwLODupXfH93b/oGPNuDP8hYUem34OBFCcLWOVTfxymMzA+zpND2K01FvGZyGpH BT0A92MrTD5h8zeh/lk4bhiIzMJPltrdB8yhvyw5+laay01nl+disbCIHsTB4zMBBcd4 EJi9DHCbtEeTcsApWSwPjdq/AyN0drnD62nOBj4qwKsgO+hmiAkkl7J32wvG95Ohhipx DD2YualjKP/6T4PZixQO6SHVFvM57tdYT035zM8OAWJgfpPUURkd40ChMmI/ik7uME24 Z0K6TBBRv0TAyjXYuuW2hpSt24Qp0lECEuhgqkqvu8mAgaXTe1lNpyT1MyCicnkyCmEy Pw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ksahhg2ym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 00:03:13 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2AB03BAk031092 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 00:03:11 GMT Received: from [10.110.39.85] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 10 Nov 2022 16:03:10 -0800 Message-ID: <543d95f8-be31-7553-4700-5dc04872e8ea@quicinc.com> Date: Thu, 10 Nov 2022 16:03:10 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v6 13/21] gunyah: vm_mgr: Introduce basic VM Manager Content-Language: en-US To: Trilok Soni , Arnd Bergmann , "Greg Kroah-Hartman" CC: Bjorn Andersson , Murali Nalajala , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Dmitry Baryshkov , Jassi Brar , , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , "Will Deacon" , Catalin Marinas , "Srinivas Kandagatla" , Amol Maheshwari , Kalle Valo , , , , References: <20221026185846.3983888-1-quic_eberman@quicinc.com> <20221026185846.3983888-14-quic_eberman@quicinc.com> <722b05a1-4bf5-0837-baea-b1d0a9cc1e43@quicinc.com> <96238455-73b6-bead-0fdb-55ca68e5bf0b@quicinc.com> <9dd597d9-a3f3-48f2-8416-b5b097a230d5@app.fastmail.com> <980db147-794e-ecd9-9626-64ff81109bab@quicinc.com> <95a9f253-984a-14e0-7e01-f168452576c4@quicinc.com> From: Elliot Berman In-Reply-To: <95a9f253-984a-14e0-7e01-f168452576c4@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Z_I6qo3MRu1stJfpFb1gxi7dMmaGmUYD X-Proofpoint-ORIG-GUID: Z_I6qo3MRu1stJfpFb1gxi7dMmaGmUYD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-10_14,2022-11-09_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211100166 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Greg, On 11/4/2022 9:19 PM, Trilok Soni wrote: > On 11/4/2022 3:38 PM, Elliot Berman wrote: >> >> >> On 11/4/2022 1:10 AM, Arnd Bergmann wrote: >>> On Fri, Nov 4, 2022, at 01:11, Elliot Berman wrote: >>>> On 11/2/2022 5:24 PM, Greg Kroah-Hartman wrote: >>>>> On Wed, Nov 02, 2022 at 11:45:12AM -0700, Elliot Berman wrote: >>>>> >>>>> Even if you don't support it 1:1, at least for the ones that are the >>>>> same thing, pick the same numbers as that's a nicer thing to do, >>>>> right? >>>>> >>>> >>>> Does same thing == interpretation of arguments is the same? For >>>> instance, GH_CREATE_VM and KVM_CREATE_VM interpret the arguments >>>> differently. Same for KVM_SET_USERSPACE_MEMORY. The high level >>>> functionality should be similar for most all hypervisors since they >>>> will >>>> all support creating a VM and probably sharing memory with that VM. The >>>> arguments for that will necessarily look similar, but they will >>>> probably >>>> be subtly different because the hypervisors support different features. >>> >>> I think in the ideal case, you should make the arguments and the >>> command codes the same for any command where that is possible. If >>> you come across a command that is shared with KVM but just needs >>> another flag, that would involve coordinating with the KVM maintainers >>> about sharing the definition so the same flag does not get reused >>> in an incompatible way. >>> >> >> I think the converse also needs to be true; KVM would need to check that >> new flags don't get used in some incompatible way with Gunyah, even if >> one of us is just -EINVAL'ing. I don't think Gunyah and KVM should be >> reliant on the other reviewing shared ioctls. >> >> The problem is a bit worse because "machine type" is architecture- >> dependent whereas the planned Gunyah flags are architecture-independent. >> KVM within itself re-uses flags between architectures so Gunyah would >> need to reserve some flags from all architectures that KVM supports. > > I agree w/ Elliot. We would like to keep Gunyah independent and not rely > on the existing KVM ioctls space. We should allow new hypervisor drivers > interfaces addition in Linux kernel without them relying on KVM. > >> >>> For commands that cannot fit into the existing definition, there >>> should be a different command code, using your own namespace and >>> not the 0xAE block that KVM has. It still makes sense to follow >>> the argument structure roughly here, unless there is a technical >>> reason for making it different. >>> >>>> I don't think userspace that supports both KVM and Gunyah will benefit >>>> much from re-using the same numbers since those re-used ioctl calls >>>> still need to sit within the context of a Gunyah VM. >>> >>> One immediate benefit is for tools that work on running processes, >>> such as strace, gdb or qemu-user. If they encounter a known command, >>> they can correctly display the arguments etc. >>> >> >> We can update these tools and anyway there will be different ioctls to >> get started. There are important ioctls that wouldn't be correctly >> displayed off the bat anyway; work would need to be done to support the >> Gunyah ioctls either way. Whereas tooling update is temporary, the >> coupling of KVM and Gunyah ioctls would be permanent. > > Agree, tools can be updated and that is the easy part as we grow the s/w > stack around Gunyah in userspace, like we already do w/ CrosVM (Virtual > Machine Manager) and QEMU will be next followed by rust-vmm. All of them > can be done without Gunyah ioctls relying anything on the KVM ioctls. > Elliot has also explained very well that we don't to go to KVM > maintainers for any of our additions and we also don't want them to come > to us, since there is no interoperability testing. It is best that both > Hypervisors and their Linux interfaces evolve independently. Are above explanations reasonable to not re-use KVM ioctl numbers? Thanks, Elliot