Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp553850rdh; Wed, 14 Feb 2024 05:09:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtKvU1QTgPWp61Y0sU4Cv+eP46wabj9NupbNe8Kl+sajDdT0GoTiuanRlH4ZQlx3Lmv6XLeHgkznquRDm6l39SiGUexKysoGfc20Nw4g== X-Google-Smtp-Source: AGHT+IEyGOk18qN/BNcx81/mj/0nMmObH2XJW8PZQQtWuf+cu9c0m7fdqkoiyaf3oyD1gA2QW/nt X-Received: by 2002:a05:6808:11cc:b0:3c0:383f:2bd9 with SMTP id p12-20020a05680811cc00b003c0383f2bd9mr2415444oiv.56.1707916152286; Wed, 14 Feb 2024 05:09:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707916152; cv=pass; d=google.com; s=arc-20160816; b=vTgCOOj4VzKYkBzy1Ab8zUd68l3rpxCO0mEPz/INjoO1IlklhSCrNtTsTOZDyRvNrl UYnfspZ+jV+A4B86Xw9E09tgMiRPkWHOU7DufjV4N7gMuM+/Xld3jX4v2EHtp7SXnD26 IeI753KCHFcL3KRlhWzTEjxAIAoO8MDhEYW3q9mEVL5Cm0M5YXIi9m2CecmUXfPLYvpY OOo9cTpGREPKskVwCG3U16Q8nuUIdaFPjQ5/Qnu2+aX1D0RHomOCjrmztTvY4d0WrzuF gp/CyyzLZXBbrygIscy3zXDa+9Iz/bbbRACZvKNajihya7IKvWsXYhTHSQRcgbzBJzCw OYyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=i1IDPVYUC2smz1YpfrzYM0GrV0MTF9fMPhCZBn47s0U=; fh=EjKBDNZkv/QI6FqDDSDRAKW2ST4PkHnBVQKt0qPqpP8=; b=Jx0bIdUl0PHdCwz1vFbqQkNhqCxPlndq3KlgQiFm3txz1DknnVcAHJ36ndC5kEnul9 RonQkLjRYUM6fzciY/k22zLBmM/p51zsYq417F9FMqeb8psSxjmjxax+g3nq5rKIvdDK A5eq6R8wH/2qa0Jzr41NrxOtiFWCr3kyA1slan3qFR3llGb2sM1KRQuqWskjH2OhWaER FHEFr6d0q65tSn0EMMoUyNIE3YrpIujp/JxRYNNYm7oatbxplnk1oF2rSNHfyY4kzVgD V5ybyBA+AANEtveolXQgEq69rEqI/bOCc5NbimZW4O8maRZ2tSfr3mtdd7U8f4y/+7cJ mHWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dDYMdqUN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUcL1oPaI0styrPa8Y7h9OdzQpxj5GoXPriOMPlmYV4b7zRsc9QjWAG7qHSU0gNBDbEi78vHMJJnHRfHHODBoFvD+6ctXxbIuwMhFqb+Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cf14-20020a056130114e00b007d921b29412si103917uab.145.2024.02.14.05.09.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 05:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dDYMdqUN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E61251C22060 for ; Wed, 14 Feb 2024 13:09:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6ECC53800; Wed, 14 Feb 2024 13:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dDYMdqUN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8E0A535D3; Wed, 14 Feb 2024 13:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707916129; cv=none; b=o077hodF/iUa+JsCAcrjmUQoj1FPSB++lzBIRSHmEGr9oBrLFDU/cVwqOqQrkotgH3VwjXNADB/z+YSlO2n8SfiDU7ZB/MPdQBJwDWhz9E1KQsFS8VcLIPZpmYQh0eTOHEsfJU6v5T4aoMrCYPHf7eeiG3tvsidTaG9l6iGgzO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707916129; c=relaxed/simple; bh=LJKPHMPjmHlU2PJKYir/2UiQYp8Nni0aZPwyL3+QEQI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jM6bJqdIAwCMYAy1+husjYlqsUVexXOfmm0xBObiM7BQ9fqYzCDcQvYlD2x79rANfRCUBukv4DPOLdK/FjdAtpH1Pj3BOEpsEkSyWOdafgbPDG0itFFwtF8UpvnO/TOREaGqnONYIXPpZUC2ZW45636eTLROIfsFzIYuALa/e8Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dDYMdqUN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6209CC43399; Wed, 14 Feb 2024 13:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707916129; bh=LJKPHMPjmHlU2PJKYir/2UiQYp8Nni0aZPwyL3+QEQI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dDYMdqUNK2cUFdZcoJQdatO9QdalPCDefOYbT/hPddd9+v387BHBT3h29qhAu0vVb w0YvaKZ5ismqqrtF242BRBeoxLSX3yOJzMzHZ7WndxrY3IL8SzUdhpl55H0nLpD4S+ 1n0lj0akqRz1z4YWAK7qavjSBPjRsVSISyTmPX7wYWNP8+wJb5useYbjCMz/1eqEQe 2wToUWXJaH6YJ7znkUNWjouGr7HvqJWnNVoFAQAQlako1Fd2N9jpPJaCXGiXzLb/8K vC992tnsr6s3RvgVFxkTZbOiS8tLD+HzHwjSheJ+leg/ykyv9O9EhqK2cEQrdCrlVC dgg+RStP2PFFw== Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-55a8fd60af0so7319003a12.1; Wed, 14 Feb 2024 05:08:49 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUDjZ+p0ZYgEX5BrAFsHMWoGQl2L+1jYORPzhs0SRreeOdVV+veR+ZQtX9QvAoaOBg7WOTRXxH54hH5P54FO03K/RHxp/aocYFVcNEzkTh2mqYzrthdAcG4ki/GPKNjlV7y X-Gm-Message-State: AOJu0YyJV7786qoznCx+GlEGN8FUcRZEeR0U5Oci29cV9+vwh/0Fzq4N PEE+isQ7baHR9XrCutm4yh6+QPwOQ4BWa+i8/7S7x5hmiuwgkkrnArDP0j5Gv0Upesku3guyezr pomuWPYihGg+yt5bACk2W4fKp5uM= X-Received: by 2002:aa7:d3da:0:b0:561:c6fa:715a with SMTP id o26-20020aa7d3da000000b00561c6fa715amr1769221edr.40.1707916127870; Wed, 14 Feb 2024 05:08:47 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240214101557.2900512-1-kernel@xen0n.name> <20240214101557.2900512-6-kernel@xen0n.name> In-Reply-To: <20240214101557.2900512-6-kernel@xen0n.name> From: Huacai Chen Date: Wed, 14 Feb 2024 21:08:44 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH for-6.8 5/5] KVM: LoongArch: Clean up comments of _kvm_get_cpucfg_mask and kvm_check_cpucfg To: WANG Xuerui Cc: Paolo Bonzini , Tianrui Zhao , Bibo Mao , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, WANG Xuerui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Xuerui, On Wed, Feb 14, 2024 at 6:16=E2=80=AFPM WANG Xuerui wro= te: > > From: WANG Xuerui > > Remove comments that are merely restatement of the code nearby, and > paraphrase the rest so they read more natural for English speakers (that > lack understanding of Chinese grammar). No functional changes. > > Signed-off-by: WANG Xuerui > --- > arch/loongarch/kvm/vcpu.c | 26 +++++++++++--------------- > 1 file changed, 11 insertions(+), 15 deletions(-) > > diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c > index 9e108ffaba30..ff51d6ba59aa 100644 > --- a/arch/loongarch/kvm/vcpu.c > +++ b/arch/loongarch/kvm/vcpu.c > @@ -302,20 +302,14 @@ static int _kvm_get_cpucfg_mask(int id, u64 *v) > { > switch (id) { > case 2: > - /* Return CPUCFG2 features which have been supported by K= VM */ > + /* CPUCFG2 features unconditionally supported by KVM */ > *v =3D CPUCFG2_FP | CPUCFG2_FPSP | CPUCFG2_FPDP = | > CPUCFG2_FPVERS | CPUCFG2_LLFTP | CPUCFG2_LLFTPREV | > CPUCFG2_LAM; > - /* > - * If LSX is supported by CPU, it is also supported by KV= M, > - * as we implement it. > - */ > + /* If LSX is supported by the host, then it is also suppo= rted by KVM */ > if (cpu_has_lsx) > *v |=3D CPUCFG2_LSX; > - /* > - * if LASX is supported by CPU, it is also supported by K= VM, > - * as we implement it. > - */ > + /* Same with LASX */ Consider a full description "If LASX is supported by the host, then it is also supported by KVM"? > if (cpu_has_lasx) > *v |=3D CPUCFG2_LASX; > > @@ -336,21 +330,23 @@ static int kvm_check_cpucfg(int id, u64 val) > > switch (id) { > case 2: > - /* CPUCFG2 features checking */ > if (val & ~mask) > - /* The unsupported features should not be set */ > + /* Unsupported features should not be set */ > return -EINVAL; > if (!(val & CPUCFG2_LLFTP)) > - /* The LLFTP must be set, as guest must has a con= stant timer */ > + /* Guests must have a constant timer */ > return -EINVAL; > if ((val & CPUCFG2_FP) && (!(val & CPUCFG2_FPSP) || !(val= & CPUCFG2_FPDP))) > - /* Single and double float point must both be set= when enable FP */ > + /* Single and double float point must both be set= when FP is enabled */ > return -EINVAL; > if ((val & CPUCFG2_LSX) && !(val & CPUCFG2_FP)) > - /* FP should be set when enable LSX */ > + /* LSX is architecturally defined to imply FP */ > return -EINVAL; > if ((val & CPUCFG2_LASX) && !(val & CPUCFG2_LSX)) > - /* LSX, FP should be set when enable LASX, and FP= has been checked before. */ > + /* > + * LASX is architecturally defined to imply LSX a= nd FP > + * FP is checked just above I think "LASX is architecturally defined to imply LSX and FP" is enough her= e. > + */ > return -EINVAL; > return 0; > default: And I prefer to squash the last two patches together. Huacai > -- > 2.43.0 > >