Skip to content

[EXPERIMENTAL] Revert mte-ffi changes #142300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/run-make/mte-ffi/bar.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// FIXME(#141600) the mte-ffi test doesn't fail in aarch64-gnu

#ifndef __BAR_H
#define __BAR_H

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/mte-ffi/bar_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <stdint.h>
#include "bar.h"

extern void foo(float*);
extern void foo(char*);

void bar(float *ptr) {
void bar(char *ptr) {
if (((uintptr_t)ptr >> 56) != 0x1f) {
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/mte-ffi/bar_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

extern void foo(unsigned int *);

void bar(unsigned int *ptr) {
void bar(char *ptr) {
if (((uintptr_t)ptr >> 56) != 0x1f) {
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
exit(1);
Expand Down
3 changes: 1 addition & 2 deletions tests/run-make/mte-ffi/bar_string.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "bar.h"

extern void foo(char*);
Expand Down Expand Up @@ -33,7 +32,7 @@ int main(void)

// Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
// and a different value in the ignored top 4 bits.
ptr = (char *)((uintptr_t)ptr | 0x1fl << 56);
ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);

if (mte_enabled()) {
set_tag(ptr);
Expand Down
7 changes: 7 additions & 0 deletions tests/run-make/mte-ffi/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
//! FFI boundaries (C <-> Rust). This test does not require MTE: whilst the test will use MTE if
//! available, if it is not, arbitrary tag bits are set using TBI.

//@ ignore-test
// FIXME(#135867): this test requires running on hardware that has >= ARMv8.5 with MTE enabled.
// However, current `ubuntu-24.04-arm` job runners have to run on Neoverse N1 CPUs (as opposed to
// new Neoverse N2) due to crashing issues as described in #135867.
//
// Therefore, disable this test until job runners are updated to *Sufficiently New* CPUs.

//@ only-aarch64-unknown-linux-gnu
// Reason: this test is only valid for AArch64 with `gcc`. The linker must be explicitly specified
// when cross-compiling, so it is limited to `aarch64-unknown-linux-gnu`.
Expand Down
Loading