From owner-svn-src-stable@freebsd.org Thu Jun 18 15:15:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECB41353213; Thu, 18 Jun 2020 15:15:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nlqF443lz4qcl; Thu, 18 Jun 2020 15:15:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDF4B7F9; Thu, 18 Jun 2020 15:15:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05IFF5iV048731; Thu, 18 Jun 2020 15:15:05 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05IFF4m1048727; Thu, 18 Jun 2020 15:15:04 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202006181515.05IFF4m1048727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 18 Jun 2020 15:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362329 - in stable/12/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Group: stable-12 X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in stable/12/sys: dev/xen/console dev/xen/control dev/xen/evtchn x86/xen X-SVN-Commit-Revision: 362329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 15:15:09 -0000 Author: royger Date: Thu Jun 18 15:15:04 2020 New Revision: 362329 URL: https://svnweb.freebsd.org/changeset/base/362329 Log: MFC r352925: xen/ctrl: acknowledge all control requests MFC r357616: xen/console: fix priority of Xen console MFC r361274: dev/xenstore: fix return with locks held Note this should be dev/evtchn not dev/xenstore. MFC r361578: xenpv: do not use low 1MB for Xen mappings on i386 MFC r361580: xen/control: short circuit xctrl_on_watch_event on spurious event Those are all Xen related fixes or minor improvements that have been sitting on current for a reasonable time without complaints. Sponsored by: Citrix Systems R&D Modified: stable/12/sys/dev/xen/console/xen_console.c stable/12/sys/dev/xen/control/control.c stable/12/sys/dev/xen/evtchn/evtchn_dev.c stable/12/sys/x86/xen/xenpv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/xen/console/xen_console.c ============================================================================== --- stable/12/sys/dev/xen/console/xen_console.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/console/xen_console.c Thu Jun 18 15:15:04 2020 (r362329) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -589,7 +590,7 @@ xencons_cnprobe(struct consdev *cp) if (!xen_domain()) return; - cp->cn_pri = CN_REMOTE; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; sprintf(cp->cn_name, "%s0", driver_name); } Modified: stable/12/sys/dev/xen/control/control.c ============================================================================== --- stable/12/sys/dev/xen/control/control.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/control/control.c Thu Jun 18 15:15:04 2020 (r362329) @@ -221,12 +221,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE * drivers need this. */ @@ -366,8 +360,13 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha error = xs_read(XST_NIL, "control", "shutdown", &result_len, (void **)&result); - if (error != 0) + if (error != 0 || result_len == 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error = xs_write(XST_NIL, "control", "shutdown", ""); + if (error != 0) + printf("unable to ack shutdown request, proceeding anyway\n"); reason = xctrl_shutdown_reasons; last_reason = reason + nitems(xctrl_shutdown_reasons); Modified: stable/12/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- stable/12/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/dev/xen/evtchn/evtchn_dev.c Thu Jun 18 15:15:04 2020 (r362329) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(&u->ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(&u->ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, &u->ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ Modified: stable/12/sys/x86/xen/xenpv.c ============================================================================== --- stable/12/sys/x86/xen/xenpv.c Thu Jun 18 15:14:10 2020 (r362328) +++ stable/12/sys/x86/xen/xenpv.c Thu Jun 18 15:15:04 2020 (r362329) @@ -54,12 +54,14 @@ __FBSDID("$FreeBSD$"); * prevent clashes with MMIO/ACPI regions. * * Since this is not possible on i386 just use any available memory - * chunk and hope we don't clash with anything else. + * chunk above 1MB and hope we don't clash with anything else. */ #ifdef __amd64__ #define LOW_MEM_LIMIT 0x100000000ul +#elif defined(__i386__) +#define LOW_MEM_LIMIT 0x100000ul #else -#define LOW_MEM_LIMIT 0 +#error "Unsupported architecture" #endif static devclass_t xenpv_devclass;