Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp531920rdb; Thu, 19 Oct 2023 11:06:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIFzNOF7QkHwLGX1hbulsiuXb/9G1xtrH7fi8Ker9rMujKW7CwYKNqbv+ZZ84uAqr2k8yj X-Received: by 2002:a05:6a20:2590:b0:16b:c20d:fcd1 with SMTP id k16-20020a056a20259000b0016bc20dfcd1mr3195980pzd.21.1697738815930; Thu, 19 Oct 2023 11:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697738815; cv=none; d=google.com; s=arc-20160816; b=d7n1BeyZ6Cp2PPcKOR05W1f+077HLWB77IwuiGGwQGhK+VtwAzudJJLzzhaqtkvmzl ihCpAMwDyFTxcCeyz5WA/lsaWZdNykwsQvRZaGCEBhO4lR6779Azp+99/pTGomBf9mWL juIPULbtmBifu8NaSPCyLl7Rm1NR0q9SW0TUVR1x+ZeL37pV0SklKofA6p7hILiw/wAF +tKcKprvJ7uI7Sm6eeDPO2S0J2buBrrcvv+FSMseJLbJC/RXsZa5RsgLwmgrwq4CY+qp /IMOBXn73tUyTUSUQzWNOR/YgL4y9YlhQikERTP0n4UvMrTwFWax8PUZn4pRXnsDElSN VoVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=X79WPuk0kI/Em6qMbs24oISDzyvT6ZbjodD9ilXj+Jg=; fh=Ydzx9+q2LPKW+62Dx8Wwj8Mofu196V11LHOTZ5Nf2xk=; b=CsnHyQQhmae6jnMrmGqHY3epVX9gPkWIeBSj5bzb+TYqiUtlAOcMugHszeMDLGZa/S B4UWQiZliJgn1pNsVR3cosMKHcpZNgYLGZJR2JlbFbnPIume5i7ou799lEkmqzCDmp0P 0C1LWfO63NDjmx+UTDYeJJ0hE4y6cU9Aie58npbbj7I0uINpt917DKU5YpwnZBqM8g6D UPjolcv+xoVmt7zsL8ErsevOFs4iNFHILz0HUMiD0AE2AYaH+eMvGkZylFCRjgDFVaTB GxtQcFw8mm3cvaiq7tuQm9dJFP5sLuwl7DPUyH0Y183WbO3ESho9y6wpiiqY2jj4GkA7 +F1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GQ5byXDB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o14-20020a17090ab88e00b0027d22503b9esi148727pjr.84.2023.10.19.11.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GQ5byXDB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 56406807514B; Thu, 19 Oct 2023 11:05:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345646AbjJSSFe (ORCPT + 99 others); Thu, 19 Oct 2023 14:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235508AbjJSSFd (ORCPT ); Thu, 19 Oct 2023 14:05:33 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08052121 for ; Thu, 19 Oct 2023 11:05:30 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c9c145bb5bso18145ad.1 for ; Thu, 19 Oct 2023 11:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697738729; x=1698343529; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=X79WPuk0kI/Em6qMbs24oISDzyvT6ZbjodD9ilXj+Jg=; b=GQ5byXDBZunYyxebO377e+jO7uTKZmd3RMGNISic/cc7cufZyel9VMfqGO4G53U/Kb z2zS0JA0Y3muD2YEJaV3O8IAJ02R79wPBWCmZ1qG51C62sEBUdu6uoaNUZx6qzC621nK BluKb7Qi+t6UOJpN+U3EWy0k0bdZYioxyoe7XJlBto5N6J8ubGloPCNumeeTXxU28fX8 a1oX7kOwflEBwcay8Xol+HM+IetiRV2z+m04Sq8+9eq2AY/+0McuZ2inzuS9UDRmW5x1 lpSZdO+mhLiQCDf2zJd4WCOFaXsxTWP7f1A9+N+BhyBI7ZNFblwMTdOWdUfRQTh2GrDz Y8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697738729; x=1698343529; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X79WPuk0kI/Em6qMbs24oISDzyvT6ZbjodD9ilXj+Jg=; b=Llid46WFFPmOlUTW0lJb3UBbQEb1Ax7vpbASiUMKO6/bDAghxbdLTtLRoEdOJ1/Bww qmYZdkwgm5mhq5dILG1AKsxMQAHW08O6f2Hfla3VMY4F25N58fmC4uPdpa/oOVrs07Ih NbbDN1CQjbgHYtjIC25K9ogvO8XVgcZ57TkCLz28oFMGAC6/bHiPViqGunT/529F0DaK DUH7wabI6xFSdHD9CoTKFVJQXKrs9EAGJ4wQpY1Q6uMQogCKlkluQiwHEBE/F9dWSn0n a0jBrSD8kwTB81ByuDSsvCubpS/vlUXBd0C0qj+qWRdcxJMf6120C1JI5tsg5+g7a1V1 6hzg== X-Gm-Message-State: AOJu0Yxn853wht1qf3Fmt3AiVi2i2BPhipwDLhR/QNsT7vStVUKa2XJN xZh2gPQsk77+ygF6zAKf/fUBQWWxG4MMjazJPaNhBw== X-Received: by 2002:a17:902:ebc4:b0:1c4:1392:e4b5 with SMTP id p4-20020a170902ebc400b001c41392e4b5mr5130plg.21.1697738729250; Thu, 19 Oct 2023 11:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20231009230858.3444834-1-rananta@google.com> <20231009230858.3444834-9-rananta@google.com> <5d35c9f3-455e-6aa9-fd6a-4433cf70803a@redhat.com> In-Reply-To: From: Raghavendra Rao Ananta Date: Thu, 19 Oct 2023 11:05:17 -0700 Message-ID: Subject: Re: [PATCH v7 08/12] KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest To: Sebastian Ott Cc: Oliver Upton , Marc Zyngier , Alexandru Elisei , James Morse , Suzuki K Poulose , Paolo Bonzini , Zenghui Yu , Shaoqin Huang , Jing Zhang , Reiji Watanabe , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 11:05:50 -0700 (PDT) On Thu, Oct 19, 2023 at 3:45=E2=80=AFAM Sebastian Ott w= rote: > > On Tue, 17 Oct 2023, Raghavendra Rao Ananta wrote: > > On Tue, Oct 17, 2023 at 8:52=E2=80=AFAM Sebastian Ott wrote: > >> > >> On Mon, 9 Oct 2023, Raghavendra Rao Ananta wrote: > >>> +static int set_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc= *r, > >>> + u64 val) > >>> +{ > >>> + struct kvm *kvm =3D vcpu->kvm; > >>> + u64 new_n, mutable_mask; > >>> + > >>> + mutex_lock(&kvm->arch.config_lock); > >>> + > >>> + /* > >>> + * Make PMCR immutable once the VM has started running, but do > >>> + * not return an error (-EBUSY) to meet the existing expectatio= ns. > >>> + */ > >> > >> Why should we mention which error we're _not_ returning? > >> > > Oh, it's not to break the existing userspace expectations. Before this > > series, any 'write' from userspace was possible. Returning -EBUSY all > > of a sudden might tamper with this expectation. > > Yes I get that part. What I've meant is why specifically mention -EBUSY? > You're also not returning -EFAULT nor -EINVAL. > > /* > * Make PMCR immutable once the VM has started running, but do > * not return an error to meet the existing expectations. > */ > IMHO provides the same info to the reader and is less confusing > Sounds good. I'll apply this. Thank you. Raghavendra > Sebastian