Skip to content

Update disk image source to addhypercall and gem5bridge-driver #69

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

Open
wants to merge 18 commits into
base: stable
Choose a base branch
from

Conversation

Harshil2107
Copy link
Contributor

No description provided.

@Harshil2107 Harshil2107 requested a review from erin-le February 5, 2025 22:32
@Harshil2107
Copy link
Contributor Author

I have updated source for the NPB disk image to use hypercalls. I tested the NPB disk images on the staging branch for release 24.1.1. I was able to successfully run NPB benchmarks without using sudo in gem5 KVM simulation. All the hypercalls were triggered as expected.

@Harshil2107
Copy link
Contributor Author

TODO: I need to changes the link and the sha256sum for NPB disk image once the base disk image is uploaded to resources.

make -j 32 && \
make INSTALL_MOD_PATH=/workspace/output modules_install

RUN git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0 && \
Copy link
Contributor

@erin-le erin-le Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the minor release staging branch is merged gem5 v25.0 is released, remember to change this to stable.

make -j $(nproc) && \
make INSTALL_MOD_PATH=/workspace/output modules_install

RUN git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0 && \
Copy link
Contributor

@erin-le erin-le Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the minor release staging branch is merged gem5 v25.0 is released, remember to change this to stable.

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, this message is printed even if the build fails. It would be nice if a different message could be printed for a failure, but it's not high priority.

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, this message is printed even if the build fails. It would be nice if a different message could be printed for a failure, but it's not high priority.

Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

}
```
```

If you need to increase the size of the image when adding more libraries and files to the image update the size of the partition in the respective `http/*/user-data` file. Also, update the `disk_size` parameter in `post-installation.sh` to be at least one mega byte more than the size you defined in the `user-data` file.

**NOTE:** You can extend this disk image by modifying the `post-installation.sh` script, but it requires building the image from scratch.

To take a pre-built image and add new files or packages, take a look at the following [documentation](https://www.gem5.org/documentation/gem5-stdlib/extending-disk-images).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link appears to be broken

@Harshil2107 Harshil2107 force-pushed the add-hyper-call-to-disk branch from 6559de6 to b6830ca Compare February 18, 2025 17:50
@Harshil2107 Harshil2107 force-pushed the add-hyper-call-to-disk branch from b6830ca to 819ed59 Compare February 18, 2025 22:32
@Harshil2107 Harshil2107 changed the base branch from stable to develop February 18, 2025 23:59
@Harshil2107 Harshil2107 changed the base branch from develop to stable February 25, 2025 18:27
@Harshil2107 Harshil2107 changed the base branch from stable to develop May 16, 2025 22:46
memory = "8192"
output_directory = "disk-image-arm-npb"
output_directory = "disk-image-arm-npb-test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this rename meant to be in the final version?

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

Comment on lines +13 to +15
# Installing the packages in this script instead of the user-data
# file dueing ubuntu autoinstall. The reason is that sometimes
# the package install failes. This method is more reliable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos in this comment

fi

# Just get the files we need
git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once gem5 v25.0 is released, remember to change this to stable

## Disk Image
After building the Dockerfile, you can retrieve the kernel and modules on your host using the `copy_modules_to_host.sh` script.
- **`scripts/`**: Contains scripts that run on the disk image after installation.
- **`disable-network.sh`**: Disables networking by renaming the Netplan configuration file (`.yaml` → `.yaml.bak`) and disabling network services in systemd. Disabling network decreases boot time by removing the 2 minute wait for network service to get online in systemd.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to clarify that the 2 minute wait is in simulation time, not wall-clock time.

@Harshil2107 Harshil2107 changed the base branch from develop to stable June 20, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants