Re: dsdt: error while compiling with ACPI_MEMDEBUG

2017-04-14 Thread Philip Guenther
On Fri, 14 Apr 2017, Anton Lindqvist wrote:
> While compiling the GENERIC.MP kernel on amd64 with ACPI_MEMDEBUG 
> defined, I get the following error:
> 
> dsdt.c:411: warning: format '%x' expects type 'unsigned int', but 
> argument 4 has type 'long int'
> 
> Adding the 'l' modifier fixes the error.

Committed (with an additional line wrap).  Thanks!


Philip Guenther



Re: sparc64 ld fix

2017-04-14 Thread Philip Guenther
On Fri, Apr 14, 2017 at 6:22 AM, Mark Kettenis  wrote:
> Turns out that clang generates R_SPARC_WPLT30 relocations against
> local symbols, which our binutils doesn't handle.  Since the Solaris
> native assembler produces such relocations (and expects them to be
> handled as R_SPARC_WDISP30) and newer binutils handles them as well, I
> think we should as well.  The diff below fixes the issue expressed in
> a slightly different way as the fix that ended up in newer binutils
> versions.
>
> ok?

Looks like it could work.

ok guenther@



iked remove SA bundles

2017-04-14 Thread Alexander Bluhm
Hi,

iked does not use SA bundles.

Does anyone plan to implement this?
ok to remove the dead code?

bluhm

Index: sbin/iked/iked.h
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/iked/iked.h,v
retrieving revision 1.114
diff -u -p -r1.114 iked.h
--- sbin/iked/iked.h13 Apr 2017 07:04:09 -  1.114
+++ sbin/iked/iked.h14 Apr 2017 20:55:26 -
@@ -858,7 +858,7 @@ int  pfkey_flow_add(int fd, struct iked_
 int pfkey_flow_delete(int fd, struct iked_flow *);
 int pfkey_block(int, int, unsigned int);
 int pfkey_sa_init(int, struct iked_childsa *, uint32_t *);
-int pfkey_sa_add(int, struct iked_childsa *, struct iked_childsa *);
+int pfkey_sa_add(int, struct iked_childsa *);
 int pfkey_sa_delete(int, struct iked_childsa *);
 int pfkey_sa_last_used(int, struct iked_childsa *, uint64_t *);
 int pfkey_flush(int);
Index: sbin/iked/ikev2.c
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/iked/ikev2.c,v
retrieving revision 1.153
diff -u -p -r1.153 ikev2.c
--- sbin/iked/ikev2.c   13 Apr 2017 07:04:09 -  1.153
+++ sbin/iked/ikev2.c   14 Apr 2017 20:55:26 -
@@ -5080,7 +5080,7 @@ ikev2_childsa_enable(struct iked *env, s
if (csa->csa_rekey || csa->csa_loaded)
continue;
 
-   if (pfkey_sa_add(env->sc_pfkey, csa, NULL) != 0) {
+   if (pfkey_sa_add(env->sc_pfkey, csa) != 0) {
log_debug("%s: failed to load CHILD SA spi %s",
__func__, print_spi(csa->csa_spi.spi,
csa->csa_spi.spi_size));
Index: sbin/iked/pfkey.c
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/iked/pfkey.c,v
retrieving revision 1.57
diff -u -p -r1.57 pfkey.c
--- sbin/iked/pfkey.c   27 Mar 2017 10:29:02 -  1.57
+++ sbin/iked/pfkey.c   14 Apr 2017 20:56:46 -
@@ -101,8 +101,6 @@ int pfkey_map(const struct pfkey_constma
 intpfkey_flow(int, uint8_t, uint8_t, struct iked_flow *);
 intpfkey_sa(int, uint8_t, uint8_t, struct iked_childsa *);
 intpfkey_sa_getspi(int, uint8_t, struct iked_childsa *, uint32_t *);
-intpfkey_sagroup(int, uint8_t, uint8_t,
-   struct iked_childsa *, struct iked_childsa *);
 intpfkey_write(int, struct sadb_msg *, struct iovec *, int,
uint8_t **, ssize_t *);
 intpfkey_reply(int, uint8_t **, ssize_t *);
@@ -139,7 +137,7 @@ pfkey_couple(int sd, struct iked_sas *sa
RB_FOREACH(sa, iked_sas, sas) {
TAILQ_FOREACH(csa, >sa_childsas, csa_entry) {
if (!csa->csa_loaded && couple)
-   (void)pfkey_sa_add(sd, csa, NULL);
+   (void)pfkey_sa_add(sd, csa);
else if (csa->csa_loaded && !couple)
(void)pfkey_sa_delete(sd, csa);
}
@@ -964,119 +962,6 @@ done:
 }
 
 int
-pfkey_sagroup(int sd, uint8_t satype1, uint8_t action,
-struct iked_childsa *sa1, struct iked_childsa *sa2)
-{
-   struct sadb_msg smsg;
-   struct sadb_sa  sadb1, sadb2;
-   struct sadb_address sa_dst1, sa_dst2;
-   struct sockaddr_storage sdst1, sdst2;
-   struct sadb_protocolsa_proto;
-   struct ioveciov[IOV_CNT];
-   int iov_cnt;
-   uint8_t satype2;
-
-   if (pfkey_map(pfkey_satype, sa2->csa_saproto, ) == -1)
-   return (-1);
-
-   bzero(, sizeof(sdst1));
-   memcpy(, >csa_peer->addr, sizeof(sdst1));
-   if (socket_af((struct sockaddr *), 0) == -1) {
-   log_warnx("%s: unsupported address family %d",
-   __func__, sdst1.ss_family);
-   return (-1);
-   }
-
-   bzero(, sizeof(sdst2));
-   memcpy(, >csa_peer->addr, sizeof(sdst2));
-   if (socket_af((struct sockaddr *), 0) == -1) {
-   log_warnx("%s: unsupported address family %d",
-   __func__, sdst2.ss_family);
-   return (-1);
-   }
-
-   bzero(, sizeof(smsg));
-   smsg.sadb_msg_version = PF_KEY_V2;
-   smsg.sadb_msg_seq = ++sadb_msg_seq;
-   smsg.sadb_msg_pid = getpid();
-   smsg.sadb_msg_len = sizeof(smsg) / 8;
-   smsg.sadb_msg_type = action;
-   smsg.sadb_msg_satype = satype1;
-
-   bzero(, sizeof(sadb1));
-   sadb1.sadb_sa_len = sizeof(sadb1) / 8;
-   sadb1.sadb_sa_exttype = SADB_EXT_SA;
-   sadb1.sadb_sa_spi = htonl(sa1->csa_spi.spi);
-   sadb1.sadb_sa_state = SADB_SASTATE_MATURE;
-
-   bzero(, sizeof(sadb2));
-   sadb2.sadb_sa_len = sizeof(sadb2) / 8;
-   sadb2.sadb_sa_exttype = SADB_X_EXT_SA2;
-   sadb2.sadb_sa_spi = htonl(sa2->csa_spi.spi);
-   sadb2.sadb_sa_state = SADB_SASTATE_MATURE;
-   iov_cnt = 0;
-
-   

ipsecctl rename SA bundles

2017-04-14 Thread Alexander Bluhm
Hi,

Rename all SA groups to bundles consistently.  The first kernel
commit in 2000 that introduced the features already called them SA
bundles.  The word group is taken for Diffie-Hellman.

ok?

bluhm

Index: sbin/ipsecctl/ipsecctl.c
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/ipsecctl/ipsecctl.c,v
retrieving revision 1.81
diff -u -p -r1.81 ipsecctl.c
--- sbin/ipsecctl/ipsecctl.c2 Mar 2017 17:44:32 -   1.81
+++ sbin/ipsecctl/ipsecctl.c14 Apr 2017 18:43:56 -
@@ -48,7 +48,7 @@ void   ipsecctl_print_port(u_int16_t, co
 voidipsecctl_print_key(struct ipsec_key *);
 voidipsecctl_print_flow(struct ipsec_rule *, int);
 voidipsecctl_print_sa(struct ipsec_rule *, int);
-voidipsecctl_print_sagroup(struct ipsec_rule *, int);
+voidipsecctl_print_sabundle(struct ipsec_rule *, int);
 int ipsecctl_flush(int);
 voidipsecctl_get_rules(struct ipsecctl *);
 voidipsecctl_print_title(char *);
@@ -103,7 +103,7 @@ ipsecctl_rules(char *filename, int opts)
bzero(, sizeof(ipsec));
ipsec.opts = opts;
TAILQ_INIT(_queue);
-   TAILQ_INIT(_queue);
+   TAILQ_INIT(_queue);
 
if (parse_rules(filename, ) < 0) {
warnx("Syntax error in config file: ipsec rules not loaded");
@@ -119,7 +119,7 @@ ipsecctl_rules(char *filename, int opts)
 
}
 
-   /* This also frees the rules in ipsec.group_queue. */
+   /* This also frees the rules in ipsec.bundle_queue. */
while ((rp = TAILQ_FIRST(_queue))) {
TAILQ_REMOVE(_queue, rp, rule_entry);
ipsecctl_free_rule(rp);
@@ -382,9 +382,9 @@ ipsecctl_print_sa(struct ipsec_rule *r, 
 }
 
 void
-ipsecctl_print_sagroup(struct ipsec_rule *r, int opts)
+ipsecctl_print_sabundle(struct ipsec_rule *r, int opts)
 {
-   printf("[group %s to ", satype[r->proto]);
+   printf("[bundle %s to ", satype[r->proto]);
ipsecctl_print_addr(r->dst);
printf(" spi 0x%08x with %s to ", r->spi, satype[r->proto2]);
ipsecctl_print_addr(r->dst2);
@@ -405,8 +405,8 @@ ipsecctl_print_rule(struct ipsec_rule *r
ipsecctl_print_sa(r, opts);
if (r->type & RULE_IKE)
ike_print_config(r, opts);
-   if (r->type & RULE_GROUP)
-   ipsecctl_print_sagroup(r, opts);
+   if (r->type & RULE_BUNDLE)
+   ipsecctl_print_sabundle(r, opts);
 }
 
 int
Index: sbin/ipsecctl/ipsecctl.h
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/ipsecctl/ipsecctl.h,v
retrieving revision 1.70
diff -u -p -r1.70 ipsecctl.h
--- sbin/ipsecctl/ipsecctl.h14 Apr 2017 18:06:28 -  1.70
+++ sbin/ipsecctl/ipsecctl.h14 Apr 2017 18:43:56 -
@@ -37,7 +37,7 @@ enum {
 #define RULE_FLOW  0x01
 #define RULE_SA0x02
 #define RULE_IKE   0x04
-#define RULE_GROUP 0x08
+#define RULE_BUNDLE0x08
 
 enum {
DIRECTION_UNKNOWN, IPSEC_IN, IPSEC_OUT, IPSEC_INOUT
@@ -169,7 +169,7 @@ extern const struct ipsec_xf authxfs[];
 extern const struct ipsec_xf encxfs[];
 extern const struct ipsec_xf compxfs[];
 
-TAILQ_HEAD(dst_group_queue, ipsec_rule);
+TAILQ_HEAD(dst_bundle_queue, ipsec_rule);
 
 /* Complete state of one rule. */
 struct ipsec_rule {
@@ -212,21 +212,21 @@ struct ipsec_rule {
u_int32_tnr;
 
TAILQ_ENTRY(ipsec_rule) rule_entry;
-   TAILQ_ENTRY(ipsec_rule) group_entry;
-   TAILQ_ENTRY(ipsec_rule) dst_group_entry;
+   TAILQ_ENTRY(ipsec_rule) bundle_entry;
+   TAILQ_ENTRY(ipsec_rule) dst_bundle_entry;
 
-   struct dst_group_queue  dst_group_queue;
+   struct dst_bundle_queue dst_bundle_queue;
char*bundle;
 };
 
 TAILQ_HEAD(ipsec_rule_queue, ipsec_rule);
-TAILQ_HEAD(ipsec_group_queue, ipsec_rule);
+TAILQ_HEAD(ipsec_bundle_queue, ipsec_rule);
 
 struct ipsecctl {
u_int32_t   rule_nr;
int opts;
struct ipsec_rule_queue rule_queue;
-   struct ipsec_group_queue group_queue;
+   struct ipsec_bundle_queue bundle_queue;
 };
 
 intparse_rules(const char *, struct ipsecctl *);
Index: sbin/ipsecctl/parse.y
===
RCS file: /data/mirror/openbsd/cvs/src/sbin/ipsecctl/parse.y,v
retrieving revision 1.167
diff -u -p -r1.167 parse.y
--- sbin/ipsecctl/parse.y   14 Apr 2017 18:06:28 -  1.167
+++ sbin/ipsecctl/parse.y   14 Apr 2017 18:43:56 -
@@ -191,7 +191,7 @@ struct ipsec_rule   *create_sa(u_int8_t, u
 struct ipsec_key *, struct ipsec_key *);
 struct ipsec_rule  *reverse_sa(struct ipsec_rule *, u_int32_t,
 struct ipsec_key *, struct ipsec_key *);
-struct ipsec_rule  *create_sagroup(struct ipsec_addr_wrap *, u_int8_t,
+struct ipsec_rule

Re: vmd: VMs with auto-configured L3 interfaces (call for testing)

2017-04-14 Thread Josh Grosse
On Wed, Apr 12, 2017 at 01:44:48PM +0200, Reyk Floeter wrote:
> Hi,
> 
> we want to make it easier to run NAT'ed and auto-configured VMs that
> don't need switches, L2, manual scripts, or any additional servers on
> the host.  I wrote a new mode that just needs vmd, pf, and forwarding.

Tested on an amd64 host with both amd64 and i386 guests.  Works fine
with both.

I especially enjoy the fixed IP address 100.64..3, which makes
it a snap to ssh into.

Thanks, Reyk!



Re: vmd: VMs with auto-configured L3 interfaces (call for testing)

2017-04-14 Thread Josh Grosse
On Fri, Apr 14, 2017 at 12:29:53PM -0400, Josh Grosse wrote:
> Tested on an amd64 host... 

Following up on my own post to state this was tested both
with "local" in vm.conf as well as with vmctl -L.



sparc64 ld fix

2017-04-14 Thread Mark Kettenis
Turns out that clang generates R_SPARC_WPLT30 relocations against
local symbols, which our binutils doesn't handle.  Since the Solaris
native assembler produces such relocations (and expects them to be
handled as R_SPARC_WDISP30) and newer binutils handles them as well, I
think we should as well.  The diff below fixes the issue expressed in
a slightly different way as the fix that ended up in newer binutils
versions.

ok?


Index: gnu/usr.bin/binutils-2.17/bfd/elfxx-sparc.c
===
RCS file: /cvs/src/gnu/usr.bin/binutils-2.17/bfd/elfxx-sparc.c,v
retrieving revision 1.6
diff -u -p -r1.6 elfxx-sparc.c
--- gnu/usr.bin/binutils-2.17/bfd/elfxx-sparc.c 3 Sep 2016 10:03:26 -   
1.6
+++ gnu/usr.bin/binutils-2.17/bfd/elfxx-sparc.c 14 Apr 2017 13:12:03 -
@@ -1280,6 +1280,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, 
goto r_sparc_plt32;
  break;
}
+ else if (r_type == R_SPARC_WPLT30)
+   break;
 
  /* It does not make sense to have a procedure linkage
  table entry for a local symbol.  */
@@ -2676,6 +2678,11 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 for a local symbol if you assemble a call from one
 section to another when using -K pic.  We treat it as
 WDISP30.  */
+ if (h == NULL)
+   break;
+   }
+ else if (r_type == R_SPARC_WPLT30)
+   {
  if (h == NULL)
break;
}



Re: arm64 pmap tlb flushing diff

2017-04-14 Thread Patrick Wildt
On Fri, Apr 14, 2017 at 11:51:52AM +0200, Mark Kettenis wrote:
> While reading the arm64 code the ranges covered by the tlb flushes in
> the code that sets the l1/l2/l3 tables made no sense to me.  I came to
> the conclusion that these flushes aren't necessary.  When we enter the
> final page table entry, we flush the tlb again which flushes any
> cached information for the l1/l2/l3 tables anyway.  This means the
> code that flushes ranges can go and arm64_tlbi_asid() can be folded
> into the ttlb_flush() function.  One additional fix there.  My
> previous changes made the asid == -1 branch unreachable.  I think that
> means that page table entries marked as global are actually flushed
> even if the flush targets a specific ASID.  But the architecture
> manual isn't very explicit about this.  So I reactivated the branch by
> changing the test to pm == pmap_kernel().
> 
> In the end this doesn't change the performance in a measurable way, but less 
> code is always better isn't it?
> 
> ok?
> 
> 
> Index: arch/arm64/arm64/pmap.c
> ===
> RCS file: /cvs/src/sys/arch/arm64/arm64/pmap.c,v
> retrieving revision 1.32
> diff -u -p -r1.32 pmap.c
> --- arch/arm64/arm64/pmap.c   13 Apr 2017 20:48:29 -  1.32
> +++ arch/arm64/arm64/pmap.c   14 Apr 2017 09:27:22 -
> @@ -35,7 +35,6 @@
>  #include 
>  
>  void pmap_setttb(struct proc *p);
> -void arm64_tlbi_asid(vaddr_t va, int asid);
>  void pmap_free_asid(pmap_t pm);
>  
>  /*
> @@ -68,34 +67,13 @@ pmap_pa_is_mem(uint64_t pa)
>  static inline void
>  ttlb_flush(pmap_t pm, vaddr_t va)
>  {
> - arm64_tlbi_asid(va, pm->pm_asid);
> -}
> -
> -static inline void
> -ttlb_flush_range(pmap_t pm, vaddr_t va, vsize_t size)
> -{
> - vaddr_t eva = va + size;
> -
> - /* if size is over 512 pages, just flush the entire cache !?!?! */
> - if (size >= (512 * PAGE_SIZE)) {
> - cpu_tlb_flush();
> - return;
> - }
> -
> - for ( ; va < eva; va += PAGE_SIZE)
> - arm64_tlbi_asid(va, pm->pm_asid);
> -}
> -
> -void
> -arm64_tlbi_asid(vaddr_t va, int asid)
> -{
>   vaddr_t resva;
>  
>   resva = ((va >> PAGE_SHIFT) & ((1ULL << 44) - 1));
> - if (asid == -1) {
> + if (pm == pmap_kernel()) {
>   cpu_tlb_flush_all_asid(resva);
>   } else {
> - resva |= (unsigned long long)asid << 48;
> + resva |= (uint64_t)pm->pm_asid << 48;
>   cpu_tlb_flush_asid(resva);
>   }
>  }
> @@ -1267,8 +1245,6 @@ pmap_set_l1(struct pmap *pm, uint64_t va
>   idx0 = VP_IDX0(va);
>   pm->pm_vp.l0->vp[idx0] = l1_va;
>   pm->pm_vp.l0->l0[idx0] = pg_entry;
> -
> - ttlb_flush_range(pm, va & ~PAGE_MASK, 1<  }
>  
>  void
> @@ -1299,8 +1275,6 @@ pmap_set_l2(struct pmap *pm, uint64_t va
>   vp1 = pm->pm_vp.l1;
>   vp1->vp[idx1] = l2_va;
>   vp1->l1[idx1] = pg_entry;
> -
> - ttlb_flush_range(pm, va & ~PAGE_MASK, 1<  }
>  
>  void
> @@ -1334,8 +1308,6 @@ pmap_set_l3(struct pmap *pm, uint64_t va
>   vp2 = vp1->vp[idx1];
>   vp2->vp[idx2] = l3_va;
>   vp2->l2[idx2] = pg_entry;
> -
> - ttlb_flush_range(pm, va & ~PAGE_MASK, 1<  }
>  
>  /*
> @@ -1578,7 +1550,7 @@ pmap_pte_remove(struct pte_desc *pted, i
>   if (remove_pted)
>   vp3->vp[VP_IDX3(pted->pted_va)] = NULL;
>  
> - arm64_tlbi_asid(pted->pted_va, pm->pm_asid);
> + ttlb_flush(pm, pted->pted_va);

Other callers pass pted->pted_va & ~PAGE_MASK, but since ttlb_flush()
is doing va >> PAGE_SHIFT this probably isn't needed anyway.  Might
make sense to remove those from the other calls as well.  Afaik it
was simply for being explicit that we should pass a VA and skip its
attributes stored in the lower bits.

Diff doesn't make it any worse on my Seattle, ok patrick@.

Patrick

>  }
>  
>  /*
> 



arm64 pmap tlb flushing diff

2017-04-14 Thread Mark Kettenis
While reading the arm64 code the ranges covered by the tlb flushes in
the code that sets the l1/l2/l3 tables made no sense to me.  I came to
the conclusion that these flushes aren't necessary.  When we enter the
final page table entry, we flush the tlb again which flushes any
cached information for the l1/l2/l3 tables anyway.  This means the
code that flushes ranges can go and arm64_tlbi_asid() can be folded
into the ttlb_flush() function.  One additional fix there.  My
previous changes made the asid == -1 branch unreachable.  I think that
means that page table entries marked as global are actually flushed
even if the flush targets a specific ASID.  But the architecture
manual isn't very explicit about this.  So I reactivated the branch by
changing the test to pm == pmap_kernel().

In the end this doesn't change the performance in a measurable way, but less 
code is always better isn't it?

ok?


Index: arch/arm64/arm64/pmap.c
===
RCS file: /cvs/src/sys/arch/arm64/arm64/pmap.c,v
retrieving revision 1.32
diff -u -p -r1.32 pmap.c
--- arch/arm64/arm64/pmap.c 13 Apr 2017 20:48:29 -  1.32
+++ arch/arm64/arm64/pmap.c 14 Apr 2017 09:27:22 -
@@ -35,7 +35,6 @@
 #include 
 
 void pmap_setttb(struct proc *p);
-void arm64_tlbi_asid(vaddr_t va, int asid);
 void pmap_free_asid(pmap_t pm);
 
 /*
@@ -68,34 +67,13 @@ pmap_pa_is_mem(uint64_t pa)
 static inline void
 ttlb_flush(pmap_t pm, vaddr_t va)
 {
-   arm64_tlbi_asid(va, pm->pm_asid);
-}
-
-static inline void
-ttlb_flush_range(pmap_t pm, vaddr_t va, vsize_t size)
-{
-   vaddr_t eva = va + size;
-
-   /* if size is over 512 pages, just flush the entire cache !?!?! */
-   if (size >= (512 * PAGE_SIZE)) {
-   cpu_tlb_flush();
-   return;
-   }
-
-   for ( ; va < eva; va += PAGE_SIZE)
-   arm64_tlbi_asid(va, pm->pm_asid);
-}
-
-void
-arm64_tlbi_asid(vaddr_t va, int asid)
-{
vaddr_t resva;
 
resva = ((va >> PAGE_SHIFT) & ((1ULL << 44) - 1));
-   if (asid == -1) {
+   if (pm == pmap_kernel()) {
cpu_tlb_flush_all_asid(resva);
} else {
-   resva |= (unsigned long long)asid << 48;
+   resva |= (uint64_t)pm->pm_asid << 48;
cpu_tlb_flush_asid(resva);
}
 }
@@ -1267,8 +1245,6 @@ pmap_set_l1(struct pmap *pm, uint64_t va
idx0 = VP_IDX0(va);
pm->pm_vp.l0->vp[idx0] = l1_va;
pm->pm_vp.l0->l0[idx0] = pg_entry;
-
-   ttlb_flush_range(pm, va & ~PAGE_MASK, 1<pm_vp.l1;
vp1->vp[idx1] = l2_va;
vp1->l1[idx1] = pg_entry;
-
-   ttlb_flush_range(pm, va & ~PAGE_MASK, 1<vp[idx1];
vp2->vp[idx2] = l3_va;
vp2->l2[idx2] = pg_entry;
-
-   ttlb_flush_range(pm, va & ~PAGE_MASK, 1<vp[VP_IDX3(pted->pted_va)] = NULL;
 
-   arm64_tlbi_asid(pted->pted_va, pm->pm_asid);
+   ttlb_flush(pm, pted->pted_va);
 }
 
 /*



vmm/amd64 __func__

2017-04-14 Thread Michael W. Bombardieri
Hi,

This patch is a continuation of
https://marc.info/?l=openbsd-tech=149214401819485=2

* Make __func__ usage more consistent in vmm/amd64
* Typo cant->can't in the following error messages...

vcpu_run_vmx: cant read exit reason
vmm_get_exit_qualification: cant extract exit qual

* One error message was missing space in string continuation:

vcpu_run_vmx: can't readprocbased ctls on exit

- Michael


Index: vmm.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/vmm.c,v
retrieving revision 1.132
diff -u -p -u -r1.132 vmm.c
--- vmm.c   2 Apr 2017 20:21:44 -   1.132
+++ vmm.c   14 Apr 2017 08:18:03 -
@@ -427,7 +427,7 @@ vmmioctl(dev_t dev, u_long cmd, caddr_t 
ret = vm_rwregs((struct vm_rwregs_params *)data, 1);
break;
default:
-   DPRINTF("vmmioctl: unknown ioctl code 0x%lx\n", cmd);
+   DPRINTF("%s: unknown ioctl code 0x%lx\n", __func__, cmd);
ret = ENOTTY;
}
 
@@ -502,7 +502,7 @@ vm_resetcpu(struct vm_resetcpu_params *v
 
/* Not found? exit. */
if (error != 0) {
-   DPRINTF("vm_resetcpu: vm id %u not found\n",
+   DPRINTF("%s: vm id %u not found\n", __func__,
vrp->vrp_vm_id);
return (error);
}
@@ -515,25 +515,25 @@ vm_resetcpu(struct vm_resetcpu_params *v
rw_exit_read(>vm_vcpu_lock);
 
if (vcpu == NULL) {
-   DPRINTF("vm_resetcpu: vcpu id %u of vm %u not found\n",
-   vrp->vrp_vcpu_id, vrp->vrp_vm_id);
+   DPRINTF("%s: vcpu id %u of vm %u not found\n",
+   __func__, vrp->vrp_vcpu_id, vrp->vrp_vm_id);
return (ENOENT);
}
 
if (vcpu->vc_state != VCPU_STATE_STOPPED) {
-   DPRINTF("vm_resetcpu: reset of vcpu %u on vm %u attempted "
-   "while vcpu was in state %u (%s)\n", vrp->vrp_vcpu_id,
+   DPRINTF("%s: reset of vcpu %u on vm %u attempted "
+   "while vcpu was in state %u (%s)\n", __func__, 
vrp->vrp_vcpu_id,
vrp->vrp_vm_id, vcpu->vc_state,
vcpu_state_decode(vcpu->vc_state));

return (EBUSY);
}
 
-   DPRINTF("vm_resetcpu: resetting vm %d vcpu %d to power on defaults\n",
-   vm->vm_id, vcpu->vc_id);
+   DPRINTF("%s: resetting vm %d vcpu %d to power on defaults\n",
+   __func__, vm->vm_id, vcpu->vc_id);
 
if (vcpu_reset_regs(vcpu, >vrp_init_state)) {
-   printf("vm_resetcpu: failed\n");
+   printf("%s: failed\n", __func__);
 #ifdef VMM_DEBUG
dump_vcpu(vcpu);
 #endif /* VMM_DEBUG */
@@ -1095,7 +1095,7 @@ vm_impl_init_vmx(struct vm *vm, struct p
/* Create a new pmap for this VM */
pmap = pmap_create();
if (!pmap) {
-   printf("vm_impl_init_vmx: pmap_create failed\n");
+   printf("%s: pmap_create failed\n", __func__);
return (ENOMEM);
}
 
@@ -,20 +,20 @@ vm_impl_init_vmx(struct vm *vm, struct p
VM_MAP_ISVMSPACE | VM_MAP_PAGEABLE);
 
if (!vm->vm_map) {
-   printf("vm_impl_init_vmx: uvm_map_create failed\n");
+   printf("%s: uvm_map_create failed\n", __func__);
pmap_destroy(pmap);
return (ENOMEM);
}
 
/* Map the new map with an anon */
-   DPRINTF("vm_impl_init_vmx: created vm_map @ %p\n", vm->vm_map);
+   DPRINTF("%s: created vm_map @ %p\n", __func__, vm->vm_map);
for (i = 0; i < vm->vm_nmemranges; i++) {
vmr = >vm_memranges[i];
ret = uvm_share(vm->vm_map, vmr->vmr_gpa,
PROT_READ | PROT_WRITE | PROT_EXEC,
>p_vmspace->vm_map, vmr->vmr_va, vmr->vmr_size);
if (ret) {
-   printf("vm_impl_init_vmx: uvm_share failed (%d)\n",
+   printf("%s: uvm_share failed (%d)\n", __func__,
ret);
/* uvm_map_deallocate calls pmap_destroy for us */
uvm_map_deallocate(vm->vm_map);
@@ -1136,7 +1136,7 @@ vm_impl_init_vmx(struct vm *vm, struct p
/* Convert the low 512GB of the pmap to EPT */
ret = pmap_convert(pmap, PMAP_TYPE_EPT);
if (ret) {
-   printf("vm_impl_init_vmx: pmap_convert failed\n");
+   printf("%s: pmap_convert failed\n", __func__);
/* uvm_map_deallocate calls pmap_destroy for us */
uvm_map_deallocate(vm->vm_map);
vm->vm_map = NULL;
@@ -1174,7 +1174,7 @@ vm_impl_init_svm(struct vm *vm, struct p
/* Create a new pmap for this VM */
pmap = pmap_create();
if (!pmap) {
-   printf("vm_impl_init_svm: pmap_create failed\n");
+   printf("%s: 

nsd 4.1.16

2017-04-14 Thread Florian Obser
rc1 is out, running fine here with minimal-responses: yes for some time

tests/OKs?

diff --git configlexer.lex configlexer.lex
index 42dbd152f16..547e7db3e02 100644
--- configlexer.lex
+++ configlexer.lex
@@ -271,6 +271,7 @@ zonefiles-check{COLON}  { LEXOUT(("v(%s) ", yytext)); 
return VAR_ZONEFILES_CHECK;
 zonefiles-write{COLON} { LEXOUT(("v(%s) ", yytext)); return 
VAR_ZONEFILES_WRITE;}
 log-time-ascii{COLON}  { LEXOUT(("v(%s) ", yytext)); return 
VAR_LOG_TIME_ASCII;}
 round-robin{COLON} { LEXOUT(("v(%s) ", yytext)); return VAR_ROUND_ROBIN;}
+minimal-responses{COLON} { LEXOUT(("v(%s) ", yytext)); return 
VAR_MINIMAL_RESPONSES;}
 max-refresh-time{COLON}{ LEXOUT(("v(%s) ", yytext)); return 
VAR_MAX_REFRESH_TIME;}
 min-refresh-time{COLON}{ LEXOUT(("v(%s) ", yytext)); return 
VAR_MIN_REFRESH_TIME;}
 max-retry-time{COLON}  { LEXOUT(("v(%s) ", yytext)); return 
VAR_MAX_RETRY_TIME;}
diff --git configparser.y configparser.y
index bf20db12c72..36c87c44d19 100644
--- configparser.y
+++ configparser.y
@@ -71,7 +71,7 @@ extern config_parser_state_type* cfg_parser;
 %token VAR_ROUND_ROBIN VAR_ZONESTATS VAR_REUSEPORT VAR_VERSION
 %token VAR_MAX_REFRESH_TIME VAR_MIN_REFRESH_TIME
 %token VAR_MAX_RETRY_TIME VAR_MIN_RETRY_TIME
-%token VAR_MULTI_MASTER_CHECK
+%token VAR_MULTI_MASTER_CHECK VAR_MINIMAL_RESPONSES
 
 %%
 toplevelvars: /* empty */ | toplevelvars toplevelvar ;
@@ -102,7 +102,8 @@ content_server: server_ip_address | server_ip_transparent | 
server_debug_mode |
server_rrl_ipv4_prefix_length | server_rrl_ipv6_prefix_length | 
server_rrl_whitelist_ratelimit |
server_zonefiles_check | server_do_ip4 | server_do_ip6 |
server_zonefiles_write | server_log_time_ascii | server_round_robin |
-   server_reuseport | server_version | server_ip_freebind;
+   server_reuseport | server_version | server_ip_freebind |
+   server_minimal_responses;
 server_ip_address: VAR_IP_ADDRESS STRING 
{ 
OUTYY(("P(server_ip_address:%s)\n", $2)); 
@@ -292,6 +293,17 @@ server_round_robin: VAR_ROUND_ROBIN STRING
}
}
;
+server_minimal_responses: VAR_MINIMAL_RESPONSES STRING 
+   { 
+   OUTYY(("P(server_minimal_responses:%s)\n", $2)); 
+   if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+   yyerror("expected yes or no.");
+   else {
+   cfg_parser->opt->minimal_responses = (strcmp($2, 
"yes")==0);
+   minimal_responses = cfg_parser->opt->minimal_responses;
+   }
+   }
+   ;
 server_server_count: VAR_SERVER_COUNT STRING
{ 
OUTYY(("P(server_server_count:%s)\n", $2)); 
diff --git configure configure
index b77177afc5b..f7a3001de55 100644
--- configure
+++ configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for NSD 4.1.15.
+# Generated by GNU Autoconf 2.69 for NSD 4.1.16.
 #
 # Report bugs to .
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='NSD'
 PACKAGE_TARNAME='nsd'
-PACKAGE_VERSION='4.1.15'
-PACKAGE_STRING='NSD 4.1.15'
+PACKAGE_VERSION='4.1.16'
+PACKAGE_STRING='NSD 4.1.16'
 PACKAGE_BUGREPORT='nsd-b...@nlnetlabs.nl'
 PACKAGE_URL=''
 
@@ -1284,7 +1284,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures NSD 4.1.15 to adapt to many kinds of systems.
+\`configure' configures NSD 4.1.16 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1345,7 +1345,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of NSD 4.1.15:";;
+ short | recursive ) echo "Configuration of NSD 4.1.16:";;
esac
   cat <<\_ACEOF
 
@@ -1491,7 +1491,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NSD configure 4.1.15
+NSD configure 4.1.16
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2200,7 +2200,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by NSD $as_me 4.1.15, which was
+It was created by NSD $as_me 4.1.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -9717,7 +9717,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by NSD $as_me 4.1.15, which was
+This file was extended by NSD $as_me 4.1.16, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -9779,7 +9779,7 

dsdt: error while compiling with ACPI_MEMDEBUG

2017-04-14 Thread Anton Lindqvist
Hi,
While compiling the GENERIC.MP kernel on amd64 with ACPI_MEMDEBUG
defined, I get the following error:

dsdt.c:411: warning: format '%x' expects type 'unsigned int',
but argument 4 has type 'long int'

Adding the 'l' modifier fixes the error.

Index: dsdt.c
===
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
retrieving revision 1.232
diff -u -p -r1.232 dsdt.c
--- dsdt.c  8 Apr 2017 01:20:10 -   1.232
+++ dsdt.c  13 Apr 2017 19:16:55 -
@@ -406,7 +406,7 @@ acpi_walkmem(int sig, const char *lbl)
 {
struct acpi_memblock *sptr;
 
-   printf("--- walkmem:%s %x --- %x bytes alloced\n", lbl, sig, 
acpi_nalloc);
+   printf("--- walkmem:%s %x --- %lx bytes alloced\n", lbl, sig, 
acpi_nalloc);
LIST_FOREACH(sptr, _memhead, link) {
if (sptr->sig < sig)
break;