Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CD63C678D5 for ; Tue, 7 Mar 2023 16:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbjCGQKc (ORCPT ); Tue, 7 Mar 2023 11:10:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbjCGQKL (ORCPT ); Tue, 7 Mar 2023 11:10:11 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873A7231F5 for ; Tue, 7 Mar 2023 08:09:02 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-536d63d17dbso142268587b3.22 for ; Tue, 07 Mar 2023 08:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678205341; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=F/kB0IypJg6aZTqiDMRZ19llJnUhGLwpqU6UaEdUNes=; b=Qcv9UAxgt3xsVviKCRDvfMjfSgCYyxThyJGUY1uqeSnXtz2UObx094Vce9b2Sjr0vO rZfRWAve4F+sOI/kLHx3odrPVjgMDXWP35fXk5n1l9aOU2uIfHqByiMqkq7HSmz36s8S Ry20+D8/KTN8vxqL783LbfpBBCErpSjNNZyuJGb9ZBkimBaGSQYcnFRb6TIz8Vw0ViDY tYgvEj3YZUTsjHevcqe4fyqrGGhIfR8AL1vfxndlyfXrDW5BYdt2Lha0/cSM149UKLgt BRneD96KqX1yJz9SkiYDDfefLf59pbsFXmMycCg1pu22Nmt2iVGJPrx8KLT98QHVOT0o qsOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678205341; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=F/kB0IypJg6aZTqiDMRZ19llJnUhGLwpqU6UaEdUNes=; b=Vm/G9TI8onnOq9oFrQGP9XwVjZg/9VDsfXUbM51iU/JSq9Rq2/C8beeWYMpgLLRb6p m+K6dElTOzwfAXB2dsGFewyr3E0g9cgZ+3cizdV4r65T3EI3K56Xt8xBoyODACvtn193 jGgkfq8nNzuoLGhUZcR4d/PiFsLEG+7Z4SVXtZ2aqh8DfrQVLVyhNHzSsvV0/ctvOQ0C qYZKlYeke5ruVByhKfKb1gkvvb+AjSE7Sg+KheJd0fSIa+Lc1ELMEWpatRi32jiXyN/H qC3oPKUt/74yX+LrKDNS8aNkJaXXNpTCX/7P0UHBQuJ6dF5FdBYLKTBhgP2/aA6ztGrn 2Z7g== X-Gm-Message-State: AO0yUKWbaEEtaPge8RVlUTG6L8NBkqBNMv38aeecpS5z8f3aM2QS/8p/ L11sLEcs/aQMdN/MYdHXfRKFyrATn/g= X-Google-Smtp-Source: AK7set/VaM/tRd87+KvjpO4jP7xvodLAwtiDafs6T4TQLSxQiVQL+0JvQJwZHuvJg43BGTQ4mobDppzr77s= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:b71c:0:b0:536:7529:55b4 with SMTP id v28-20020a81b71c000000b00536752955b4mr9597369ywh.3.1678205341764; Tue, 07 Mar 2023 08:09:01 -0800 (PST) Date: Tue, 7 Mar 2023 08:09:00 -0800 In-Reply-To: Mime-Version: 1.0 References: <20230215010717.3612794-1-rananta@google.com> <20230215010717.3612794-11-rananta@google.com> Message-ID: Subject: Re: [REPOST PATCH 10/16] selftests: KVM: aarch64: Add KVM EVTYPE filter PMU test From: Sean Christopherson To: Reiji Watanabe Cc: Raghavendra Rao Ananta , Oliver Upton , Marc Zyngier , Ricardo Koller , James Morse , Suzuki K Poulose , Paolo Bonzini , Jing Zhang , 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RESEND is the "standard" tag, not REPOST. On Mon, Mar 06, 2023, Reiji Watanabe wrote: > Hi Raghu, >=20 > On Tue, Feb 14, 2023 at 5:07=E2=80=AFPM Raghavendra Rao Ananta > wrote: > > > > KVM doest't allow the guests to modify the filter types > > such counting events in nonsecure/secure-EL2, EL3, and > > so on. Validate the same by force-configuring the bits > > in PMXEVTYPER_EL0, PMEVTYPERn_EL0, and PMCCFILTR_EL0 > > registers. > > > > The test extends further by trying to create an event > > for counting only in EL2 and validates if the counter > > is not progressing. > > > > Signed-off-by: Raghavendra Rao Ananta > > --- > > +static void guest_evtype_filter_test(void) > > +{ > > + int i; > > + struct pmc_accessor *acc; > > + uint64_t typer, cnt; > > + struct arm_smccc_res res; > > + > > + pmu_enable(); > > + > > + /* > > + * KVM blocks the guests from creating events for counting in S= ecure/Non-Secure Hyp (EL2), > > + * Monitor (EL3), and Multithreading configuration. It applies = the mask > > + * ARMV8_PMU_EVTYPE_MASK against guest accesses to PMXEVTYPER_E= L0, PMEVTYPERn_EL0, > > + * and PMCCFILTR_EL0 registers to prevent this. Check if KVM ho= nors this using all possible > > + * ways to configure the EVTYPER. > > + */ >=20 > I would prefer to break long lines into multiple lines for these comments > (or other comments in these patches), as "Linux kernel coding style" > suggests. +1. And on the other side of the coin, wrap the changelog closer to ~75 ch= ars, ~54 chars is waaay too aggressive.