Re: Binary code patching and paravirtualization

2014-12-16 Thread Alexey Suslikov
> CVSROOT: /cvs > Module name: src > Changes by: s...@cvs.openbsd.org 2014/12/16 14:02:58 > Modified files: > sys/arch/amd64/amd64: identcpu.c > sys/arch/amd64/include: specialreg.h > > Log message: > Define and print HV cpuid flag. > This is set by many hypervisors, including kvm, vmware, hyper-v.

Re: Binary code patching and paravirtualization

2014-12-16 Thread Stefan Fritsch
On Mon, 15 Dec 2014, Ted Unangst wrote: > On Mon, Dec 15, 2014 at 23:55, Stefan Fritsch wrote: > > > > Only in order to get a flags field that can be tweaked with config(8). And > > to allow disable via config(8), though that could also be achieved with a > > flag. > > > > Tweaking the behavior

Re: Binary code patching and paravirtualization

2014-12-16 Thread Mike Larkin
On Tue, Dec 16, 2014 at 11:08:03AM +0100, Mark Kettenis wrote: > > Date: Mon, 15 Dec 2014 23:21:35 +0100 (CET) > > From: Stefan Fritsch > > > > On Thu, 11 Dec 2014, Mark Kettenis wrote: > > > > > > From: Alexey Suslikov > > > > Date: Thu, 11 Dec 2014 20:51:14 + (UTC) > > > > > > > > Stefan

Re: Binary code patching and paravirtualization

2014-12-16 Thread Mark Kettenis
> Date: Mon, 15 Dec 2014 23:21:35 +0100 (CET) > From: Stefan Fritsch > > On Thu, 11 Dec 2014, Mark Kettenis wrote: > > > > From: Alexey Suslikov > > > Date: Thu, 11 Dec 2014 20:51:14 + (UTC) > > > > > > Stefan Fritsch sfritsch.de> writes: > > > > > > > --- a/sys/arch/amd64/include/specia

Re: Binary code patching and paravirtualization

2014-12-15 Thread Ted Unangst
On Mon, Dec 15, 2014 at 23:55, Stefan Fritsch wrote: > > Only in order to get a flags field that can be tweaked with config(8). And > to allow disable via config(8), though that could also be achieved with a > flag. > > Tweaking the behavior with a flags value is necessary because hypervisors > n

Re: Binary code patching and paravirtualization

2014-12-15 Thread Stefan Fritsch
On Mon, 15 Dec 2014, Ted Unangst wrote: > On Wed, Dec 10, 2014 at 00:32, Stefan Fritsch wrote: > > > --- a/sys/arch/amd64/conf/GENERIC > > +++ b/sys/arch/amd64/conf/GENERIC > > @@ -39,6 +39,8 @@ isa0 at amdpcib? > > isa0at tcpcib? > > pci*at mainbus0 > > > > +paravirt0 at ma

Re: Binary code patching and paravirtualization

2014-12-15 Thread Ted Unangst
On Wed, Dec 10, 2014 at 00:32, Stefan Fritsch wrote: > --- a/sys/arch/amd64/conf/GENERIC > +++ b/sys/arch/amd64/conf/GENERIC > @@ -39,6 +39,8 @@ isa0at amdpcib? > isa0 at tcpcib? > pci* at mainbus0 > > +paravirt0 at mainbus0 > + > acpi0 at bios0 > acpitimer*at acpi? > acpihp

Re: Binary code patching and paravirtualization

2014-12-15 Thread Stefan Fritsch
On Thu, 11 Dec 2014, Mark Kettenis wrote: > > From: Alexey Suslikov > > Date: Thu, 11 Dec 2014 20:51:14 + (UTC) > > > > Stefan Fritsch sfritsch.de> writes: > > > > > --- a/sys/arch/amd64/include/specialreg.h > > > +++ b/sys/arch/amd64/include/specialreg.h > > > -158,6 +158,7 > >

Re: Binary code patching and paravirtualization

2014-12-11 Thread Theo de Raadt
> > From: Alexey Suslikov > > Date: Thu, 11 Dec 2014 20:51:14 + (UTC) > > > > Stefan Fritsch sfritsch.de> writes: > > > > > --- a/sys/arch/amd64/include/specialreg.h > > > +++ b/sys/arch/amd64/include/specialreg.h > > > -158,6 +158,7 > > > #define CPUIDECX_AVX0x1000

Re: Binary code patching and paravirtualization

2014-12-11 Thread Mark Kettenis
> From: Alexey Suslikov > Date: Thu, 11 Dec 2014 20:51:14 + (UTC) > > Stefan Fritsch sfritsch.de> writes: > > > --- a/sys/arch/amd64/include/specialreg.h > > +++ b/sys/arch/amd64/include/specialreg.h > > -158,6 +158,7 > > #defineCPUIDECX_AVX0x1000 /* Advanced Vec

Re: Binary code patching and paravirtualization

2014-12-11 Thread Alexey Suslikov
Stefan Fritsch sfritsch.de> writes: > --- a/sys/arch/amd64/include/specialreg.h > +++ b/sys/arch/amd64/include/specialreg.h > -158,6 +158,7 > #define CPUIDECX_AVX0x1000 /* Advanced Vector Extensions */ > #define CPUIDECX_F16C 0x2000 /* 16bit fp conve

Re: Binary code patching and paravirtualization

2014-12-11 Thread Stefan Fritsch
On Thursday 11 December 2014 22:20:06, Jonathan Gray wrote: > On Wed, Dec 10, 2014 at 12:32:02AM +0100, Stefan Fritsch wrote: > > For the codepatching part, the most interesting files are > > codepatch.c and codepatch.h. In copy.S and cpu.c, I convert the > > code patching already done for SMAP to

Re: Binary code patching and paravirtualization

2014-12-11 Thread Jonathan Gray
On Wed, Dec 10, 2014 at 12:32:02AM +0100, Stefan Fritsch wrote: > Hi, > > in summer, I posted some paravirt patches for amd64. In response to the > comments I received then, I have created some infrastructure to binary > patch kernel code during boot. In order to get some feedback, I am posting

Re: Binary code patching and paravirtualization

2014-12-09 Thread Stefan Fritsch
On Wednesday 10 December 2014 00:52:44, Antoine Jacoutot wrote: > I assume we still need this: > printf 'change paravirt0\ny\n\n0x8\nq\n' | config -ef /bsd > under Illumos? Correct

Re: Binary code patching and paravirtualization

2014-12-09 Thread Antoine Jacoutot
> in summer, I posted some paravirt patches for amd64. In response to the > comments I received then, I have created some infrastructure to binary > patch kernel code during boot. In order to get some feedback, I am posting > the whole paravirt & code patching diff here. Also, KVM users may be

Binary code patching and paravirtualization

2014-12-09 Thread Stefan Fritsch
Hi, in summer, I posted some paravirt patches for amd64. In response to the comments I received then, I have created some infrastructure to binary patch kernel code during boot. In order to get some feedback, I am posting the whole paravirt & code patching diff here. Also, KVM users may be int