From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests 2/2] arm64: add micro-bench Date: Mon, 3 Sep 2018 18:31:39 +0200 Message-ID: <20180903163139.arpf6vpg4d2z7mju@kamzik.brq.redhat.com> References: <20180830141733.21725-1-drjones@redhat.com> <20180830141733.21725-3-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , Yury Norov , kvmarm@lists.cs.columbia.edu To: Shih-Wei Li Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org On Mon, Sep 03, 2018 at 11:06:51AM -0400, Shih-Wei Li wrote: > On Thu, Aug 30, 2018 at 10:17 AM, Andrew Jones wrote: > > +static bool test_init(void) > > +{ > > + int v = gic_init(); > > + > > + if (!v) { > > + printf("No supported gic present, skipping tests...\n"); > > + return false; > > + } > > + > > + if (nr_cpus < 2) { > > + printf("At least two cpus required, skipping tests...\n"); > > + return false; > > + } > > + > > + switch (v) { > > + case 2: > > + vgic_dist_base = gicv2_dist_base(); > > + write_eoir = gicv2_write_eoir; > > + case 3: > > + vgic_dist_base = gicv3_dist_base(); > > + write_eoir = gicv3_write_eoir; > > + } > > I think we'll need a "break" in the switch case body for gicv2 here > otherwise it'll fall into the case body below and refer to the wrong > symbols for gicv3. > > As I've tested on my seattle server hardware (with gicv2), this results > to incorrect execution in mmio_read_vgic_exec and a crash in > eoi_exec(). > Argh... Obviously my testing of this was pretty poor. You are certainly right that I'm missing breaks in this switch. If you don't mind, please add them, along with the fix in v2, to your local repo and test again. I'll hold off on sending v3 until you've had a chance to test and review more. Thanks, drew