From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87ECAC4338F for ; Thu, 29 Jul 2021 17:45:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 634C960F46 for ; Thu, 29 Jul 2021 17:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbhG2Rpf (ORCPT ); Thu, 29 Jul 2021 13:45:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27207 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbhG2Rpe (ORCPT ); Thu, 29 Jul 2021 13:45:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627580731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=aW6A940p92WMQyoWCwqZksEJL3ubYIpEpzMjDJaSUcBxVLL/cPYTPs+qkL271P5j6ymnwG jVU5K13p5dlMUy+sZSX5vQq78Hx7SiiSxf0b2yCoPTok09TyzGJUebD0PdEG470vkoYvrU 70DVApQVFbTHHo93//AyF+fJepwku1c= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-wsQdb_W5OSCfvxr1C_vHuQ-1; Thu, 29 Jul 2021 13:45:29 -0400 X-MC-Unique: wsQdb_W5OSCfvxr1C_vHuQ-1 Received: by mail-il1-f198.google.com with SMTP id h27-20020a056e021d9bb02902021736bb95so3636335ila.5 for ; Thu, 29 Jul 2021 10:45:29 -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=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=MFo25R8tj+jRaV1jFMZm/vZVK6dztbRwAOsud2mHzs3THgW1YoL2FdhJirHAySv6C3 xaQhw0yctK5XXCb5aFuAfoseWODoiyUDJH+t4MYaNzmtxd+DbGEXrKoasPRdDZFNHDOy klVTuTnYA7JCoJdLKb90mvLyyPTLtHQqgNyZqYFHrBcsemY7u+WnI7kccO9+Cfp1I6ir FaBtWViiYuRsmbSHSr3yAWIycMXyJeidCOT5tu248FlnFvQ97vy6p+gRvwTpzIFf/ySf 4Da+bEK4ujnBC2rjwzRsP09x0f4IPSsIYHrUHALbGWJ5zPfvECdfOScU1p4lwDoB+YNX MeOg== X-Gm-Message-State: AOAM532l1LTqr1cLIGgYp/B23vQqxjY88xtRhB0MsPyBxJXDS48gN/i8 z4Oa/TTwlymThcWqkpC2ao2isAvUBsmKM7I9PPu79UOq2Kes5g3PdLbUcBb4/qCPEbXlK9Rp1Nv Sve+t2wOW6q+B X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555705jaj.75.1627580729307; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf77LhlT9YvfAjMD/rhjDi5lGqSzYugzzvfmOLDdrWVhTSAaNJZlRA4FN/MoqzmCofE6vzAQ== X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555679jaj.75.1627580729171; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) Received: from gator ([140.82.166.162]) by smtp.gmail.com with ESMTPSA id j18sm2589446ioa.53.2021.07.29.10.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 10:45:28 -0700 (PDT) Date: Thu, 29 Jul 2021 19:45:16 +0200 From: Andrew Jones To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 13/13] selftests: KVM: Add counter emulation benchmark Message-ID: <20210729174516.nje54y7c5iy5qyn4@gator> References: <20210729173300.181775-1-oupton@google.com> <20210729173300.181775-14-oupton@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729173300.181775-14-oupton@google.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jul 29, 2021 at 05:33:00PM +0000, Oliver Upton wrote: > Add a test case for counter emulation on arm64. A side effect of how KVM > handles physical counter offsetting on non-ECV systems is that the > virtual counter will always hit hardware and the physical could be > emulated. Force emulation by writing a nonzero offset to the physical > counter and compare the elapsed cycles to a direct read of the hardware > register. > > Cc: Andrew Jones > Reviewed-by: Ricardo Koller > Signed-off-by: Oliver Upton > --- > tools/testing/selftests/kvm/.gitignore | 1 + > tools/testing/selftests/kvm/Makefile | 1 + > .../kvm/aarch64/counter_emulation_benchmark.c | 207 ++++++++++++++++++ > 3 files changed, 209 insertions(+) > create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c > Reviewed-by: Andrew Jones From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B250DC4320A for ; Thu, 29 Jul 2021 17:45:36 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 31EC360F5E for ; Thu, 29 Jul 2021 17:45:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 31EC360F5E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AD4814B0E3; Thu, 29 Jul 2021 13:45:35 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CqBw9PiBTF6u; Thu, 29 Jul 2021 13:45:34 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8B7E44B0E8; Thu, 29 Jul 2021 13:45:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 378D34B0E8 for ; Thu, 29 Jul 2021 13:45:33 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mh9RohUfevSJ for ; Thu, 29 Jul 2021 13:45:32 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2BF7F4B0E3 for ; Thu, 29 Jul 2021 13:45:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627580732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=grfq1yWAxVB+Fkz4WU+waEqqQcTqYWn+KNZuuBsdsyp302Y8/S6jr1Z7RLbTBHGUes9+pi cKS5c0IByFr6cKR8bX1OFxCrW3iTq8uxpbZfZ4ojVy0/qQUc/sWl0iYFtDj44qgUZwGoj9 nWyf1OZ5XGU7PJSwAElrW0sE4YJpe/w= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-ibzkHwCTN6KLTLESwQKzfg-1; Thu, 29 Jul 2021 13:45:29 -0400 X-MC-Unique: ibzkHwCTN6KLTLESwQKzfg-1 Received: by mail-io1-f70.google.com with SMTP id z17-20020a0566022051b0290528db19d5b3so4267716iod.5 for ; Thu, 29 Jul 2021 10:45:29 -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=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=dkmE7h1SJ/S+jacW1HhPhP2TAp5aiJf67DIyOmX/6WCv6s4C0jvRW336TYkz3ntQF6 w1bchWK775JccV8p2PqeCLuHkAtdwkWyFeQ23eqnongAQwNKuaYO1IYhzCho9bPiYJHu h3q5uAcHim7f3ASP5h6tU2lsdvYP3XHy+MXIJlNvnDFE29LFonP+lujrKFfIrNamIUJN bV9gANCGzq+jz5hvH4bKUEXY0A/1Eog05/4fBax6tcjR8Rf0ndrvEtx6sSmRoEVJiqND fGtEhtHjOW7tP12GtelSMt9jFZrVtkItOkTie+NAXnuNQRM6GeoQCHtIUqhTuk4ibruw Xsyw== X-Gm-Message-State: AOAM530mFdICFdu8+r/FpEtL1PRy20olAkmrfInn/XCWblWn0ZkoVF2/ CNMaOtQabyeiW4trc8tfgKQLxyISKnppnfDnz1VOD4Y8iDFd8L6nIkQ2KpB1r0ogjIgE5L3CPak 2zmYAh/EgC1kLZZsONSzLTwLl X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555698jaj.75.1627580729307; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf77LhlT9YvfAjMD/rhjDi5lGqSzYugzzvfmOLDdrWVhTSAaNJZlRA4FN/MoqzmCofE6vzAQ== X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555679jaj.75.1627580729171; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) Received: from gator ([140.82.166.162]) by smtp.gmail.com with ESMTPSA id j18sm2589446ioa.53.2021.07.29.10.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 10:45:28 -0700 (PDT) Date: Thu, 29 Jul 2021 19:45:16 +0200 From: Andrew Jones To: Oliver Upton Subject: Re: [PATCH v5 13/13] selftests: KVM: Add counter emulation benchmark Message-ID: <20210729174516.nje54y7c5iy5qyn4@gator> References: <20210729173300.181775-1-oupton@google.com> <20210729173300.181775-14-oupton@google.com> MIME-Version: 1.0 In-Reply-To: <20210729173300.181775-14-oupton@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: kvm@vger.kernel.org, Marc Zyngier , Raghavendra Rao Anata , Peter Shier , Sean Christopherson , David Matlack , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, Jul 29, 2021 at 05:33:00PM +0000, Oliver Upton wrote: > Add a test case for counter emulation on arm64. A side effect of how KVM > handles physical counter offsetting on non-ECV systems is that the > virtual counter will always hit hardware and the physical could be > emulated. Force emulation by writing a nonzero offset to the physical > counter and compare the elapsed cycles to a direct read of the hardware > register. > > Cc: Andrew Jones > Reviewed-by: Ricardo Koller > Signed-off-by: Oliver Upton > --- > tools/testing/selftests/kvm/.gitignore | 1 + > tools/testing/selftests/kvm/Makefile | 1 + > .../kvm/aarch64/counter_emulation_benchmark.c | 207 ++++++++++++++++++ > 3 files changed, 209 insertions(+) > create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c > Reviewed-by: Andrew Jones _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EF7FC4338F for ; Thu, 29 Jul 2021 17:54:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 570A660EE2 for ; Thu, 29 Jul 2021 17:54:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 570A660EE2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BBPKU0ojdw0hBfOvq5jwoKzEgapctpiNy7HIYFQZ5K0=; b=rORqnxJjrWIpYR ucB9iLlSfAOUzHlE4OgYkIisBvYPCZ9YrcH83tSQ+9mLypVs8aYKOMF7wIEVyCyrvOPhf2v7vUBfR rPyL7GQCxrezLomxniCArzLDYdL7AbkIs6MoqBIUBTtX+w4xsJ3GGw+9kc0um0ZpMdU3XuyU5eP2I SMb9CoxR7m36GUV+wGLELFCSvOp2VcguT2hjn7w5fn9OheVApxas752yEu/cQUBpdRQk6EzS3XXDF WNl1hxAbi36TWHD3Spbzl8mt9EPq3w/zSLOMUIerg6EBgTkK/4lYftUGc6FriRpZYYugb05/AVXPJ AUbpapG3BFvW+Vc+roJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9AC5-005R0V-MN; Thu, 29 Jul 2021 17:51:42 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9A69-005Owb-UE for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 17:45:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627580732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=grfq1yWAxVB+Fkz4WU+waEqqQcTqYWn+KNZuuBsdsyp302Y8/S6jr1Z7RLbTBHGUes9+pi cKS5c0IByFr6cKR8bX1OFxCrW3iTq8uxpbZfZ4ojVy0/qQUc/sWl0iYFtDj44qgUZwGoj9 nWyf1OZ5XGU7PJSwAElrW0sE4YJpe/w= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-XbCS7KSRO_KaGbD_a2pXLQ-1; Thu, 29 Jul 2021 13:45:29 -0400 X-MC-Unique: XbCS7KSRO_KaGbD_a2pXLQ-1 Received: by mail-io1-f70.google.com with SMTP id h70-20020a6bb7490000b02904f7957d92b5so4222146iof.21 for ; Thu, 29 Jul 2021 10:45:29 -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=rT316eGUa2+7b7jjZkTlKN4mfhqRrOL4B5+LcpVHIKo=; b=o9oEvNGNHUbwgugRWJ1u0fjo5YABJAkhlp6/oimq0Cp5IqOFXRTes1/sZoD3yE02Ej PZoC1WUrSBQ/jvIHTLOKvW5gOrcpUzid+LIx34jv3ufEmYcW+frjpmBpQ38rlW6vm0r1 FBtYtsKeWajvCAqLZes0W/3b+I7bXvMNheIbFJ6bMc+NhKzJP+s7qbk9ipsoooQxeptU +Qaxd2d5+CITkaWcjhpe3gYX79rrCX5pflAb3GIAX8N44+AnkuzkgwFwNdNBJqrNJ003 cDzCmjqkC70r9Zm0bpZlZGREuFeGn05HbPSsRQ7RaS9mMc9ULVM5onm9nEE4j9wLz85N dtIA== X-Gm-Message-State: AOAM530J+e/HZj/nuUCZMNs9MtKcwMhl6BUBsjIvi0aHxJgKKACtPY9L xmyfhLjf6jRNOJDyupXFhpaf7pd673Rgwi5TuC7nW+dXE3T6WhV8xnjHyKD8sErwcEVhMSxOAiQ L1yBoxfN/oL0O4EO1Q6NiVelFUaz7oSplV74= X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555700jaj.75.1627580729307; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf77LhlT9YvfAjMD/rhjDi5lGqSzYugzzvfmOLDdrWVhTSAaNJZlRA4FN/MoqzmCofE6vzAQ== X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5555679jaj.75.1627580729171; Thu, 29 Jul 2021 10:45:29 -0700 (PDT) Received: from gator ([140.82.166.162]) by smtp.gmail.com with ESMTPSA id j18sm2589446ioa.53.2021.07.29.10.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 10:45:28 -0700 (PDT) Date: Thu, 29 Jul 2021 19:45:16 +0200 From: Andrew Jones To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 13/13] selftests: KVM: Add counter emulation benchmark Message-ID: <20210729174516.nje54y7c5iy5qyn4@gator> References: <20210729173300.181775-1-oupton@google.com> <20210729173300.181775-14-oupton@google.com> MIME-Version: 1.0 In-Reply-To: <20210729173300.181775-14-oupton@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_104534_102307_DE6020D7 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 29, 2021 at 05:33:00PM +0000, Oliver Upton wrote: > Add a test case for counter emulation on arm64. A side effect of how KVM > handles physical counter offsetting on non-ECV systems is that the > virtual counter will always hit hardware and the physical could be > emulated. Force emulation by writing a nonzero offset to the physical > counter and compare the elapsed cycles to a direct read of the hardware > register. > > Cc: Andrew Jones > Reviewed-by: Ricardo Koller > Signed-off-by: Oliver Upton > --- > tools/testing/selftests/kvm/.gitignore | 1 + > tools/testing/selftests/kvm/Makefile | 1 + > .../kvm/aarch64/counter_emulation_benchmark.c | 207 ++++++++++++++++++ > 3 files changed, 209 insertions(+) > create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c > Reviewed-by: Andrew Jones _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel