Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen add KASSERT() for unaligned case to make su...



details:   https://anonhg.NetBSD.org/src/rev/d9d63141ce58
branches:  trunk
changeset: 1009098:d9d63141ce58
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Apr 12 18:14:09 2020 +0000

description:
add KASSERT() for unaligned case to make sure it indeed happens only
for requests via physio

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r b7e03689b0ff -r d9d63141ce58 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Sun Apr 12 17:49:00 2020 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Sun Apr 12 18:14:09 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.103 2020/04/11 17:52:01 jdolecek Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.104 2020/04/12 18:14:09 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.103 2020/04/11 17:52:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.104 2020/04/12 18:14:09 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -985,6 +985,9 @@
        xbdreq->req_bp = bp;
        xbdreq->req_data = bp->b_data;
        if (__predict_false((vaddr_t)bp->b_data & (XEN_BSIZE - 1))) {
+               /* Only can get here if this is physio() request */
+               KASSERT(bp->b_saveaddr != NULL);
+
                sc->sc_cnt_map_unalign.ev_count++;
 
                if (__predict_false(xbd_map_align(xbdreq) != 0)) {



Home | Main Index | Thread Index | Old Index