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.1 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 autolearn=unavailable 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 083F9C47080 for ; Tue, 1 Jun 2021 19:48:28 +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 BADC3613BC for ; Tue, 1 Jun 2021 19:48:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BADC3613BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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=a2hoORj87712gMoyivf67O78IS/gq2V2FnbIL9jcXfA=; b=V8V9AnOLPeXKWV h2pr45pNM8WvGi0F4RUL88ou5uwG3N903d8SkSmciX6W5XpozqIxH++VJ6GUIHvfToWJKuDtmfjTp Lr3HPFRFWPDmS5Etwjo6kxR6GYBAQRCU2GBBJGsd6RvhYmdInrdp+K70+b0kbmpaPVREn1RayOk/B oU4vySkzce1BC+1f8LgbOu/y4eLCLaeeq9VtDuPqARpefCVJo4HbcZL4amauCsiZ522DPwfUcu4oL Zrm+7EShjr1eKFETarW2uIPTZdBVNaQOJCNTdwwfqEeYq96HQdKK42UrrM7+BYVERfEbmMbN3R4Ks vgigoanjaPb10bWZlkcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loALv-000cZR-3w; Tue, 01 Jun 2021 19:47:03 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loALp-000cYY-DB for linux-arm-kernel@lists.infradead.org; Tue, 01 Jun 2021 19:47:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622576815; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mFg6dKRGX05/OpUoApdspKMfiFJcRvSvkAxKURmBAyQ=; b=T44U78HqzlyhEAcYjIEzCSfbsqOVhpu5aDw2bfcklyJQ1cWedpTeR1/jDfkADal05CY7F4 Ldtg5AC3E6iBWPB/ozGUJvMBCytRazm3PGwPlZDMI31/1LBzKAoeYYJPwVEx1ncw2iJdMC TGxxO8ioOUB3VGXTv2LMAnpmldcufBU= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-17-kcfootxJONC-CPoLV1vEtg-1; Tue, 01 Jun 2021 15:46:51 -0400 X-MC-Unique: kcfootxJONC-CPoLV1vEtg-1 Received: by mail-ed1-f70.google.com with SMTP id d8-20020a0564020008b0290387d38e3ce0so7920edu.1 for ; Tue, 01 Jun 2021 12:46:51 -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:content-transfer-encoding :in-reply-to; bh=mFg6dKRGX05/OpUoApdspKMfiFJcRvSvkAxKURmBAyQ=; b=oh4H4P+RgvLdYmO9f1kWWSNanpJtU+QKLSF5W165OixUveCHxuZSTIfwPF8KjmBwqw oGADeFC4tnlSbU3NiThyIWRgeGU2Lh1AFRHecD+ABXjFzIhIiFT2Of5oZPqrHDZzmOD9 +ZKF3gMLctCV/eoN5V7GKHRRTQo+aBIonsx6mecOfjmBTHVYGdMcuIbH1bFQ1MryfWwX CAPqWZuwPKdLzl7+hq76VxlOpcM7AqZM2h9uzs6EhF4Jo9f9dI7MGykqwXsjvNDZMAsF SGJh7s8bsXkQLBhr6QpuQCJVNmIeppGzi7SjUMtO75UvmccqF1fBT9rZ58PLLUamm9i5 xpiQ== X-Gm-Message-State: AOAM530TYYjn7fLsHA6btW3Wq/B1YrUcXP2jthyDa7dSbQbmSStsx1Iq CFj5W3uhCA/44PuR6YFoGwYLcASOdB9VHWBHgtVhC3NXVaIRTE1+Gfq/c1KAqpnA6W0sI6DxkHv 70/e4gIxPpJJhFZyqovje1erMfRbDdOjVG5U= X-Received: by 2002:a05:6402:1d0c:: with SMTP id dg12mr11032442edb.155.1622576810785; Tue, 01 Jun 2021 12:46:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxbUPimAs6A73voDIIQ7UzbNe86cT5d42Vz4uZzsv/u4iPJgbTgX5R6x1u2RrubCP0A/kXRw== X-Received: by 2002:a05:6402:1d0c:: with SMTP id dg12mr11032429edb.155.1622576810607; Tue, 01 Jun 2021 12:46:50 -0700 (PDT) Received: from gator.home (cst2-174-132.cust.vodafone.cz. [31.30.174.132]) by smtp.gmail.com with ESMTPSA id v1sm7546424ejw.117.2021.06.01.12.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 12:46:50 -0700 (PDT) Date: Tue, 1 Jun 2021 21:46:48 +0200 From: Andrew Jones To: Alex =?utf-8?Q?Benn=C3=A9e?= Cc: Auger Eric , kvm@vger.kernel.org, maz@kernel.org, shashi.mallela@linaro.org, qemu-arm@nongnu.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [kvm-unit-tests PATCH v2 4/4] arm64: split its-migrate-unmapped-collection into KVM and TCG variants Message-ID: <20210601194648.fdymtxiz6lkxycsx@gator.home> References: <20210525172628.2088-1-alex.bennee@linaro.org> <20210525172628.2088-5-alex.bennee@linaro.org> <5fe1c796-c886-e5c6-6e61-e12d0f73a884@redhat.com> <87sg21bk7r.fsf@linaro.org> MIME-Version: 1.0 In-Reply-To: <87sg21bk7r.fsf@linaro.org> 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-20210601_124657_561242_50601D75 X-CRM114-Status: GOOD ( 35.93 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 01, 2021 at 05:49:01PM +0100, Alex Benn=E9e wrote: > = > Auger Eric writes: > = > > Hi Alex, > > > > On 5/25/21 7:26 PM, Alex Benn=E9e wrote: > >> When running the test in TCG we are basically running on bare metal so > >> don't rely on having a particular kernel errata applied. > >> = > >> You might wonder why we handle this with a totally new test name > >> instead of adjusting the append to take an extra parameter? Well the > >> run_migration shell script uses eval "$@" which unwraps the -append > >> leading to any second parameter being split and leaving QEMU very > >> confused and the test hanging. This seemed simpler than re-writing all > >> the test running logic in something sane ;-) > > > > there is > > lib/s390x/vm.h:bool vm_is_tcg(void) > > > > but I don't see any particular ID we could use to differentiate both the > > KVM and the TCG mode, do you? > = > For -cpu max we do: > = > /* > * Reset MIDR so the guest doesn't mistake our 'max' CPU type for= a real > * one and try to apply errata workarounds or use impdef features= we > * don't provide. > * An IMPLEMENTER field of 0 means "reserved for software use"; > * ARCHITECTURE must be 0xf indicating "v7 or later, check ID reg= isters > * to see which features are present"; > * the VARIANT, PARTNUM and REVISION fields are all implementation > * defined and we choose to define PARTNUM just in case guest > * code needs to distinguish this QEMU CPU from other software > * implementations, though this shouldn't be needed. > */ > t =3D FIELD_DP64(0, MIDR_EL1, IMPLEMENTER, 0); > t =3D FIELD_DP64(t, MIDR_EL1, ARCHITECTURE, 0xf); > t =3D FIELD_DP64(t, MIDR_EL1, PARTNUM, 'Q'); > t =3D FIELD_DP64(t, MIDR_EL1, VARIANT, 0); > t =3D FIELD_DP64(t, MIDR_EL1, REVISION, 0); > cpu->midr =3D t; > = > However for the default -cpu cortex-a57 we aim to look just like the > real thing - only without any annoying micro-architecture bugs ;-) > = > > > > without a more elegant solution, > = > I'll look into the suggestion made by Richard. Where did Richard make a suggestion? And what is it? Thanks, drew > = > > Reviewed-by: Eric Auger > > > > Thanks > > > > Eric > > > > > >> = > >> Signed-off-by: Alex Benn=E9e > >> Cc: Shashi Mallela > >> --- > >> arm/gic.c | 8 +++++++- > >> arm/unittests.cfg | 10 +++++++++- > >> 2 files changed, 16 insertions(+), 2 deletions(-) > >> = > >> diff --git a/arm/gic.c b/arm/gic.c > >> index bef061a..0fce2a4 100644 > >> --- a/arm/gic.c > >> +++ b/arm/gic.c > >> @@ -36,6 +36,7 @@ static struct gic *gic; > >> static int acked[NR_CPUS], spurious[NR_CPUS]; > >> static int irq_sender[NR_CPUS], irq_number[NR_CPUS]; > >> static cpumask_t ready; > >> +static bool under_tcg; > >> = > >> static void nr_cpu_check(int nr) > >> { > >> @@ -834,7 +835,7 @@ static void test_migrate_unmapped_collection(void) > >> goto do_migrate; > >> } > >> = > >> - if (!errata(ERRATA_UNMAPPED_COLLECTIONS)) { > >> + if (!errata(ERRATA_UNMAPPED_COLLECTIONS) && !under_tcg) { > >> report_skip("Skipping test, as this test hangs without the fix. " > >> "Set %s=3Dy to enable.", ERRATA_UNMAPPED_COLLECTIONS); > >> test_skipped =3D true; > >> @@ -1005,6 +1006,11 @@ int main(int argc, char **argv) > >> report_prefix_push(argv[1]); > >> test_migrate_unmapped_collection(); > >> report_prefix_pop(); > >> + } else if (!strcmp(argv[1], "its-migrate-unmapped-collection-tcg")) { > >> + under_tcg =3D true; > >> + report_prefix_push(argv[1]); > >> + test_migrate_unmapped_collection(); > >> + report_prefix_pop(); > >> } else if (strcmp(argv[1], "its-introspection") =3D=3D 0) { > >> report_prefix_push(argv[1]); > >> test_its_introspection(); > >> diff --git a/arm/unittests.cfg b/arm/unittests.cfg > >> index 1a39428..adc1bbf 100644 > >> --- a/arm/unittests.cfg > >> +++ b/arm/unittests.cfg > >> @@ -205,7 +205,7 @@ extra_params =3D -machine gic-version=3D3 -append = 'its-pending-migration' > >> groups =3D its migration > >> arch =3D arm64 > >> = > >> -[its-migrate-unmapped-collection] > >> +[its-migrate-unmapped-collection-kvm] > >> file =3D gic.flat > >> smp =3D $MAX_SMP > >> accel =3D kvm > >> @@ -213,6 +213,14 @@ extra_params =3D -machine gic-version=3D3 -append= 'its-migrate-unmapped-collection' > >> groups =3D its migration > >> arch =3D arm64 > >> = > >> +[its-migrate-unmapped-collection-tcg] > >> +file =3D gic.flat > >> +smp =3D $MAX_SMP > >> +accel =3D tcg > >> +extra_params =3D -machine gic-version=3D3 -append 'its-migrate-unmapp= ed-collection-tcg' > >> +groups =3D its migration > >> +arch =3D arm64 > >> + > >> # Test PSCI emulation > >> [psci] > >> file =3D psci.flat > >> = > = > = > -- = > Alex Benn=E9e > _______________________________________________ > kvmarm mailing list > kvmarm@lists.cs.columbia.edu > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel