All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Chris Metcalf <cmetcalf@tilera.com>
Subject: [ 046/102] tile: support new Tilera hypervisor
Date: Fri, 17 May 2013 14:36:01 -0700	[thread overview]
Message-ID: <20130517213249.170527597@linuxfoundation.org> (raw)
In-Reply-To: <20130517213244.277411019@linuxfoundation.org>

3.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Metcalf <cmetcalf@tilera.com>

commit c539914dcd9a68c63305e055b14115a6a19578a8 upstream.

The Tilera hypervisor shipped in releases up through MDE 4.1 launches
the client operating system (i.e. Linux) at privilege level 1 (PL1).
Starting with MDE 4.2, as part of the work to enable KVM, the
Tilera hypervisor launches Linux at PL2 instead.

This commit makes the KERNEL_PL option default to 2 for tilegx, while
still saying at 1 for tilepro, which doesn't have an updated hypervisor.
It also explains how and when you might want to choose another value.
In addition, we change a small buglet in the on-chip Ethernet driver,
where we were failing to use the KERNEL_PL constant in an API call.

To make the transition cleaner, this change also provides the updated
hv_init() API for the new hypervisor that supports announcing Linux's
compiled-in PL, so the hypervisor can generate a suitable error in the
case of a mismatched hypervisor and Linux binary.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/tile/Kconfig                  |   14 ++++++++++----
 arch/tile/include/hv/hypervisor.h  |   27 ++++++++++++++++++++++++---
 arch/tile/kernel/head_32.S         |    2 +-
 arch/tile/kernel/head_64.S         |   12 +++++++++---
 drivers/net/ethernet/tile/tilegx.c |    2 +-
 5 files changed, 45 insertions(+), 12 deletions(-)

--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -368,11 +368,17 @@ config HARDWALL
 config KERNEL_PL
 	int "Processor protection level for kernel"
 	range 1 2
-	default "1"
+	default 2 if TILEGX
+	default 1 if !TILEGX
 	---help---
-	  This setting determines the processor protection level the
-	  kernel will be built to run at.  Generally you should use
-	  the default value here.
+	  Since MDE 4.2, the Tilera hypervisor runs the kernel
+	  at PL2 by default.  If running under an older hypervisor,
+	  or as a KVM guest, you must run at PL1.  (The current
+	  hypervisor may also be recompiled with "make HV_PL=2" to
+	  allow it to run a kernel at PL1, but clients running at PL1
+	  are not expected to be supported indefinitely.)
+
+	  If you're not sure, don't change the default.
 
 source "arch/tile/gxio/Kconfig"
 
--- a/arch/tile/include/hv/hypervisor.h
+++ b/arch/tile/include/hv/hypervisor.h
@@ -107,7 +107,22 @@
 #define HV_DISPATCH_ENTRY_SIZE 32
 
 /** Version of the hypervisor interface defined by this file */
-#define _HV_VERSION 11
+#define _HV_VERSION 13
+
+/** Last version of the hypervisor interface with old hv_init() ABI.
+ *
+ * The change from version 12 to version 13 corresponds to launching
+ * the client by default at PL2 instead of PL1 (corresponding to the
+ * hv itself running at PL3 instead of PL2).  To make this explicit,
+ * the hv_init() API was also extended so the client can report its
+ * desired PL, resulting in a more helpful failure diagnostic.  If you
+ * call hv_init() with _HV_VERSION_OLD_HV_INIT and omit the client_pl
+ * argument, the hypervisor will assume client_pl = 1.
+ *
+ * Note that this is a deprecated solution and we do not expect to
+ * support clients of the Tilera hypervisor running at PL1 indefinitely.
+ */
+#define _HV_VERSION_OLD_HV_INIT 12
 
 /* Index into hypervisor interface dispatch code blocks.
  *
@@ -377,7 +392,11 @@ typedef int HV_Errno;
 #ifndef __ASSEMBLER__
 
 /** Pass HV_VERSION to hv_init to request this version of the interface. */
-typedef enum { HV_VERSION = _HV_VERSION } HV_VersionNumber;
+typedef enum {
+  HV_VERSION = _HV_VERSION,
+  HV_VERSION_OLD_HV_INIT = _HV_VERSION_OLD_HV_INIT,
+
+} HV_VersionNumber;
 
 /** Initializes the hypervisor.
  *
@@ -385,9 +404,11 @@ typedef enum { HV_VERSION = _HV_VERSION
  * that this program expects, typically HV_VERSION.
  * @param chip_num Architecture number of the chip the client was built for.
  * @param chip_rev_num Revision number of the chip the client was built for.
+ * @param client_pl Privilege level the client is built for
+ *   (not required if interface_version_number == HV_VERSION_OLD_HV_INIT).
  */
 void hv_init(HV_VersionNumber interface_version_number,
-             int chip_num, int chip_rev_num);
+             int chip_num, int chip_rev_num, int client_pl);
 
 
 /** Queries we can make for hv_sysconf().
--- a/arch/tile/kernel/head_32.S
+++ b/arch/tile/kernel/head_32.S
@@ -38,7 +38,7 @@ ENTRY(_start)
 	  movei r2, TILE_CHIP_REV
 	}
 	{
-	  moveli r0, _HV_VERSION
+	  moveli r0, _HV_VERSION_OLD_HV_INIT
 	  jal hv_init
 	}
 	/* Get a reasonable default ASID in r0 */
--- a/arch/tile/kernel/head_64.S
+++ b/arch/tile/kernel/head_64.S
@@ -34,13 +34,19 @@
 ENTRY(_start)
 	/* Notify the hypervisor of what version of the API we want */
 	{
+#if KERNEL_PL == 1 && _HV_VERSION == 13
+	  /* Support older hypervisors by asking for API version 12. */
+	  movei r0, _HV_VERSION_OLD_HV_INIT
+#else
+	  movei r0, _HV_VERSION
+#endif
 	  movei r1, TILE_CHIP
-	  movei r2, TILE_CHIP_REV
 	}
 	{
-	  moveli r0, _HV_VERSION
-	  jal hv_init
+	  movei r2, TILE_CHIP_REV
+	  movei r3, KERNEL_PL
 	}
+	jal hv_init
 	/* Get a reasonable default ASID in r0 */
 	{
 	  move r0, zero
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -930,7 +930,7 @@ static int tile_net_setup_interrupts(str
 		if (info->has_iqueue) {
 			gxio_mpipe_request_notif_ring_interrupt(
 				&context, cpu_x(cpu), cpu_y(cpu),
-				1, ingress_irq, info->iqueue.ring);
+				KERNEL_PL, ingress_irq, info->iqueue.ring);
 		}
 	}
 



  parent reply	other threads:[~2013-05-17 22:17 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17 21:35 [ 000/102] 3.9.3-stable review Greg Kroah-Hartman
2013-05-17 21:35 ` [ 001/102] KVM: VMX: fix halt emulation while emulating invalid guest sate Greg Kroah-Hartman
2013-05-17 21:35 ` [ 002/102] KVM: emulator: emulate AAM Greg Kroah-Hartman
2013-05-17 21:35 ` [ 003/102] KVM: emulator: emulate XLAT Greg Kroah-Hartman
2013-05-17 21:35 ` [ 004/102] KVM: emulator: emulate SALC Greg Kroah-Hartman
2013-05-17 21:35 ` [ 005/102] HID: reintroduce fix-up for certain Sony RF receivers Greg Kroah-Hartman
2013-05-17 21:35 ` [ 006/102] ARM: OMAP: RX-51: change probe order of touchscreen and panel SPI devices Greg Kroah-Hartman
2013-05-17 21:35 ` [ 007/102] ASoC: wm8994: missing break in wm8994_aif3_hw_params() Greg Kroah-Hartman
2013-05-17 21:35 ` [ 008/102] ACPICA: Fix possible buffer overflow during a field unit read operation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 009/102] Revert "ALSA: hda - Dont set up active streams twice" Greg Kroah-Hartman
2013-05-17 21:35 ` [ 010/102] ALSA: HDA: Fix Oops caused by dereference NULL pointer Greg Kroah-Hartman
2013-05-17 21:35 ` [ 011/102] ALSA: hda - Fix 3.9 regression of EAPD init on Conexant codecs Greg Kroah-Hartman
2013-05-17 21:35 ` [ 012/102] DMA: OF: Check properties value before running be32_to_cpup() on it Greg Kroah-Hartman
2013-05-17 21:35 ` [ 013/102] dm table: fix write same support Greg Kroah-Hartman
2013-05-17 21:35 ` [ 014/102] dm stripe: fix regression in stripe_width calculation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 015/102] dm bufio: avoid a possible __vmalloc deadlock Greg Kroah-Hartman
2013-05-17 21:35 ` [ 016/102] dm snapshot: fix error return code in snapshot_ctr Greg Kroah-Hartman
2013-05-17 21:35 ` [ 017/102] dm cache: fix error return code in cache_create Greg Kroah-Hartman
2013-05-17 21:35 ` [ 018/102] math64: New div64_u64_rem helper Greg Kroah-Hartman
2013-05-17 21:35 ` [ 019/102] sched: Lower chances of cputime scaling overflow Greg Kroah-Hartman
2013-05-17 21:35 ` [ 020/102] sched: Avoid " Greg Kroah-Hartman
2013-05-17 21:35 ` [ 021/102] sched: Do not account bogus utime Greg Kroah-Hartman
2013-05-17 21:35 ` [ 022/102] Revert "math64: New div64_u64_rem helper" Greg Kroah-Hartman
2013-05-17 21:35 ` [ 023/102] sched: Avoid prev->stime underflow Greg Kroah-Hartman
2013-05-17 21:35 ` [ 024/102] nfsd4: dont allow owner override on 4.1 CLAIM_FH opens Greg Kroah-Hartman
2013-05-17 21:35 ` [ 025/102] nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error Greg Kroah-Hartman
2013-05-17 21:35 ` [ 026/102] hp_accel: Ignore the error from lis3lv02d_poweron() at resume Greg Kroah-Hartman
2013-05-17 21:35 ` [ 027/102] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) Greg Kroah-Hartman
2013-05-17 22:49   ` Al Viro
2013-05-17 23:51     ` Greg Kroah-Hartman
2013-05-19 12:58       ` Satoru Takeuchi
2013-05-19 18:37       ` Greg Kroah-Hartman
2013-05-20 12:42         ` Satoru Takeuchi
2013-05-17 21:35 ` [ 028/102] shm: fix null pointer deref when userspace specifies invalid hugepage size Greg Kroah-Hartman
2013-05-17 21:35 ` [ 029/102] xen/vcpu/pvhvm: Fix vcpu hotplugging hanging Greg Kroah-Hartman
2013-05-17 21:35 ` [ 030/102] SCSI: sd: fix array cache flushing bug causing performance problems Greg Kroah-Hartman
2013-05-17 21:35 ` [ 031/102] audit: Syscall rules are not applied to existing processes on non-x86 Greg Kroah-Hartman
2013-05-17 21:35 ` [ 032/102] audit: vfs: fix audit_inode call in O_CREAT case of do_last Greg Kroah-Hartman
2013-05-17 21:35 ` [ 033/102] time: Revert ALWAYS_USE_PERSISTENT_CLOCK compile time optimizaitons Greg Kroah-Hartman
2013-05-17 21:35 ` [ 034/102] timer: Dont reinitialize the cpu base lock during CPU_UP_PREPARE Greg Kroah-Hartman
2013-05-17 21:35 ` [ 035/102] tick: Cleanup NOHZ per cpu data on cpu down Greg Kroah-Hartman
2013-05-17 21:35 ` [ 036/102] tracing: Fix leaks of filter preds Greg Kroah-Hartman
2013-05-17 21:35 ` [ 037/102] ext4: limit group search loop for non-extent files Greg Kroah-Hartman
2013-05-17 21:35 ` [ 038/102] x86/microcode: Add local mutex to fix physical CPU hot-add deadlock Greg Kroah-Hartman
2013-05-17 21:35   ` Greg Kroah-Hartman
2013-05-17 21:35 ` [ 039/102] ARM: 7720/1: ARM v6/v7 cmpxchg64 shouldnt clear upper 32 bits of the old/new value Greg Kroah-Hartman
2013-05-17 21:35 ` [ 040/102] powerpc: Bring all threads online prior to migration/hibernation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 041/102] powerpc/kexec: Fix kexec when using VMX optimised memcpy Greg Kroah-Hartman
2013-05-17 21:35 ` [ 042/102] ath9k: fix key allocation error handling for powersave keys Greg Kroah-Hartman
2013-05-17 21:35 ` [ 043/102] mwifiex: clear is_suspended flag when interrupt is received early Greg Kroah-Hartman
2013-05-17 21:35 ` [ 044/102] mwifiex: fix memory leak issue when driver unload Greg Kroah-Hartman
2013-05-17 21:36 ` [ 045/102] mwifiex: fix setting of multicast filter Greg Kroah-Hartman
2013-05-17 21:36 ` Greg Kroah-Hartman [this message]
2013-05-17 21:36 ` [ 047/102] B43: Handle DMA RX descriptor underrun Greg Kroah-Hartman
2013-05-17 21:36 ` [ 048/102] iwl4965: workaround connection regression on passive channel Greg Kroah-Hartman
2013-05-17 21:36 ` [ 049/102] drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register Greg Kroah-Hartman
2013-05-17 21:36 ` [ 050/102] drm/mgag200: Fix framebuffer base address programming Greg Kroah-Hartman
2013-05-17 21:36 ` [ 051/102] drm/mm: fix dump table BUG Greg Kroah-Hartman
2013-05-17 21:36 ` [ 052/102] drm: dont check modeset locks in panic handler Greg Kroah-Hartman
2013-05-17 21:36 ` [ 053/102] drm/i915: clear the stolen fb before resuming Greg Kroah-Hartman
2013-05-17 21:36 ` [ 054/102] tcp: force a dst refcount when prequeue packet Greg Kroah-Hartman
2013-05-17 21:36 ` [ 055/102] sfc: Fix naming of MTD partitions for FPGA bitfiles Greg Kroah-Hartman
2013-05-17 21:36 ` [ 056/102] net: tun: release the reference of tun device in tun_recvmsg Greg Kroah-Hartman
2013-05-17 21:36 ` [ 057/102] net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W Greg Kroah-Hartman
2013-05-17 21:36 ` [ 058/102] tcp: reset timer after any SYNACK retransmit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 059/102] 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 060/102] net_sched: act_ipt forward compat with xtables Greg Kroah-Hartman
2013-05-17 21:36 ` [ 061/102] net: use netdev_features_t in skb_needs_linearize() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 062/102] net: vlan,ethtool: netdev_features_t is more than 32 bit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 063/102] bridge: fix race with topology change timer Greg Kroah-Hartman
2013-05-17 21:36 ` [ 064/102] asix: fix BUG in receive path when lowering MTU Greg Kroah-Hartman
2013-05-17 21:36 ` [ 065/102] packet: tpacket_v3: do not trigger bug() on wrong header status Greg Kroah-Hartman
2013-05-17 21:36 ` [ 066/102] virtio: dont expose u16 in userspace api Greg Kroah-Hartman
2013-05-17 21:36 ` [ 067/102] net: frag, fix race conditions in LRU list maintenance Greg Kroah-Hartman
2013-05-17 21:36 ` [ 068/102] 3c59x: fix freeing nonexistent resource on driver unload Greg Kroah-Hartman
2013-05-17 21:36 ` [ 069/102] 3c59x: fix PCI resource management Greg Kroah-Hartman
2013-05-17 21:36 ` [ 070/102] if_cablemodem.h: Add parenthesis around ioctl macros Greg Kroah-Hartman
2013-05-17 21:36 ` [ 071/102] macvlan: fix passthru mode race between dev removal and rx path Greg Kroah-Hartman
2013-05-17 21:36 ` [ 072/102] ipv6: do not clear pinet6 field Greg Kroah-Hartman
2013-05-21 11:44   ` Roman Gushchin
2013-05-21 21:47     ` Eric Dumazet
2013-05-22  8:12       ` Roman Gushchin
2013-05-17 21:36 ` [ 073/102] ipv6,gre: do not leak info to user-space Greg Kroah-Hartman
2013-05-17 21:36 ` [ 074/102] xfrm6: release dev before returning error Greg Kroah-Hartman
2013-05-17 21:36   ` Greg Kroah-Hartman
2013-05-17 21:36 ` [ 075/102] pch_dma: Use GFP_ATOMIC because called from interrupt context Greg Kroah-Hartman
2013-05-17 21:36 ` [ 076/102] watchdog: Fix race condition in registration code Greg Kroah-Hartman
2013-05-17 21:36 ` [ 077/102] drbd: Fix build error when CONFIG_CRYPTO_HMAC is not set Greg Kroah-Hartman
2013-05-17 21:36 ` [ 078/102] drbd: fix memory leak Greg Kroah-Hartman
2013-05-17 21:36 ` [ 079/102] drbd: fix for deadlock when using automatic split-brain-recovery Greg Kroah-Hartman
2013-05-17 21:36 ` [ 080/102] VSOCK: Drop bogus __init annotation from vsock_init_tables() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 081/102] ARM: EXYNOS5: Fix kernel dump in AFTR idle mode Greg Kroah-Hartman
2013-05-17 21:36 ` [ 082/102] drivers/rtc/rtc-pcf2123.c: fix error return code in pcf2123_probe() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 083/102] cpufreq / intel_pstate: remove idle time and duration from sample and calculations Greg Kroah-Hartman
2013-05-17 21:36 ` [ 084/102] cpufreq / intel_pstate: use lowest requested max performance Greg Kroah-Hartman
2013-05-17 21:36 ` [ 085/102] cpufreq / intel_pstate: fix ffmpeg regression Greg Kroah-Hartman
2013-05-17 21:36 ` [ 086/102] iscsi-target: Fix processing of OOO commands Greg Kroah-Hartman
2013-05-17 21:36 ` [ 087/102] target: close target_put_sess_cmd() vs. core_tmr_abort_task() race Greg Kroah-Hartman
2013-05-17 21:36 ` [ 088/102] target/iblock: Fix WCE=1 + DPOFUA=1 backend WRITE regression Greg Kroah-Hartman
2013-05-17 21:36 ` [ 089/102] ACPI / EC: Restart transaction even when the IBF flag set Greg Kroah-Hartman
2013-05-17 21:36 ` [ 090/102] drivers/char/ipmi: memcpy, need additional 2 bytes to avoid memory overflow Greg Kroah-Hartman
2013-05-17 21:36 ` [ 091/102] ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex Greg Kroah-Hartman
2013-05-17 21:36 ` [ 092/102] ASoC: da7213: Fix setting dmic_samplephase and dmic_clk_rate Greg Kroah-Hartman
2013-05-17 21:36 ` [ 093/102] drm/radeon: check incoming cliprects pointer Greg Kroah-Hartman
2013-05-17 21:36 ` [ 094/102] drm/radeon: restore nomodeset operation (v2) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 095/102] usermodehelper: check subprocess_info->path != NULL Greg Kroah-Hartman
2013-05-17 21:36 ` [ 096/102] parisc: only re-enable interrupts if we need to schedule or deliver signals when returning to userspace Greg Kroah-Hartman
2013-05-17 21:36 ` [ 097/102] parisc: fix SMP races when updating PTE and TLB entries in entry.S Greg Kroah-Hartman
2013-05-17 21:36 ` [ 098/102] parisc: use long branch in fork_like macro Greg Kroah-Hartman
2013-05-17 21:36 ` [ 099/102] parisc: fix NATIVE set up in build Greg Kroah-Hartman
2013-05-17 21:36 ` [ 100/102] parisc: make default cross compiler search more robust (v3) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 101/102] audit: Make testing for a valid loginuid explicit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 102/102] target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio Greg Kroah-Hartman
2013-05-19 13:00 ` [ 000/102] 3.9.3-stable review Satoru Takeuchi
2013-05-19 18:38   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130517213249.170527597@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=cmetcalf@tilera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.