From owner-freebsd-virtualization@FreeBSD.ORG Fri Nov 21 19:22:09 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBBC49D3 for ; Fri, 21 Nov 2014 19:22:08 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9ABDEB for ; Fri, 21 Nov 2014 19:22:08 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so206251wiv.17 for ; Fri, 21 Nov 2014 11:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=rL6K2FHHnDvorlbb3P0sWNquO0p5+WDxPZig/madq8E=; b=yfr9/3gztTz1ZWS9hY+sbU2k485VooB/MVpax9LvEmexsw0QeCj8+/i2SsB+QncNJL 5X9VSiebId82mSRs/icqvvdDL6lOCjXbOHCDctF1aK0QD/KZSbMmZE9lCx/M+Xuj802/ Z/Lm1nCpnlJwRWMJ7i8v8/mMiL6gggqWvwDGeqjWtnUKgykdojQGaMZ/D1hW/YCTYSbz C2OoHOlADf9CgKla+Sj7XAwyQBLKcpL8AvF4pPqe16tVajTbergUKjoG9j3fSGkJsrbF 1kHUJqJXtHiO/6LV2p3ol14y4LPz7dPEP7E6VUF7u0ChyEZeGNjai/ie6mKQBLbi+zUb yjyQ== MIME-Version: 1.0 X-Received: by 10.194.203.105 with SMTP id kp9mr10559312wjc.81.1416597726880; Fri, 21 Nov 2014 11:22:06 -0800 (PST) Received: by 10.27.12.168 with HTTP; Fri, 21 Nov 2014 11:22:06 -0800 (PST) In-Reply-To: References: Date: Fri, 21 Nov 2014 11:22:06 -0800 Message-ID: Subject: Re: 'repz' instruction not supported. From: Neel Natu To: Ashutosh Kumar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 19:22:09 -0000 Hi Ashutosh, On Fri, Nov 21, 2014 at 2:07 AM, Ashutosh Kumar wr= ote: > Yes you are right 'repz' prefixes is added to the =E2=80=98cmps=E2=80=99 = and 'scas' > instructions. > > The actual opcode is =E2=80=9CF3 A5=E2=80=9D which is =E2=80=98rep movs= =E2=80=99 (disassembly is showing > =E2=80=98repz=E2=80=99). > > > > Yes the guest is emitting these instructions to access MMIO (local apic) > Bummer. I was hoping that it was a prefix stuck by the compiler for optimization (that could be ignored): http://repzret.org/p/repzret/ In any case, the primitives you will need to emulate MOVS exist in vmm_instruction_emul.c. I don't have any plans to work on this but would be happy to review/submit the patch that does the emulation. best Neel > > > Regards > Ashutosh > > >> Date: Fri, 21 Nov 2014 00:08:15 -0800 >> Subject: Re: 'repz' instruction not supported. >> From: neelnatu@gmail.com >> To: mrashutosh@hotmail.com >> CC: freebsd-virtualization@freebsd.org > >> >> Hi Ashutosh, >> >> On Wed, Nov 19, 2014 at 10:30 PM, Ashutosh Kumar >> wrote: >> > Hi >> > We have found that emulation of 'repz' instruction is not supported in >> > bhyve. This is causing VM_EXIT for Guest OS. Do we have plans to add s= upport >> > for instructions like 'repz'. >> > >> >> 'repz' is actually an instruction prefix. The two instructions with >> which 'repz' is allowed are 'cmps' and 'scas'. Both these instructions >> typically don't need to be emulated since they operate on strings in >> "regular" guest memory. >> >> Is your guest emitting these instructions to access MMIO? Can you >> share an objdump with the offending instructions? >> >> best >> Neel >> >> > RegardsAshutosh >> > _______________________________________________ >> > freebsd-virtualization@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization >> > To unsubscribe, send any mail to >> > "freebsd-virtualization-unsubscribe@freebsd.org"