Re: nested virtualization with vmm on hyper-v

2021-10-30 Thread Mike Larkin
On Sat, Oct 30, 2021 at 02:25:44PM +0200, Peter J. Philipp wrote:
> Hi,
>
> I'm a little confused by this.  I have an old Xeon e3-1275v3 computer that
> runs windows server 2019 essentials natively.  It shares half it's RAM and
> 2 cores with OpenBSD as a hyper-v guest.
>
> So after a long time of not looking into this I asked someone how they did
> virtualization nesting and I got this link:
>
> https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization
>
> So this is good, I thought, I followed the instructions, turned off the 
> hyper-v,
> did the powershell command, restarted hyper-v guest and got some indication by
> OpenBSD that vmm is enabled:
>
> arda$ dmesg | grep vmm
> cpu0: using VERW MDS workaround (except on vmm entry)
> vmm0 at mainbus0: VMX/EPT
>
> Only when I start the vmm guest with vmctl and vmctl console, it boots me out
> of console mode back into arda and the vmm guest is stopped.
>
> So then I rebooted the entire machine to make sure that all BIOS settings are
> correct.  And they are.  There is no CPU option that I can set here that would
> disallow this nesting.
>
> Here is the CPU options of arda (short of a dmesg):
>
> cpu0: using VERW MDS workaround (except on vmm entry)
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Xeon(R) CPU E3-1275 v3 @ 3.50GHz, 3498.01 MHz, 06-3c-03
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,HTT,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,XSAVEOPT,MELTDOWN
> cpu0: 256KB 64b/line 8-way L2 cache
> cpu0: smt 0, core 0, package 0
> cpu0: apic clock running at 200MHz
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Intel(R) Xeon(R) CPU E3-1275 v3 @ 3.50GHz, 3497.99 MHz, 06-3c-03
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,HTT,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,XSAVEOPT,MELTDOWN
> cpu1: 256KB 64b/line 8-way L2 cache
> cpu1: smt 0, core 1, package 0
> cpu0: using VERW MDS workaround (except on vmm entry)
>
> Does anyone know how I can get vmm with nesting to function?  Is it a OpenBSD
> problem or should I seek elsewhere?
>
> Best Regards,
> -peter
>

I told Microsoft years ago that their implementation of legacy event injection
was broken. This is how we inject interrupts in vmm(4). They either didn't
understand, or didn't care. Since hyper-v doesn't deliver our injected event,
no interrupts are delivered to the VM and as soon as interrupts are enabled
in autoconf, you hang.

Note: KVM and VMware do it correctly.

-ml



[patch] sioctl_open.3 - sioctl_onval return type

2021-10-30 Thread Carlin Bingham
sioctl_onval(3) returns int not void 


138 int
139 sioctl_onval(struct sioctl_hdl *hdl,
140 void (*cb)(void *, unsigned int, unsigned int), void *arg)
141 {
142 hdl->ctl_cb = cb;
143 hdl->ctl_arg = arg;
144 return hdl->ops->onctl(hdl);
145 }


diff --git a/lib/libsndio/sioctl_open.3 b/lib/libsndio/sioctl_open.3
index b234e291200..7b6869b1d79 100644
--- a/lib/libsndio/sioctl_open.3
+++ b/lib/libsndio/sioctl_open.3
@@ -45,7 +45,7 @@
 .Fa "void (*cb)(void *arg, struct sioctl_desc *desc, int val)"
 .Fa "void *arg"
 .Fc
-.Ft void
+.Ft int
 .Fo sioctl_onval
 .Fa "struct sioctl_hdl *hdl"
 .Fa "void (*cb)(void *arg, unsigned int addr, unsigned int val)"



Re: Dhcp client configuration in 7.0

2021-10-30 Thread Sebastian Benoit
Arnoud Otten(arn...@beekberg.nl) on 2021.10.30 22:18:09 +0200:
> Hi,
> 
> Maybe i am wrong and do not understand this right, but wat should  the 
> ???ignore dns??? option do when used in the dhcpleased .conf config file?
> Here @xs4all our IPTV network on a separate vlan also gets an ip address and 
> the dhcp offer also sends a dns server which should be ignored. 
> I also thought that with the ???ignore dns??? option, this dns server was 
> blocked, but that is not what the option does? 
> 
> Regards,
> 
> Arnoud

The "ignore dns" config option causes dhcpleased to send a RTM_PROPOSAL
message to resolvd with an empty DNS proposal for that interface. This
causes resolvd to remove any nameserver entry for that interface from
/etc/resolv.conf.

Note that resolvd adds comments to the lines it touches in resolv.conf, for
example:
nameserver 192.168.1.1 # resolvd: iwm0

Anyone who thinks the "ignore dns" option does not work could help to debug
this with the following:

* run "route -n monitor"
* empty the dhcpleased.conf: mv /etc/dhcpleased.conf /etc/X.dhcpleased.conf
* cat /etc/resolv.conf, copy the output into an email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart 
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

then run dhcpleased with the configuration file:

* run "route -n monitor"
* mv /etc/X.dhcpleased.conf /etc/dhcpleased.conf
* cat /etc/dhcpleased.conf and copy the output into the email
* cat /etc/resolv.conf, copy the output into the email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

send that email as a reply to this thread.

Thanks,
Benno

> > On 30 Oct 2021, at 21:00, Sebastian Benoit  wrote:
> > 
> > ???Z?? Loff(zel...@zeloff.org) on 2021.10.29 18:30:29 +0100:
> >>> On Fri, Oct 29, 2021 at 03:37:56PM +0300, Samarul Meu wrote:
> >>> Hello to you all!
> >>> 
> >>> Prior to 7.0 I was using this line in /etc/dhclient.conf
> >>> supersede domain-name-servers 127.0.0.1;
> >>> so that I do not get the DNS from the ISP provider.
> >>> 
> >>> I am using unbound to resolve my queries. With the new changes I can not
> >>> get the same functionality.
> >>> 
> >>> I tried to add this in /etc/dhcpleased.conf
> >>> interface urtwn0 ignore dns
> >>> where urtwn0 is my interface or disable resolvd.
> >>> 
> >>> If resolvd is on I get my ISP DNS server, if not when unbound starts
> >>> resolvd  adds the ISP DNS server to resolv.conf.
> >>> 
> >>> Can you please tell me what am I doing wrong and how can I have only
> >>> 127.0.0.1 on the resolv.conf file?
> >>> 
> >>> Thank you!
> >> 
> >> This works for me:
> >> 
> >> 
> >> /etc/hostname.em0:
> >> 
> >>inet autoconf
> >> 
> >> 
> >> /etc/resolv.conf:
> >> 
> >>nameserver 127.0.0.1
> >> 
> >> 
> >> /etc/dhcpleased.conf:
> >> 
> >>interface em0 {
> >>ignore dns
> >>}
> > 
> > 
> > If you never intend to use other nameservers on this system, you can also
> > deactivate resolvd:
> > 
> >  rcctl stop resolvd
> >  rcctl disable resolvd
> > 
> > and remove dhcpleased.conf again.
> > 
> > 
> 

-- 



Re: boot error: 'entry point at 0xffffffff81001000'

2021-10-30 Thread J Dragu
It turned out to be a problem with the hardware, not the OS. My 
apologies. Thank you very much for your help.


On 10/28/21 10:01 PM, Mike Larkin wrote:

On Thu, Oct 28, 2021 at 09:26:33PM -0500, J Dragu wrote:

Trying with a snapshot returned the same error.

Here's what it tells me when I check machine memory:


Low ram: 634KB High ram: 3065328KB
Total free memory: 8179378KB

On Thu, Oct 28, 2021 at 20:04 Mike Larkin  wrote:


On Thu, Oct 28, 2021 at 06:57:46PM -0500, J Dragu wrote:

Hello,

I know there was a previous thread here about a perhaps similar issue
with 6.8 (?), but since from what I can tell it was fixed with 6.9
I figured I'd ask about my problem. If there's something obvious I'm
missing I do apologize!

I'm trying to install OpenBSD 7.0 on a Thinkpad T410 from a USB stick.
Whenever I try to boot in to the installer I get the following messages:


cannot open hd0a:/etc/random.seed: No such file or directory
booting hd0a:/7.0/amd64/bsd.rd: 38030471+1598464+3907256+0+704512

[109+288+28]=0x995530

entry point at 0x81001000

... at which point it becomes unresponsive. I've checked to make sure
the BIOS are up to date (1.45, going by Lenovo's website), and also
fiddled with some settings like disabling hyperthreading, to no avail.
I'm writing this email from my X61s (which is running 7.0 just fine)
and I tried putting this SSD in the T410 and got the exact same results,
so I suppose the issue isn't with the installer itself (?). Has anyone
else encountered this?

Thank you for reading.
J


2 things to try:

1. get a latest snap if you didn't already.

2. boot>   machine memory
  ... and show the result here.


You'll probably need to bisect builds and find where it started failing.

-ml




Re: Dhcp client configuration in 7.0

2021-10-30 Thread Arnoud Otten
Hi,

Maybe i am wrong and do not understand this right, but wat should  the “ignore 
dns” option do when used in the dhcpleased .conf config file?
Here @xs4all our IPTV network on a separate vlan also gets an ip address and 
the dhcp offer also sends a dns server which should be ignored. 
I also thought that with the “ignore dns” option, this dns server was blocked, 
but that is not what the option does? 

Regards,

Arnoud


> On 30 Oct 2021, at 21:00, Sebastian Benoit  wrote:
> 
> Z?? Loff(zel...@zeloff.org) on 2021.10.29 18:30:29 +0100:
>>> On Fri, Oct 29, 2021 at 03:37:56PM +0300, Samarul Meu wrote:
>>> Hello to you all!
>>> 
>>> Prior to 7.0 I was using this line in /etc/dhclient.conf
>>> supersede domain-name-servers 127.0.0.1;
>>> so that I do not get the DNS from the ISP provider.
>>> 
>>> I am using unbound to resolve my queries. With the new changes I can not
>>> get the same functionality.
>>> 
>>> I tried to add this in /etc/dhcpleased.conf
>>> interface urtwn0 ignore dns
>>> where urtwn0 is my interface or disable resolvd.
>>> 
>>> If resolvd is on I get my ISP DNS server, if not when unbound starts
>>> resolvd  adds the ISP DNS server to resolv.conf.
>>> 
>>> Can you please tell me what am I doing wrong and how can I have only
>>> 127.0.0.1 on the resolv.conf file?
>>> 
>>> Thank you!
>> 
>> This works for me:
>> 
>> 
>> /etc/hostname.em0:
>> 
>>inet autoconf
>> 
>> 
>> /etc/resolv.conf:
>> 
>>nameserver 127.0.0.1
>> 
>> 
>> /etc/dhcpleased.conf:
>> 
>>interface em0 {
>>ignore dns
>>}
> 
> 
> If you never intend to use other nameservers on this system, you can also
> deactivate resolvd:
> 
>  rcctl stop resolvd
>  rcctl disable resolvd
> 
> and remove dhcpleased.conf again.
> 
> 



Re: Dhcp client configuration in 7.0

2021-10-30 Thread Sebastian Benoit
Z?? Loff(zel...@zeloff.org) on 2021.10.29 18:30:29 +0100:
> On Fri, Oct 29, 2021 at 03:37:56PM +0300, Samarul Meu wrote:
> > Hello to you all!
> > 
> > Prior to 7.0 I was using this line in /etc/dhclient.conf
> > supersede domain-name-servers 127.0.0.1;
> > so that I do not get the DNS from the ISP provider.
> > 
> > I am using unbound to resolve my queries. With the new changes I can not
> > get the same functionality.
> > 
> > I tried to add this in /etc/dhcpleased.conf
> > interface urtwn0 ignore dns
> > where urtwn0 is my interface or disable resolvd.
> > 
> > If resolvd is on I get my ISP DNS server, if not when unbound starts
> > resolvd  adds the ISP DNS server to resolv.conf.
> > 
> > Can you please tell me what am I doing wrong and how can I have only
> > 127.0.0.1 on the resolv.conf file?
> > 
> > Thank you!
> 
> This works for me:
> 
> 
> /etc/hostname.em0:
> 
> inet autoconf
> 
> 
> /etc/resolv.conf:
> 
> nameserver 127.0.0.1
> 
> 
> /etc/dhcpleased.conf:
> 
> interface em0 {
> ignore dns
> }


If you never intend to use other nameservers on this system, you can also
deactivate resolvd:

  rcctl stop resolvd
  rcctl disable resolvd

and remove dhcpleased.conf again.
 



Re: Please recommend wifi 6 card which supports OpenBSD

2021-10-30 Thread Stuart Henderson
On 2021-10-30, Vilnius  wrote:
> Dear OpenBSD Community,
>
>
> I hope you are all doing well.
>
> I'm thinking about building OBSD based home router with wifi access point, 
> but I'm not sure which card I should pickup which would provide best 
> compatibility with OBSD. I'm looking with dual band support which most 
> importantly supports both 2.4/5ghz and also has support for AP and has no 
> issues with OBSD itself.
>
> Does this thing exist or doing wifi AP on OBSD is not really recommended like 
> some google searches suggest ? This is home based setup.

OpenBSD at most supports 11ac (and then only on very limited devices -
I think it's just bwfm, and I think you'll have a hard time finding one).

If you want a high performance wifi AP, use a separate device. (the
TP-Link Omada range are supposedly pretty good).

-- 
Please keep replies on the mailing list.



Re: Please recommend wifi 6 card which supports OpenBSD

2021-10-30 Thread Zé Loff
On Sat, Oct 30, 2021 at 11:17:31AM +, Vilnius wrote:
> Dear OpenBSD Community,
> 
> 
> I hope you are all doing well.
> 
> I'm thinking about building OBSD based home router with wifi access
> point, but I'm not sure which card I should pickup which would provide
> best compatibility with OBSD. I'm looking with dual band support which
> most importantly supports both 2.4/5ghz and also has support for AP
> and has no issues with OBSD itself.
> 
> Does this thing exist or doing wifi AP on OBSD is not really
> recommended like some google searches suggest ? This is home based
> setup.
> 
> Thanks
> 

As has been said before on more than one occasion, you'd be much better
off using a separate non-OpenBSD access point.  You get better WiFi
performance, more recent 802.11* protocols (AFAICT there is no support
for 802.11ax yet), sometimes the router's location isn't the most
appropriate for the AP, etc.

I tried using an OpenBSD box as a wifi router, but performance was poor,
and its was hard to know whether it was the antennas, the box's
location, the card's tx power, etc.  I then repurposed my ISP's wifi
router as an AP using a separate vlan, added some block rules on the
router's pf.conf to keep it from "calling home" and never looked back.

-- 
 



nested virtualization with vmm on hyper-v

2021-10-30 Thread Peter J. Philipp
Hi,

I'm a little confused by this.  I have an old Xeon e3-1275v3 computer that
runs windows server 2019 essentials natively.  It shares half it's RAM and
2 cores with OpenBSD as a hyper-v guest.

So after a long time of not looking into this I asked someone how they did
virtualization nesting and I got this link:

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization

So this is good, I thought, I followed the instructions, turned off the hyper-v,
did the powershell command, restarted hyper-v guest and got some indication by
OpenBSD that vmm is enabled:

arda$ dmesg | grep vmm
cpu0: using VERW MDS workaround (except on vmm entry)
vmm0 at mainbus0: VMX/EPT

Only when I start the vmm guest with vmctl and vmctl console, it boots me out
of console mode back into arda and the vmm guest is stopped.

So then I rebooted the entire machine to make sure that all BIOS settings are
correct.  And they are.  There is no CPU option that I can set here that would
disallow this nesting.

Here is the CPU options of arda (short of a dmesg):

cpu0: using VERW MDS workaround (except on vmm entry)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E3-1275 v3 @ 3.50GHz, 3498.01 MHz, 06-3c-03
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,HTT,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,XSAVEOPT,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 200MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Xeon(R) CPU E3-1275 v3 @ 3.50GHz, 3497.99 MHz, 06-3c-03
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,HTT,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,XSAVEOPT,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu0: using VERW MDS workaround (except on vmm entry)

Does anyone know how I can get vmm with nesting to function?  Is it a OpenBSD
problem or should I seek elsewhere?

Best Regards,
-peter



Re: Dhcp client configuration in 7.0

2021-10-30 Thread Samarul Meu
sâm., 30 oct. 2021, 03:10 Zé Loff  a scris:

> On Fri, Oct 29, 2021 at 09:57:26PM +0300, Samarul Meu wrote:
> > On Fri, Oct 29, 2021 at 8:30 PM Zé Loff  wrote:
> >
> > > This works for me:
> > >
> > >
> > > /etc/hostname.em0:
> > >
> > > inet autoconf
> > >
> > >
> > > /etc/resolv.conf:
> > >
> > > nameserver 127.0.0.1
> > >
> > >
> > > /etc/dhcpleased.conf:
> > >
> > > interface em0 {
> > > ignore dns
> > > }
> > >
> > >
> > My dhcpleased.conf is similar (interface urtwn0 ignore dns), but it does
> > not seem to work. resolvd just overwrites the resolv.conf with the ISP
> DNS.
> > If I disable resolvd and I leave only nameserver 127.0.0.1 the unbound
> > works as expected.
> >
> > Now, my question is when ignore dns from dhcpleased.conf is considered?
> The
> > man page states "Ignore nameservers from leases on this interface" but
> > maybe I am not reading it correctly?
>
> Is that the exact contents of your dhcpleased.conf?  Reading the man
> page, it seems that the curly brackets are mandatory, and if I change my
> config to "interface em0 ignore dns" dhcpleased warns about the syntax
> error (and doesn't start).
>

Yes, at first I was ignoring the curly brackets, but I received no warning
and still got an IP, but after I have seen your configuration I made the
change. Did not help,

The thing is that maybe I do not understand corectly the new way. I thought
that by specifying in dhcpleased.conf that you what to ignore the DNS then
resolvd will leave the resolved.conf untouched. In my case it does not
happen, so I have to just disable resolvd.

Thank you for your time! I will just leave resolvd disabled and resolv.conf
with only 127.0.0.1 in it.

>